Repository navigation
fix(ui): stabilize the sidebar session list with a single projection owner - #129150
Conversation
The sidebar flickered as gateway events arrived: rows popped out when runs ended (active/pinned page bypass), rows jumped within createdAt ties after paging (per-publish created-order pruning), child trees auto-collapsed when a descendant went idle (per-render derivation), and running-row subtitles blank-flashed between observer/narration updates. SidebarSessionProjection now owns all presentation stability for the sidebar lifetime: sticky page membership with user-action reset boundaries, a monotonic bounded created-order registry, latched child expansion with an explicit collapsed-by-user mode, and a last-subtitle hold per active run. The scattered mechanisms it replaces are deleted (limitSidebarSessionRows, partitionSidebarVisibleSections, per-publish order pruning, three expansion key sets).
…y floor Live A/B on a dev gateway showed two residual subtitle defects: the hold was keyed to the exact active-run-id set, so the queued->running rotation still blanked the row, and racing ambient sources (observer digest, narration, work path) swapped the line A->B->A within a second. The hold now lives for the session's running lifetime and ambient replacements respect a 2s minimum display floor (matching the narration throttle); attention, agent status, and the queued explanation bypass the floor because the operator must act on them.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 25, 2026, 4:18 AM ET / 08:18 UTC. ClawSweeper reviewWhat this changesThe PR moves sidebar session pagination, creation-order ties, child expansion, and running-row subtitle state into a sidebar-lifetime projection. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open: the projection centralizes the intended stability rules, but it fails to reset sticky page membership when the operator changes sidebar grouping, leaving an old overflow page visible across that user-initiated boundary. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherGateway session updates are normalized into sidebar rows, then grouped and paginated for the Control UI. The new projection owns which rows remain visible, tree expansion, and displayed run activity before the sidebar renders them. flowchart LR
A[Gateway session updates] --> B[Session data cache]
B --> C[Sidebar projection]
C --> D[Grouping and paging]
C --> E[Expansion and subtitles]
D --> F[Sidebar session list]
E --> F
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +241, Tests +623. Total +864 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Make effective grouping part of the projection’s reset boundary and add a focused regression that verifies the newly selected grouping starts from its normal page while preserving the single projection owner. Do we have a high-confidence way to reproduce the issue? Yes, from source: retain an overflow ungrouped row, then switch category/person/none grouping; the projection does not reset that section’s sticky set. Is this the best way to solve the issue? No. The single projection owner is the right layer, but its reset predicate must include effective grouping rather than relying on callers or section-ID cleanup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 490c645f6424. LabelsLabel changes:
Label 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
|
The run-rotation and critical-replacement tests asserted the localized queued string through the shared i18n singleton; in the striped ui CI lane (shared module graph, isolate=false) that resolution is environment- sensitive and failed in checks-node-compact-large-11. Narration and agentStatusNote exercise the same hold invariants with raw strings.
ClawSweeper finding: grouping switches can re-emit the same section id (e.g. ungrouped) with a different row population, so sticky keys must not carry across; grouping now joins the membership reset boundary with a regression row in the boundary table. The created-sort e2e migrates to the sticky contract: an externally discovered newest session still lands on top, and the previously visible page is retained instead of evicted.
|
Merged via squash.
|
…owner (openclaw#129150) * fix(ui): stabilize sidebar session list with a single projection owner The sidebar flickered as gateway events arrived: rows popped out when runs ended (active/pinned page bypass), rows jumped within createdAt ties after paging (per-publish created-order pruning), child trees auto-collapsed when a descendant went idle (per-render derivation), and running-row subtitles blank-flashed between observer/narration updates. SidebarSessionProjection now owns all presentation stability for the sidebar lifetime: sticky page membership with user-action reset boundaries, a monotonic bounded created-order registry, latched child expansion with an explicit collapsed-by-user mode, and a last-subtitle hold per active run. The scattered mechanisms it replaces are deleted (limitSidebarSessionRows, partitionSidebarVisibleSections, per-publish order pruning, three expansion key sets). * fix(ui): hold running-row subtitles across run rotation with a display floor Live A/B on a dev gateway showed two residual subtitle defects: the hold was keyed to the exact active-run-id set, so the queued->running rotation still blanked the row, and racing ambient sources (observer digest, narration, work path) swapped the line A->B->A within a second. The hold now lives for the session's running lifetime and ambient replacements respect a 2s minimum display floor (matching the narration throttle); attention, agent status, and the queued explanation bypass the floor because the operator must act on them. * test(ui): assert subtitle holds on non-localized sources The run-rotation and critical-replacement tests asserted the localized queued string through the shared i18n singleton; in the striped ui CI lane (shared module graph, isolate=false) that resolution is environment- sensitive and failed in checks-node-compact-large-11. Narration and agentStatusNote exercise the same hold invariants with raw strings. * fix(ui): reset sticky sidebar membership when grouping changes ClawSweeper finding: grouping switches can re-emit the same section id (e.g. ungrouped) with a different row population, so sticky keys must not carry across; grouping now joins the membership reset boundary with a regression row in the boundary table. The created-sort e2e migrates to the sticky contract: an externally discovered newest session still lands on top, and the previously visible page is retained instead of evicted.
What Problem This Solves
The sidebar session list visibly flickers as gateway events arrive: rows pop out of the visible page the moment their run ends, rows jump within
createdAtties after paging, child session trees auto-collapse on their own when a descendant run finishes, and a running row's status line blank-flashes and swaps text at event rate. Operators watching a busy sidebar (the normal state on team gateways) see constant churn that carries no information.Four scattered mechanisms each independently re-derived presentation state per render:
limitSidebarSessionRowsforce-included active/pinned rows, so a session dropped off the page when its run ended, shifting every row below.containsActiveDescendant, so trees collapsed themselves when the child run went idle.Why This Change Was Made
Rather than patching each symptom, presentation stability now has one owner:
SidebarSessionProjection(sidebar-lifetime state, consumed once per render pass via the existingwillUpdatesnapshot). It owns:collapsed-by-user/expanded/expanded-fully) replaces three parallel key sets; auto-expansion latches after the descendant idles, and an explicit user collapse sticks.The mechanisms it replaces are deleted:
limitSidebarSessionRows,partitionSidebarVisibleSections,promoteSidebarSessionCreatedOrder, per-publish created-order pruning, and the three expansion key sets. Sort semantics (created/updated/people) are unchanged;updatedmode still reorders on activity by design.User Impact
The sidebar only changes when something meaningful changes: new sessions appear, user actions re-page or re-sort, and run state renders in place. No more rows vanishing when a run completes, trees snapping shut mid-read, or status lines strobing.
Evidence
ui/src/e2e/sidebar-session-stability.e2e.test.ts, mocked-gateway browser run): asserts the visible row set, order, and expansion survive run start→events→completion→navigation. Reproduced failing on pre-fix code for the intended reason (tree auto-collapsed after run completion).OPENCLAW_STATE_DIR, own port 19807, realanthropic/claude-haiku-4-5runs over 12 sessions, sidebar sampled at 300–500ms):ui/src/components+ui/src/lib/sessions(162 files, 2147 passed), changed-file gates (format, tsgo UI typecheck, lint, styles) green.Live proof videos and captures attached below (mock fixture + dev-gateway
proof-*sessions only; no personal data).sidebar-live-before.webm
sidebar-live-after.webm