fix(ui): add guarded dashboard shortcuts#81958
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. as a new Control UI shortcut feature rather than a broken existing contract. Source inspection of current main and the linked maintainer-scoped request show the pre-PR baseline and desired behavior. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this PR after normal maintainer review and required checks, keeping the shortcut dispatcher scoped to the Control UI app shell with focused browser coverage for editable guards. Do we have a high-confidence way to reproduce the issue? Not applicable as a new Control UI shortcut feature rather than a broken existing contract. Source inspection of current main and the linked maintainer-scoped request show the pre-PR baseline and desired behavior. Is this the best way to solve the issue? Yes. The PR uses the existing Control UI app shell and scroll/focus/tab paths, and the latest editable guard covers the previously missed What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against be166b9ae48d. |
Fixes #81946
Summary
/moves focus to the chat composer, switching to Chat first when neededNtriggers the same new-message jump path only when the affordance is activeEscdismisses palette/mobile controls/session notice/focus mode without stealing editable-field keyscontenteditable="plaintext-only"targets as editable so the dispatcher does not intercept editor inputReal behavior proof
Behavior or issue addressed: Control UI dashboard shortcuts now handle
/,N, andEscthrough a guarded document-level dispatcher while ignoring editable text targets, includingcontenteditable="plaintext-only".Real environment tested: Local OpenClaw Control UI Vite dev server from this checkout, loaded in Chromium at
http://127.0.0.1:5174/overview.Exact steps or command run after this patch:
pnpm --dir ui dev --host 127.0.0.1 --port 5174.http://127.0.0.1:5174/overviewin Chromium headless shell via Playwright.<openclaw-app>to connected, dispatched/,N, andEscapefrom document scope, the chat composer textarea, and a focusedcontenteditable="plaintext-only"element.Evidence after fix: Browser console output from the live Control UI page:
{ "slash": { "beforeTab": "overview", "defaultPrevented": true, "afterTab": "chat", "hasComposer": true, "focusedComposer": true }, "newMessagesShortcut": { "jumpDefaultPrevented": true, "editableJumpDefaultPrevented": false, "scrollCalls": 1 }, "escape": { "escapeDefaultPrevented": true, "paletteAfterEscape": false, "editableEscapeDefaultPrevented": false, "mobileAfterEditableEscape": true }, "plaintextOnly": { "slash": false, "n": false, "escape": false, "paletteOpen": true, "mobileOpen": true, "scrollCalls": 1 } }Observed result after fix:
/routed the real Control UI shell from Overview to Chat and focused the composer;NinvokedscrollToBottom()exactly once when not editing;Escclosed the palette at document scope;/,N, andEscinside the composer and acontenteditable="plaintext-only"target were ignored by the global dispatcher.What was not tested: No additional gaps.
Audit
Tests
node scripts/run-vitest.mjs ui/src/ui/navigation.browser.test.tspnpm exec oxfmt --check ui/src/ui/app.ts ui/src/ui/navigation.browser.test.tspnpm tsgo:test:uipnpm test:changed --changed origin/maingit diff --check