Skip to content

improve(ui): fix sidebar session row hierarchy and add a message-preview toggle - #126190

Merged
steipete merged 6 commits into
mainfrom
steipete/sidebar-design-spacing-923f11
Aug 19, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/sidebar-design-spacing-923f11

Conversation

@steipete

@steipete steipete commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

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 --muted to 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 kept color-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 token theme-contrast.test.ts already 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-line row 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 sessionsShowCron plumbing). 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 is isCriticalObserverHealth in ui/src/lib/observer-digest.ts — stuck and waiting-on-user, the same pair critical-observer-notice.ts announces 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-sessions padding is clearance so a classic non-overlay scrollbar cannot clip the selection pill. Making it symmetric reverts that fix, and sidebar-selection-overflow.e2e.test.ts catches it. Space is reclaimed inside the row instead (row + link padding-right 4px → 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. main had 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. main had 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 is someSidebarSessionInTree, 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.ts to 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 one someSidebarSessionInTree helper 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__body is untouched. Reclaiming the remaining 8px properly means replacing that hand-rolled gutter with scrollbar-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 current main; 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.

sidebar before/after

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 passed
  • node 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 passed

New 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. main was red at 7f60af7f8: extensions/codex/src/app-server/run-attempt-tools.test.ts arrived in #126189 with no shard claim, because the support shard globs app-server/**/*.test.ts but excludes the whole run-attempt* pattern while the attempt shards enumerate by filename. It was owned by nobody and never executing. Registered in the attempt-extra shard 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 new run-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-presentation asserted busy and plain rows share a height, and codex-sessions asserted 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) — getBoundingClientRect returns 1/65536 fractions that move under CPU contention.

The added openclaw:sidebar:sessions:show-preview key reads !== "false", so an existing browser with no key resolves to previews on — current behavior, no migration. It reads inverted relative to its show-cron / show-system siblings because those default off and this defaults on.

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 19, 2026 05:13
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Aug 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 19, 2026, 1:50 AM ET / 05:50 UTC.

ClawSweeper review

What this changes

This PR improves Control UI sidebar row hierarchy and adds a default-on, local browser preference to hide ambient session previews.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: the prior P1 remains unresolved because turning previews off still removes critical stuck and waiting-on-user observer headlines from the persistent sidebar.

Priority: P1
Reviewed head: dff7beb5cee390d68d44a05fec2c5a45a8cb456c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation has focused evidence but remains blocked by a concrete P1 state-visibility defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the PR body nevertheless supplies mock-Control-UI evidence and focused test results.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the PR body nevertheless supplies mock-Control-UI evidence and focused test results.
Evidence reviewed 6 items Preview-off branch drops observer state: The changed early return preserves only attention and the queued explanation, before the resolver computes the exact-active-run observer digest and headline.
Critical observer contract: Current main explicitly classifies stuck and waiting-on-user as the two observer health states requiring operator attention.
Operator-visible sibling behavior: The chat-side observer handler announces these critical states to operators, confirming the headline is not merely ambient preview content.
Findings 1 actionable finding [P1] Keep critical observer headlines outside preview suppression
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/e2e/chat-flow.sidebar-presentation.e2e.test.ts

Result: FAIL (partial) — step 2 expect_output collapses rows that have no second line: expected terminal output was not visible within 30 seconds: "collapses rows that have no second line"

node scripts/run-vitest.mjs ui/src/e2e/chat-flow.sidebar-presentation.e2e.test.ts
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-126190-aNwy0H/target$ node scripts/run-vitest.mjs ui/src/e2e/chat-flow.sidebar-presentation.e2e.test.ts
[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
node scripts/run-vitest.mjs ui/src/e2e/chat-flow.sidebar-presentation.e2e.test.ts
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-126190-aNwy0H/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126190-aNwy0H/target






























Assertions:

  • FAIL expect_output: collapses rows that have no second line

How this fits together

The 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]
Loading

Before merge

  • Keep critical observer headlines outside preview suppression (P1) - The preview-off return runs before observer-digest reconciliation, so an active exact-run digest with stuck or waiting-on-user loses the sidebar headline. Those are explicitly the observer health states requiring operator attention in ui/src/lib/observer-digest.ts; preserve them here and cover both values. This is the still-unfixed prior P1 finding.
  • Resolve merge risk (P1) - With previews disabled, an active session whose exact observer digest becomes stuck or waiting-on-user collapses to one line without its persistent operator headline; a previously shown toast does not provide durable sidebar state.

Findings

  • [P1] Keep critical observer headlines outside preview suppression — ui/src/components/session-row-subtitle.ts:36-37
Agent review details

Security

None.

PR surface

Source +100, Tests +90. Total +190 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 12 149 49 +100
Tests 4 97 7 +90
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 246 56 +190

Review metrics

Metric Value Why it matters
Production versus test delta production +118/-49 (net +69), tests +128/-7 The user-facing preference and row-layout change has justified feature growth, but its state-preservation branch remains merge-blocking.
Persistent preference 1 added localStorage key, default on Existing browsers retain the choice across reloads, so its handling of operator-visible state needs upgrade-safe review.

Stored data model

Persistent data-model change detected: serialized state: ui/src/components/session-organizer-controller-types.ts, serialized state: ui/src/components/session-organizer-controller.ts, serialized state: ui/src/components/session-row-subtitle.test.ts, serialized state: ui/src/components/session-row-subtitle.ts, serialized state: ui/src/e2e/session-management.trailing-state.e2e.test.ts, unknown-data-model-change: ui/src/components/session-row-subtitle.test.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Preserve critical observer headlines (recommended)
    Move critical observer-state selection ahead of preview suppression and add focused coverage for active stuck and waiting-on-user runs.

Technical review

Best 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 showPreview: false with an active session and an exact-run observer digest whose health is stuck or waiting-on-user; the early return omits its headline.

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:

  • [P1] Keep critical observer headlines outside preview suppression — ui/src/components/session-row-subtitle.ts:36-37
    The preview-off return runs before observer-digest reconciliation, so an active exact-run digest with stuck or waiting-on-user loses the sidebar headline. Those are explicitly the observer health states requiring operator attention in ui/src/lib/observer-digest.ts; preserve them here and cover both values. This is the still-unfixed prior P1 finding.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2bcc06cc2270.

Labels

Label justifications:

  • P1: The changed display preference can hide action-required state for an active session from the operator sidebar.
  • merge-risk: 🚨 session-state: A locally persisted preview setting changes whether active session state remains visible after refresh.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the PR body nevertheless supplies mock-Control-UI evidence and focused test results.

Evidence

What I checked:

Likely related people:

  • steipete: History attributes the observer/sidebar feature and the current preview-off adjustment to Peter Steinberger; the supplied PR metadata maps that history to @steipete. (role: feature owner and recent area contributor; confidence: high; commits: 1f0a3ecc68a0, dff7beb5cee3; files: ui/src/lib/observer-digest.ts, ui/src/components/session-row-subtitle.ts, ui/src/pages/chat/critical-observer-notice.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve critical active observer headlines when previews are off and add regression coverage for both critical health values.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-19T05:18:24.759Z sha dff7beb5cee390d68d44a05fec2c5a45a8cb456c :: needs changes before merge. :: [P1] Preserve critical observer state when hiding previews

@steipete
steipete force-pushed the steipete/sidebar-design-spacing-923f11 branch from dff7beb to 8e75c20 Compare August 19, 2026 06:25
…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.
@steipete
steipete force-pushed the steipete/sidebar-design-spacing-923f11 branch from 8e75c20 to c0987ed Compare August 19, 2026 06:35
…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.
@steipete

Copy link
Copy Markdown
Contributor Author

Thanks — the P1 is correct and now fixed in b14d9b4.

[P1] Keep critical observer headlines outside preview suppression — verified against source and addressed. isCriticalObserverHealth in ui/src/lib/observer-digest.ts:32 exists precisely to mark stuck and waiting-on-user as the two states needing an operator, and ui/src/pages/chat/critical-observer-notice.ts announces the same pair in the chat pane. A transient toast is not durable sidebar state, so suppressing the row headline behind a display preference is exactly the silent-failure class the attention and queued exemptions already guard against. I had under-applied my own rule.

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.

const observer = running || finalDigestUnread ? projectedDigest?.headline : undefined;
if (!params.showPreview) {
  const critical = isCriticalObserverHealth(projectedDigest?.health) ? observer : undefined;
  return { subtitle: attention ?? queued ?? critical, narration: undefined };
}

Coverage is parameterized over both critical values, plus a non-critical (on-track) control so the fix cannot pass by simply suppressing nothing:

node scripts/run-vitest.mjs ui/src/components/session-row-subtitle.test.ts \
  ui/src/components/app-sidebar.test.ts ui/src/components/app-sidebar-session-types.test.ts \
  ui/src/lib/observer-digest.test.ts
# 307 passed

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 stuck or waiting-on-user keeps its persistent headline and stays two-line with previews off. The single Rank-up move is likewise this finding — applied, not skipped.

Two notes on other review items:

Stored data model / upgrade proof. The one added key is openclaw:sidebar:sessions:show-preview, read as getItem(...) !== "false". An existing browser with no key resolves to previews on, which is current behavior, so there is no migration and no upgrade-visible change. It intentionally reads inverted relative to the show-cron / show-system siblings because those default off and this one defaults on.

Live Verification FAIL. That step polls terminal output for the literal string collapses rows that have no second line, which is the test title this PR renamed (the old contract asserted busy and plain rows share a height — the change deliberately supersedes it). The suite itself passes; on the current head chat-flow.sidebar-presentation.e2e.test.ts is green locally and in CI. Worth pinning that assertion to a stable identifier rather than a title string.

Also folded in while landing: c0987ed registers extensions/codex/src/app-server/run-attempt-tools.test.ts, which arrived in #126189 with no shard claim. The support shard globs app-server/**/*.test.ts but excludes the whole run-attempt* pattern while the attempt shards enumerate by filename, so it was owned by nobody and never executing. main was red on it at 7f60af7f8; it reached this PR through the merge ref. Unrelated to the sidebar work, fixed here rather than landing onto a red gate.

@steipete
steipete merged commit 9b43f1c into main Aug 19, 2026
149 checks passed
@steipete
steipete deleted the steipete/sidebar-design-spacing-923f11 branch August 19, 2026 07:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 19, 2026
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.
steipete added a commit that referenced this pull request Aug 19, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant