Repository navigation
feat(ui): move session filter to a global sidebar toolbar - #125690
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 11:02 AM ET / 15:02 UTC. ClawSweeper reviewWhat this changesMoves the Control UI session filter and new-session actions into a persistent sidebar toolbar, labels ungrouped sessions as Other, and updates supporting docs, tests, and proof capture. Merge readinessKeep open. Current main still hides the session-wide controls in the ungrouped header; this PR moves them into persistent global chrome while retaining the existing action callbacks. The prior generated-artifact finding is resolved, and no blocking correctness or security issue was found. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Control UI sidebar partitions Gateway session rows into groups, ungrouped sessions, coding, and catalog sections. Its session toolbar opens the existing global filter menu and new-session flow, which then affect the displayed session list. flowchart LR
A[Gateway session rows] --> B[Sidebar partition]
B --> C[Section header decision]
C --> D[Session toolbar]
D --> E[Filter and sort menu]
D --> F[New session flow]
E --> G[Visible session list]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +88, Tests +18, Docs 0, Config +1, Other +309. Total +416 across 21 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Land the toolbar design after exact-head checks complete, keeping global actions routed through the existing sidebar host APIs and proof captures under ignored artifacts. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature review; current-main source clearly establishes the prior hover-gated placement that this PR changes. Is this the best way to solve the issue? Yes. The toolbar uses existing filter-menu and new-session callbacks, and the header decision is computed once at the partition owner rather than duplicated in render paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8131f56cb133. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
4c72365 to
659e452
Compare
|
Responding to the review findings: [P1] Preserve the saved ungrouped collapse preference — rejected as a named tradeoff. When "Other" is the only headered section, honoring a stored collapsed state would blank the entire session list beneath a toolbar that offers no collapse control — a hidden-state dead end worse than showing the rows. The preference is not destroyed: it stays persisted and re-applies unchanged the moment a peer section returns. This decision is now recorded at the partition site ( [P3] Stale new-session location in the guide — fixed. |
a03a903 to
848a908
Compare
Also name the accepted tradeoff for the inert ungrouped-collapse preference at the partition site (ClawSweeper P1/P3 response).
Menu-geometry assertions now measure relative to the picker anchor in one atomic evaluate (immune to unrelated page settles, still catches focus-induced moves). The post-reload refill raced the composer's async draft restore, which appended the stored draft to the typed text; waiting for the restored draft asserts the documented persistence instead. Failed CI shard checks-ui-e2e 5/12 on runs 32122284238 attempts 1-2.
848a908 to
2e42f5e
Compare
|
Exact-head
|
|
Land-ready update on exact head
No remaining proof gap identified for the landing gate. |
|
Merged via squash.
|
… text After a reload the new-session composer renders before the gateway recovery scope arrives; selectRoute then zeroes the draft revision, so text typed in that window lost to the stored draft's higher revision and the async restore overwrote (or, interleaved with input, appended to) what the user had typed. Seen on PR #125690 CI (checks-ui-e2e 5/12, run 32122284238) as a doubled composer value. NewSessionDraftPersistence now records a pristine baseline at each programmatic content replacement (page reset, navigation handoff, restore apply) and restores only when no user mutation happened past it; otherwise the typed text wins and persists above the stored revision, including minting a revision for text typed before route activation so that draft still lands. The chat composer sibling is unaffected: its revision lineage persists synchronously to localStorage.
… text (#125884) * fix(ui): never restore a stored draft over typed new-session composer text After a reload the new-session composer renders before the gateway recovery scope arrives; selectRoute then zeroes the draft revision, so text typed in that window lost to the stored draft's higher revision and the async restore overwrote (or, interleaved with input, appended to) what the user had typed. Seen on PR #125690 CI (checks-ui-e2e 5/12, run 32122284238) as a doubled composer value. NewSessionDraftPersistence now records a pristine baseline at each programmatic content replacement (page reset, navigation handoff, restore apply) and restores only when no user mutation happened past it; otherwise the typed text wins and persists above the stored revision, including minting a revision for text typed before route activation so that draft still lands. The chat composer sibling is unaffected: its revision lineage persists synchronously to localStorage. * test(ui): run draft-persistence regression in the isolated ui lane The regression test mocks the statically imported durable-composer-persistence helper (the store runtime is only dynamically imported, so under the shared isolate:false module graph its mock alone is packing-dependent). Isolating the file makes the mocks deterministic and keeps the shared-lane file set unchanged so sibling packing does not shift.
…25690) * feat(ui): promote session controls to toolbar * test(ui): add session toolbar proof capture script * chore: register session toolbar proof script * test(ui): target ungrouped session drop zone * fix(ui): trim session toolbar startup cost * docs(ui): point new-session guide at the Sessions toolbar Also name the accepted tradeoff for the inert ungrouped-collapse preference at the partition site (ClawSweeper P1/P3 response). * test(ui): deflake new-session workspace-memory e2e Menu-geometry assertions now measure relative to the picker anchor in one atomic evaluate (immune to unrelated page settles, still catches focus-induced moves). The post-reload refill raced the composer's async draft restore, which appended the stored draft to the typed text; waiting for the restored draft asserts the documented persistence instead. Failed CI shard checks-ui-e2e 5/12 on runs 32122284238 attempts 1-2. * fix(ui): use canonical session owner filter state * chore(ui): keep session toolbar proof artifacts ignored
… text (openclaw#125884) * fix(ui): never restore a stored draft over typed new-session composer text After a reload the new-session composer renders before the gateway recovery scope arrives; selectRoute then zeroes the draft revision, so text typed in that window lost to the stored draft's higher revision and the async restore overwrote (or, interleaved with input, appended to) what the user had typed. Seen on PR openclaw#125690 CI (checks-ui-e2e 5/12, run 32122284238) as a doubled composer value. NewSessionDraftPersistence now records a pristine baseline at each programmatic content replacement (page reset, navigation handoff, restore apply) and restores only when no user mutation happened past it; otherwise the typed text wins and persists above the stored revision, including minting a revision for text typed before route activation so that draft still lands. The chat composer sibling is unaffected: its revision lineage persists synchronously to localStorage. * test(ui): run draft-persistence regression in the isolated ui lane The regression test mocks the statically imported durable-composer-persistence helper (the store runtime is only dynamically imported, so under the shared isolate:false module graph its mock alone is packing-dependent). Isolating the file makes the mocks deterministic and keeps the shared-lane file set unchanged so sibling packing does not shift.
What Problem This Solves
The sidebar's filter/sort control rendered only on the "Sessions" section header and was hover-gated to opacity 0, so operators could not find it — even though the menu behind it (grouping, sort, status, owner filter, automation/system visibility) controls the entire sidebar session list. Separately, the ungrouped catch-all section was labeled "Sessions" in a sidebar where every row is a session, which read as noise next to user-named groups and "Coding".
Why This Change Was Made
A global view control belongs on global chrome, not on the hover state of one mid-list section header. The session list now has an always-visible "Sessions" toolbar row at the top carrying the filter/sort funnel (tooltip "Filter & sort", previously the misleading "Sort sessions") and the new-session "+". The buttons are quiet by default (reduced emphasis, full on hover/focus/menu-open) and the funnel shows an accent dot whenever a non-default view is active (owner filter or non-Active status). The catch-all section is renamed "Other", and its header is suppressed entirely when it is the only headered section — those rows sit directly under the toolbar. Per-section headers keep their local hover-revealed actions (group +, kebab). The
sidebarSectionHasHeaderhelper is replaced by arenderHeaderfact computed once at partition time.User Impact
The session filter is discoverable: it is always visible at the top of the session list instead of appearing only when hovering one section header. Active filters are signaled globally. The confusing "Sessions"-group-among-sessions naming is gone; ungrouped sessions are labeled "Other" only when other sections exist. Docs updated (
docs/web/control-ui.md).Evidence
pnpm check:changedgreen; focused suites green (app-sidebar component tests, session-management.groups / chat-flow.navigation-presentation / session-ownership e2e — 32 e2e tests passed); stale-collapse regression test fails on pre-fix HEAD.scripts/capture-session-toolbar-proof.mts(mock fixtures: two custom groups, ungrouped chat sessions, worktree coding rows; menu interactions through the real UI, no DOM injection):Before: grouped sessions at rest, with the global filter/sort control absent from visible chrome.

Before: hovering the catch-all "Sessions" header reveals its hidden filter and new-session actions.

After: the always-visible "Sessions" toolbar sits above custom groups, "Other", and "Coding".

After: the toolbar funnel opens the global grouping, sorting, status, and visibility menu.

After: the accent dot marks a non-default session status filter.

After: when only ungrouped sessions exist, rows sit directly beneath the toolbar without a redundant section header.
