Repository navigation
improve(ui): fix sidebar session row hierarchy and add a message-preview toggle - #126190
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 19, 2026, 1:50 AM ET / 05:50 UTC. ClawSweeper reviewWhat this changesThis PR improves Control UI sidebar row hierarchy and adds a default-on, local browser preference to hide ambient session previews. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open: the prior P1 remains unresolved because turning previews off still removes critical Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherThe Control UI converts Gateway session rows, attention, and observer digests into sidebar subtitles for operators. The new local preference reaches the subtitle resolver before the row layout is selected. flowchart LR
Gateway[Gateway session state] --> Resolver[Sidebar subtitle resolver]
Observer[Observer digest] --> Resolver
Preference[Preview preference] --> Resolver
Resolver --> Row[Sidebar session row]
Row --> Operator[Operator sidebar]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +100, Tests +90. Total +190 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Resolve the exact active observer digest before applying the preview preference, retain only critical observer headlines alongside attention and queued state, and cover both critical health values. Do we have a high-confidence way to reproduce the issue? Yes, from source: pass Is this the best way to solve the issue? No: preserving only queued and attention text is too narrow because the existing observer contract separately identifies two critical states that require operator attention. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2bcc06cc2270. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
dff7beb to
8e75c20
Compare
…iew toggle Pinned sessions render in the nav zone, which paints the whole row --muted to share the page-nav chrome. The zone also forced the session *title* to inherit that muted colour while the subtitle kept a brighter mix, so a pinned row's preview line outshone its own name and the same session read dimmer pinned than unpinned. A title is content in every zone; only glyphs, meta and the hover fill follow the zone. The subtitle moves to plain --muted, already proven AA against every surface by theme-contrast.test.ts. Rows with no preview text reserved the fixed 18px second line anyway, leaving either a dead band under the title or a lone spinner/unread dot hanging below-right of it. Those rows now collapse to one line via a --single-line class plus a CSS variant, so the endcap rides beside the title. Adds a localStorage-backed "Show message preview" toggle to the session sort menu (default on), mirroring the existing sessionsShowCron plumbing. Attention text is exempt: silencing an error behind a display preference is the silent-failure class, so those rows keep their subtitle and stay two-line. Reclaims right-hand space inside the row (row + link padding-right 4px -> 2px) rather than widening it: .sidebar-recent-sessions' asymmetric inline margin is deliberate (#124879), keeping the selection pill clear of a classic scrollbar. A comment now records that at the CSS site. Extracts flattenSidebarSessionTree to dedupe two hand-rolled walks over the same session tree, which also returns app-sidebar-session-navigation.ts under the 700-line limit the new state field had pushed it over.
Rebasing onto main brought in a "Waiting for a concurrency slot" subtitle for admitted-but-queued sessions. It is not preview text: it is the only thing that distinguishes a run waiting on a slot from an idle session, so hiding it behind a display preference turns a visible non-outcome into a silent one. It now joins attention as exempt from the toggle. Main also rewrote the owner filter's descendant walk to short-circuit on the first participating row. Both remaining call sites ask "does any row match", so the shared helper is a search, not a flatten: someSidebarSessionInTree keeps that early exit instead of walking the whole tree to answer it.
…l rows codex-sessions guarded a real cross-surface invariant — gateway threads and native catalog children must not drift apart in density — but expressed it as "all four rows have the same height" plus hardcoded 3px padding. Rows with no preview text now collapse to one line, and rows gained 1px of vertical padding, so both encodings are stale. Asserts uniformity within each shape instead: the collapsed rows share a height on the 30px min-height floor, the two-line rows share a taller one. Drift between the two session sources still fails, while the collapse stays legal. The exact height check carries a tolerance because the renderer reports 30.000015px.
…y check getBoundingClientRect returns 1/65536 fractions that shift under CPU contention, so asserting bit-identical floats before and after opening a session failed 2 of 6 runs in a loaded four-file shard while passing 5 of 5 in isolation. The contract is that the row does not change size, not that two renders agree to 14 decimal places. Same batch is 6 of 6 with the tolerance.
run-attempt-tools.test.ts arrived in #126189 without a shard claim. The support shard globs app-server/**/*.test.ts but excludes the whole run-attempt* pattern, and every other run-attempt file is enumerated by name across the attempt shards, so this one was owned by nobody and the full-suite ownership audit failed. main is red on it (7f60af7); it reaches this PR through the merge ref, not the branch. Claims it in the attempt-extra shard alongside its run-attempt-lifecycle-controller and run-attempt-thread-cleanup siblings. Unrelated to the sidebar change; fixed here rather than landing onto a red gate.
8e75c20 to
c0987ed
Compare
…idden The preview-off return sat above observer-digest reconciliation, so an active exact-run digest reporting stuck or waiting-on-user lost its sidebar headline. isCriticalObserverHealth exists precisely to mark those two as the health states needing an operator, and critical-observer-notice announces the same pair in the chat pane -- a transient toast is not durable sidebar state. Hiding them behind a display preference is the silent-failure class the attention and queued exemptions already guard against; this applies that rule where it was missed. Resolves the digest before the preference check and lets a critical headline through alongside attention and queued. Covers both critical values plus a non-critical control, so the fix cannot pass by suppressing nothing. Addresses the ClawSweeper P1 on 126190.
|
Thanks — the P1 is correct and now fixed in [P1] Keep critical observer headlines outside preview suppression — verified against source and addressed. The fix follows the recommended shape: resolve the exact-active-run digest before the preference check, then let a critical headline through alongside attention and queued. Coverage is parameterized over both critical values, plus a non-critical ( The second "Before merge" item is the merge-risk restatement of the same finding, so it is covered by the same change: an active session that goes Two notes on other review items: Stored data model / upgrade proof. The one added key is Live Verification FAIL. That step polls terminal output for the literal string Also folded in while landing: |
|
Merged via squash.
|
Three PRs fixed the same orphaned test within minutes of each other -- #126222, #126225 and #126190 -- so the full-suite ownership audit flipped from "missing" to "duplicated" and main went red at 554dfbe. Keeps the claim from #126225, whose entire purpose was routing this test, and drops the two incidental ones added while landing unrelated UI work. The audit passes 18/18 and the test still runs, once, in the attempt-light shard. Root cause is the shard layout: the support shard globs app-server/**/*.test.ts but excludes the whole run-attempt* pattern while the attempt shards enumerate by filename, so every new run-attempt-* file is unowned until someone hand-adds it, and concurrent fixers then collide.
Three PRs fixed the same orphaned test within minutes of each other -- #126222, #126225 and #126190 -- so the full-suite ownership audit flipped from "missing" to "duplicated" and main went red at 554dfbe. Keeps the claim from #126225, whose entire purpose was routing this test, and drops the two incidental ones added while landing unrelated UI work. The audit passes 18/18 and the test still runs, once, in the attempt-light shard. Root cause is the shard layout: the support shard globs app-server/**/*.test.ts but excludes the whole run-attempt* pattern while the attempt shards enumerate by filename, so every new run-attempt-* file is unowned until someone hand-adds it, and concurrent fixers then collide.
Three PRs fixed the same orphaned test within minutes of each other -- openclaw#126222, openclaw#126225 and openclaw#126190 -- so the full-suite ownership audit flipped from "missing" to "duplicated" and main went red at 0d090ac. Keeps the claim from openclaw#126225, whose entire purpose was routing this test, and drops the two incidental ones added while landing unrelated UI work. The audit passes 18/18 and the test still runs, once, in the attempt-light shard. Root cause is the shard layout: the support shard globs app-server/**/*.test.ts but excludes the whole run-attempt* pattern while the attempt shards enumerate by filename, so every new run-attempt-* file is unowned until someone hand-adds it, and concurrent fixers then collide.
What Problem This Solves
Three related defects made the Control UI sidebar session list read badly.
Pinned sessions looked dimmer than the same session unpinned. Pinned rows sit in the nav zone, which paints its whole row
--mutedto share the page-nav chrome..sidebar-zone-entry .sidebar-recent-session__name { color: inherit }pulled the session title down to--muted(#8b8b94) while the subtitle underneath keptcolor-mix(--muted 55%, --text 45%)(#a1a1a7) — so a pinned row's preview line was literally brighter than the session name it belonged to, and the same session read dimmer pinned than unpinned.Rows with no preview text looked broken. Every row reserved a fixed 18px second line. A row with no subtitle either showed a dead band under the title, or worse, showed only its endcap — a lone spinner, unread dot, or badge hanging below-right of the title with nothing beside it.
The right-hand gutter wasted space. The session-row endcap sat 26px from the sidebar edge while nav-item content sat at 18px, so activity indicators floated well short of the edge.
Why This Change Was Made
A session title is content in every zone; only glyphs, meta, and hover/active fill follow the zone's chrome contract. Deleting the zone title override (whose size and weight already duplicated the base rule) restores that, and the subtitle moves to plain
var(--muted)— dimmer, and a tokentheme-contrast.test.tsalready proves ≥4.5:1 against every surface in every theme, so it is better guarded than the ad-hoc mix it replaces.Rows with no subtitle now collapse to one line via a
--single-linerow class plus a CSS variant that turns the text column into a row flex, so the endcap rides beside the title. No markup branch and no new element. This supersedes the previous "busy and plain rows are the same height" contract, so the e2e test that asserted it was rewritten to assert the new two-branch contract rather than deleted.Preview text is now toggleable from the session sort menu ("Show message preview", default on, localStorage-backed, mirroring the existing
sessionsShowCronplumbing). With it off, every non-attention row falls into the single-line variant. Operator-actionable state is deliberately exempt from the toggle. Silencing it behind a display preference is the silent-failure class this repo ranks worst, so three things always show and keep their two-line row: attention (error / approval / question), the queued "waiting for a concurrency slot" explanation, and a critical observer headline. That last one isisCriticalObserverHealthinui/src/lib/observer-digest.ts—stuckandwaiting-on-user, the same paircritical-observer-notice.tsannounces in the chat pane. A toast is transient; the sidebar row is the durable signal. Everything else — narration, non-critical observer headlines, last-message preview, work subtitle, agent status note — is preview text and hides.For the gutter:
.sidebar-recent-sessions { margin-inline: -8px 0 }is asymmetric on purpose (#124879) — the right 8px of.sidebar-sessionspadding is clearance so a classic non-overlay scrollbar cannot clip the selection pill. Making it symmetric reverts that fix, andsidebar-selection-overflow.e2e.test.tscatches it. Space is reclaimed inside the row instead (row + linkpadding-right4px → 2px, endcap 26px → 22px from the edge), and a comment now records the asymmetry at the CSS site so the next person does not repeat the mistake. Rows also gained a little vertical air (link padding 3px → 4px, group gap 2px → 4px).Two things surfaced while rebasing over 317 commits of
main.mainhad added a "Waiting for a concurrency slot" subtitle for admitted-but-queued sessions; that is not preview text, it is the only thing separating a run waiting on a slot from an idle session, so it joins attention as exempt from the toggle.mainhad also rewritten the owner filter's descendant walk to short-circuit on the first participating row — both remaining call sites ask "does any row match", so the shared helper issomeSidebarSessionInTree, a short-circuiting search, rather than a flatten that would have discarded that early exit.Opportunistic cleanup: adding the preference pushed
app-sidebar-session-navigation.tsto 701 lines against a hard 700-line limit where suppressions are banned. That file and its logic sibling each carried a hand-rolled walk over the same session tree — one flattening for creator facets, one searching for a key. Extracting onesomeSidebarSessionInTreehelper dedupes both, shrinks the 123-line method the second was buried in, and puts the file back under the limit (−11 production lines there).Non-goals: no gateway, protocol, config-file, or storage surface changes; the scrollbar gutter on
.sidebar-shell__bodyis untouched. Reclaiming the remaining 8px properly means replacing that hand-rolled gutter withscrollbar-gutter: stable, which is a separate change with its own proof.User Impact
Session titles read at one consistent brightness whether a session is pinned or in the list, and preview text sits a clear step below the title instead of competing with it. Rows without a preview no longer show an orphaned indicator under a dead 18px band — they collapse to a compact single line with the indicator beside the title. Activity indicators sit closer to the sidebar edge, and rows have slightly more breathing room. Operators who prefer a dense list can now turn preview text off entirely from the session sort menu; errors and pending approvals stay visible regardless.
Evidence
Captured from the mocked Control UI dev server (
pnpm dev:ui:mock) at 2x, dark theme, on the rebased branch. Left is currentmain; middle is this change; right is the same with "Show message preview" turned off. Note the orphaned spinner and dots under "Sidebar narration demo", "Lisbon trip planning", and "Family" in BEFORE.Measured geometry, 257px sidebar (before → after): pinned title
rgb(139,139,148)→rgb(188,188,192)(matches list titles); subtitle#a1a1a7→#8b8b94; endcap right gap 26px → 22px; rows without a subtitle 44px → 30px.Proof run:
node scripts/check-changed.mjs— exit 0 (format, both typecheck lanes, oxlint core + UI styles, i18n catalog, max-lines ratchet, dead-export scan)node scripts/run-vitest.mjs ui/src/components/session-row-subtitle.test.ts ui/src/components/app-sidebar-session-types.test.ts ui/src/components/app-sidebar.test.ts ui/src/styles/theme-contrast.test.ts— 290 passednode scripts/run-vitest.mjs ui/src/components/app-sidebar-session-navigation-logic.test.ts ui/src/components/app-sidebar.test.ts ui/src/components/session-row-subtitle.test.ts ui/src/components/app-sidebar-session-types.test.ts— 323 passed (rebased tree)node scripts/run-vitest.mjs ui/src/e2e/chat-flow.sidebar-presentation.e2e.test.ts ui/src/e2e/sidebar-selection-overflow.e2e.test.ts ui/src/e2e/session-management.trailing-state.e2e.test.ts ui/src/e2e/sidebar-interactions.e2e.test.ts ui/src/e2e/session-management.sidebar.e2e.test.ts— 28 passedNew coverage: preference default-on plus persistence round-trip; an invariant assertion that every preview candidate is dropped when the toggle is off while attention text survives; and a boundary test through the mounted sidebar proving an attention row keeps its subtitle and stays two-line while a preview row collapses.
New coverage also asserts the queued explanation and both critical observer health values survive preview-off, with a non-critical (
on-track) control so the exemption cannot pass by suppressing nothing.LOC delta (branch vs merge base): production +124/−52 (net +72, the new preference surface), tests +207/−12 across 18 files.
Also folded in while landing.
mainwas red at7f60af7f8:extensions/codex/src/app-server/run-attempt-tools.test.tsarrived in #126189 with no shard claim, because the support shard globsapp-server/**/*.test.tsbut excludes the wholerun-attempt*pattern while the attempt shards enumerate by filename. It was owned by nobody and never executing. Registered in theattempt-extrashard next to its siblings; the ownership audit passes 18/18 and the previously-orphaned test runs green. Unrelated to the sidebar work, fixed here rather than landing onto a red gate. That shard layout will keep swallowing newrun-attempt-*files — worth a follow-up so one shard claims the residue of that glob.Two test contracts this change deliberately supersedes, rewritten rather than deleted:
chat-flow.sidebar-presentationasserted busy and plain rows share a height, andcodex-sessionsasserted all four gateway/catalog rows share one height plus hardcoded 3px padding. Both now assert per-shape uniformity, so genuine drift between the two session sources still fails. One exact-equality height check also gained a tolerance after measuring 2 failures in 6 runs under a loaded shard (6/6 with the tolerance) —getBoundingClientRectreturns 1/65536 fractions that move under CPU contention.The added
openclaw:sidebar:sessions:show-previewkey reads!== "false", so an existing browser with no key resolves to previews on — current behavior, no migration. It reads inverted relative to itsshow-cron/show-systemsiblings because those default off and this defaults on.