Repository navigation
fix(ui): keep sidebar selection on archived sessions and replace the composer with an archived notice - #113882
Conversation
…oser with archived notice
|
Codex review: needs maintainer review before merge. Reviewed July 25, 2026, 9:57 PM ET / July 26, 2026, 01:57 UTC. ClawSweeper reviewWhat this changesThe PR keeps an archived routed session selected in the Control UI sidebar and replaces its disabled composer with an archived-session notice that can restore the session. Merge readinessKeep this PR open for explicit maintainer handling: it addresses a bounded Control UI regression, includes focused coverage and stated live-gateway proof, and the review found no discrete correctness defect in the submitted change. The protected Priority: P2 Review scores
Verification
How this fits togetherThe Control UI derives the visible sidebar rows and chat-pane state from session-list updates, route selection, and fetched lineage data. Archiving changes a session's list membership; this change preserves the route-selected row through that transition and makes the chat input reflect the archived state. flowchart LR
A[Archive or unarchive action] --> B[Session patch and refresh]
B --> C[Session list and lineage reconciliation]
C --> D[Sidebar selection projection]
C --> E[Chat pane state]
D --> F[Archived row stays selected]
E --> G[Archived notice or restored composer]
Decision needed
Why: The patch has no supported line-level defect in this review, but the Before merge
Agent review detailsSecurityNone. PR surfaceSource +138, Tests +287. Total +425 across 19 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve route-owned selection across archive refreshes, publish the routed lineage row only for the active selection, and land the refreshed branch after explicit maintainer approval. Do we have a high-confidence way to reproduce the issue? Yes, at source level: archiving the currently routed session causes an active-filtered list refresh, and the changed navigation, sidebar, and chat paths directly cover that transition. The provided real-gateway account is detailed, but this read-only review could not independently execute it. Is this the best way to solve the issue? Yes. Keeping selection route-owned while injecting the selected lineage row into the existing reconciliation path is narrower and less error-prone than redirecting to an agent main session or adding a separate archived-session navigation mode. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2bffce62daac. 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
HistoryReview history (1 earlier review cycle)
|
…replace the composer
|
Merged via squash.
|
…composer with an archived notice (openclaw#113882) * fix(ui): keep sidebar selection on archived sessions and replace composer with archived notice * fix(ui): narrow lineage-row lookup and restructure fallback projection scan * fix(ui): publish routed lineage row so cold-loaded archived sessions replace the composer * chore(ui): drop unused mergeChildSessionRows export
What Problem This Solves
Archiving the currently open session force-jumped the sidebar selection to the agent main session (both from the sidebar thread menu / multi-select batch and from the Sessions page). Combined with the list reloads that archiving triggers, this read as the UI "randomly losing the sidebar selection". The archived session also kept rendering a live-looking (but disabled) composer under the archived banner.
Why This Change Was Made
Selection is route/state owned and should never move because an entry changed archive state. The sidebar projection already synthesizes a visible row for a selected session that falls out of the active-filtered list, so the right fix is to delete the navigation-on-archive code paths and make the archived state explicit at the composer seam instead.
patchSessionand the Sessions page no longer navigate to the agent main session on archive; the undo paths no longer re-select (nothing moved).ChatComposerDisabledBannerplacement variant instead of stacking above a disabled input; Stop stays available while a run is still draining. Other disabled states (read-only share, catalog view-only, offline, question takeover) are unchanged.User Impact
Archiving a session — including the one you are looking at — never moves your selection. The archived entry remains in the sidebar with the archive glyph, stays selectable, and the chat shows "This session is archived. Unarchive it to continue the conversation." in place of the composer. Unarchiving restores the composer in place.
Evidence
sessions.changedrefresh after each patch, then archive the selected session — asserts the selected route and active sidebar row never change, the composer is replaced by the archived notice, and unarchive restores it (ui/src/e2e/session-management.e2e.test.ts).ui/src/lib/sessions/navigation.test.ts); sidebar archive + undo never callsetSessionKey/navigate (ui/src/test-helpers/app-sidebar-cases/sessions.ts,ui/src/pages/sessions/sessions-page.test.ts); composer replacement + unarchive action (ui/src/pages/chat/chat-composer.test.ts); archived cross-agent children and filtered archived parents (ui/src/test-helpers/app-sidebar-cases/child-sessions.ts).node scripts/run-vitest.mjs ui/src/lib/sessions/navigation.test.ts ui/src/components/app-sidebar.test.ts ui/src/pages/chat/chat-composer.test.ts ui/src/pages/sessions/sessions-page.test.ts ui/src/e2e/session-management.e2e.test.ts— 2 shards, all passed (navigation 14, sidebar 170, composer 30, sessions page 22, e2e 20).gpt-5.6-sol, xhigh): clean, no accepted findings.Real-Setup Proof (live scratch gateway)
Verified against a real gateway run from this branch head (
ee85007295c): isolatedOPENCLAW_STATE_DIR, token auth on loopback port 19790, gateway-served production UI build, 15 real sessions created viasessions.create/sessions.patchRPC.Live flow exercised in the browser: selected "Load test 11", archived several other sessions one by one (each triggering
sessions.changedlist reloads) — selection never moved; then archived the selected session via its thread menu — the row stayed selected in the sidebar with the archive glyph and the composer was replaced by the archived notice; Unarchive restored the composer in place.This live testing surfaced a cold-load gap (fixed in
ee85007295c): a fresh page load deep-linked to an archived session rendered a live composer because the session is absent from the active-filtered list and neither historysessionInfonor list rows carriedarchived. The sidebar's existingsessions.describelineage row is now published through the sessions store's reconcile seam, so the chat pane and header share the sidebar's cold-load truth; navigating away evicts the injected row via the normal active filter.Additional evidence for the new commit: cold-load unit coverage in
ui/src/pages/chat/chat-pane-state.test.ts, new cold-load E2E scenario inui/src/e2e/session-management.e2e.test.ts(21/21 on the archive scenarios), fresh clean autoreview. Thepages sidebar sessions and supports complete drag-managed groupsE2E test is flaky on the local runner independent of this branch — the origin/main version of the file fails the same test (plus one more) on the same machine; the e2e lane is not part of PR CI.