Repository navigation
fix(ui): preserve session, tool, archive, and focus ownership - #117191
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:32 AM ET / 05:32 UTC. ClawSweeper reviewWhat this changesThe branch centralizes Control UI ownership for tool-stream identity, archived-session deletion, selected-agent scope, accessible session actions, dropdown focus, route focus handoff, and isolated UI mock registries. Merge readinessKeep this PR open for protected maintainer review. Current Priority: P2 Review scores
Verification
How this fits togetherThe Control UI consumes Gateway session listings and streamed tool events, then renders chat, session actions, and keyboard-driven menus. This branch changes the owners that reconcile those inputs into visible tool evidence, destructive archive operations, and focus behavior. flowchart LR
Gateway[Gateway session and tool events] --> Owners[Control UI state owners]
Owners --> ToolIdentity[Tool invocation identity]
Owners --> SessionRoster[Paginated session roster]
Owners --> MenuFocus[Menu and route focus]
ToolIdentity --> ChatEvidence[Accurate tool evidence]
SessionRoster --> ArchiveDelete[Fail-closed archive deletion]
MenuFocus --> AccessibleUI[Accessible keyboard interaction]
Decision needed
Why: This is an intentional user-visible destructive-operation policy, not a mechanically provable implementation detail; the Before merge
Agent review detailsSecurityNone. PR surfaceSource +224, Tests +573. Total +797 across 24 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical paginated-session owner and land the focused UI repairs only after a maintainer confirms the selected/all-agent, complete-roster, fail-closed archive contract and the dropdown focus behavior on the current-main merge result. Do we have a high-confidence way to reproduce the issue? Yes: the proposed head contains focused regression tests for the archive, tool-identity, and focus paths, and the supplied PR context reports after-fix mocked-Gateway Chromium proof. This read-only review did not execute those tests. Is this the best way to solve the issue? Unclear: shared pagination and owner-boundary repair are the narrowest source-level shape found, but the Web Awesome lifecycle contract was unavailable for direct dependency inspection and the destructive-operation policy remains a protected maintainer choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0892684551fd. 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 (3 earlier review cycles) |
|
Merged via squash.
|
…aw#117191) * fix(ui): unify tool, session, and keyboard interaction owners * refactor(ui): separate archived session regression coverage * test(ui): isolate memory plugin mutation mock registries --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The Control UI had independently reproducible bugs in streamed tool evidence, destructive archive pagination, selected-agent scope, session action accessibility, menu dismissal, keyboard context menus, popup lifecycle, and cross-route focus handoff. Exact-current-main owner regressions failed 28 times across ten focused files, including silent incomplete destructive deletion and independently verified real-Chromium focus loss.
Why This Change Was Made
The persistent dropdown removes an obsolete duplicate owner. The follow-up cleanly extracts the entire destructive-archive regression group and its shared page fixture into focused owners, reducing the formerly oversized lifecycle test from 1,158 to 704 lines without removing one assertion. Overall production change remains +17 lines across nine owners; every additional production line enforces concrete authoritative pagination, destructive-operation safety, focus ownership, or accessible labeling rather than introducing configuration, compatibility stacks, or new dependencies.
Canonical Vitest Mock-Registry Root Cause
The memory settings and memory mutation suites both own module-global mocks for the same plugin API. Their previous placement in Vitest's shared
isolate: falsegraph made results depend on worker packing: the existing hosted three-worker check exposed genuine cross-suite mock contamination.test/vitest/vitest.ui-isolated-paths.mjs. Both the root and package runners already exclude these entries from their shared graph and include them in their existingisolate: trueprojects.pnpm --dir ui test --maxWorkers 3passed 530 files / 7,749 tests, including both isolated memory suites and real Chromium browser coverage.Protected Maintainer Acceptance: Destructive Archived Deletion
This protected-maintainer change intentionally defines Delete all archived as a complete, selected-scope, fail-closed destructive operation:
agentSelection.state.scopeIdat the action owner. A selected agent limits enumeration to exactly that agent; the explicit all-agents scope omitsagentIdand includes every agent. A route deep-link or linked thread must never silently narrow either scope.archivedOnly: true. Both selected-agent and all-agent contracts, moving rows, missing pages, omitted later totals, and incomplete rosters have focused regression coverage and actual mocked-Gateway Chromium proof.Maintainer decision: ACCEPTED — require complete selected/all-agent archived-roster enumeration and fail closed before confirmation or deletion when enumeration is incomplete. Preserve selected/all-agent scope and approve the persistent Web Awesome dropdown ownership model as one reviewed landing unit; this records the protected-maintainer acceptance requested by the latest ClawSweeper review.
Inspected Upstream Dropdown/Dialog Contract
The installed dependency is pinned to
@awesome.me/webawesome3.10.0 (ui/package.json:12; installednode_modules/@awesome.me/webawesome/package.json:7). Maintainer review personally inspected the actual installed implementation, not only OpenClaw wrappers:node_modules/@awesome.me/webawesome/dist-cdn/chunks/chunk.YEKDZDVC.js:81: the dropdown installs a document-level keydown owner; Escape restores its trigger.node_modules/@awesome.me/webawesome/dist-cdn/chunks/chunk.YEKDZDVC.js:166: Tab unconditionally invokes asynchronoushideMenu(), explaining why an inaccessible transient trigger otherwise loses keyboard ownership.node_modules/@awesome.me/webawesome/dist-cdn/chunks/chunk.YEKDZDVC.js:360:showMenu()registers document handlers, animates, and focuses the first dropdown item; recreating the popup therefore replays its lifecycle and can steal icon-picker focus.node_modules/@awesome.me/webawesome/dist-cdn/chunks/chunk.YEKDZDVC.js:391:hideMenu()removes document handlers and completes asynchronously;:545restores the trigger after normal item selection.node_modules/@awesome.me/webawesome/dist-cdn/chunks/chunk.ED2QTHPZ.js:71: nested dialogs own Escape;:91closes asynchronously and restores their original trigger. The Control UI therefore redirects Tab only for an actual dropdown item contained by the current owner, leaving nested dialogs and unrelated outside targets untouched.These inspected contracts directly support the persistent keyed dropdown, contained-item-only capture, icon-picker initial focus, Back focus restoration, and nested-dialog keyboard regression coverage.
User Impact
Operators see accurate live tool output, error, and canvas evidence; destructive archive actions either enumerate the complete selected scope or visibly refuse; duplicate/moving sessions are deleted once; screen-reader actions identify their owning thread; nested icon dialogs retain keyboard focus; Back restores the correct action; normal and keyboard context menus hand off focus to the next visible thread; cross-route keyboard navigation does not steal intentional focus.
Evidence
ca5851447ea2e2a30082853f7f4ba665bfea445c; original frozen parent:865a7286c8a5073c25822e1859c6431ef42471b5; reviewed first commitc1ae8280a2518e7e876ab60aa1659996b3d7e0b6.4fb19fb8c586b2d7801d1c512a4ac21e4d826505; the complete UI tree and canonical Vitest registry remain byte-identical to the original reviewed parent; the synthetic merge preserves the exact reviewed candidate UI/registry and the exact latest-main Gateway, agents, session-config, and protocol trees; clean synthetic merge treee230a10f67e6a7ab39614cb988957302f88dddb9.sessions.listremains available above 2,000 rows. Chat-send/session-steer changes move admission/idempotency ownership before abort/dispatch without changing the UI's session keys, run IDs, tool-event identity, pagination fields, protocol, or destructive archive contract. The newer sandbox-browser change filters user-supplied Docker mounts conflicting with protected read-only skill overlays and leaves the Control UI browser panel, browser API, session owner, and Gateway contract unchanged. Synthetic merged trees preserve the reviewed UI byte-for-byte and preserve latest-main Gateway, sandbox-browser, session-config, agents, and protocol byte-for-byte.Shift+F10context-menu handoff, reconnect, selection, and touch.pnpm --dir ui test --maxWorkers 3: 530 files / 7,749 tests passed / zero skipped, including both correctly isolated memory plugin suites.pnpm lint: core 15,214 files, plugins 8,110 files, scripts 877 files, zero warnings/errors; generated-locale verification passes (4,652 source keys; 98 baseline entries).pnpm tsgo:uiandpnpm tsgo:test:ui, both green. The host already explicitly declaresplanStatusatui/src/pages/chat/tool-stream.ts:69; both typechecks independently disprove an earlier automated-review false positive.tbx_01kyxszr9a12dpcqp6jdym18epindependently verified stopped/completed after lint, both typechecks, the full UI suite, and real Chromium proof.