fix(control-ui): add guarded dashboard shortcuts#84827
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 1:17 AM ET / 05:17 UTC. Summary PR surface: Source +380, Tests +170, Docs +1. Total +551 across 44 files. Reproducibility: not applicable. This PR implements an enhancement requested by the linked Control UI shortcut issue rather than reproducing a broken existing contract. The relevant behavior is source-reviewable through the new resolver and focused tests. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the guarded shortcut implementation only after maintainers explicitly accept the keyboard compatibility contract and are satisfied that any remaining red broad-check signal is current-main noise rather than PR-local behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR implements an enhancement requested by the linked Control UI shortcut issue rather than reproducing a broken existing contract. The relevant behavior is source-reviewable through the new resolver and focused tests. Is this the best way to solve the issue? Yes, with maintainer signoff: centralizing the shortcut decision in one resolver and testing editable-target guards is a maintainable shape for this feature. The remaining question is product compatibility for the chosen global keys, not a concrete patch defect. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 8f6a2f0f6b11. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +380, Tests +170, Docs +1. Total +551 across 44 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
Pull request overview
Adds a centralized, guarded document-level keyboard shortcut dispatcher for the Control UI dashboard, enabling common chat actions without interfering with text entry fields or embedded editors.
Changes:
- Introduces
resolveDashboardShortcutAction()to map key events (/,N,Esc, Cmd/Ctrl+K) to app actions with editable-target guarding. - Wires the dispatcher into
OpenClawAppand implements focused handlers for toggling palette, focusing composer, scrolling to new messages, and dismissing transient UI. - Improves “New messages” discoverability with an on-button
<kbd>N</kbd>indicator and adds regression coverage for shortcut dispatch/guarding.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/ui/views/chat.ts | Adds Escape handling for the search bar input; updates “New messages” button UI/labels to show the N shortcut. |
| ui/src/ui/views/chat.test.ts | Adds a test asserting the new “New messages” shortcut discoverability and preserves click behavior. |
| ui/src/ui/navigation.browser.test.ts | Adds browser-level regression tests for global shortcut routing, editable no-op guarding, and Escape dismissal behavior. |
| ui/src/ui/app.ts | Replaces inline Cmd/Ctrl+K handler with centralized shortcut resolution and adds helper methods for the new actions. |
| ui/src/ui/app-keyboard-shortcuts.ts | New module implementing guarded shortcut-to-action resolution and editable-target detection. |
| ui/src/styles/chat/layout.css | Styles the new <kbd> indicator within the “New messages” button. |
| CHANGELOG.md | Documents the new guarded dashboard shortcuts feature. |
|
ClawSweeper PR egg: ✨ hatched 🥚 common Sunspot Crabkin. Rarity: 🥚 common. Trait: finds missing screenshots. DetailsShare on X: post this hatch
About:
|
d8b9c2b to
a3464db
Compare
350aa01 to
c8f37f6
Compare
|
@clawsweeper re-review Refreshed PR head to c8f37f6 and resolved the dirty merge state. Focused UI proof, i18n check, format, UI typecheck, and merge-tree are clean. Testbox changed gate tbx_01kspemnma51480h6q2bcwjwa3 is blocked by the current-main src/agents/tools/pdf-native-providers.test.ts core-test typecheck failure; the same command reproduces on pristine origin/main. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c8f37f6 to
3bec2bc
Compare
|
@clawsweeper re-review Final refreshed head is 3bec2bc, rebased on current origin/main 4f26cc9. The dirty merge state is resolved, generated i18n was refreshed through the repo sync command, and the old changelog / installer-doc churn is gone. Focused Control UI tests, UI typecheck, i18n check, format/lint, diff check, and merge-tree are clean. Current red check is check-test-types in unrelated agent test files: src/agents/minimax-vlm.normalizes-api-key.test.ts and src/agents/tools/pdf-native-providers.test.ts. I reproduced the same failure on pristine origin/main with test/tsconfig/tsconfig.core.test.json, so this is not introduced by the Control UI shortcut diff. Testbox tbx_01kspf60p4nt0mn1ty963txesm detached/stalled before completion and was cancelled; details are in the PR body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Refreshes the guarded Control UI dashboard shortcuts for #81946 on current
origin/main./,N,Esc, and existing Cmd/Ctrl+K palette behavior.role="textbox", CodeMirror roots, and Monaco roots.chat.newMessages.*strings and regenerates locale bundles /.i18nmetadata withpnpm ui:i18n:sync.CHANGELOG.mdchurn and unrelateddocs/install/installer.mdtable churn.Duplicate/source PR #81958 is closed stale-unmerged, so this PR remains the active fix path.
Verification
Behavior addressed: guarded dashboard keyboard shortcuts for Control UI chat/navigation without stealing typing from editable fields.
Real environment tested: local OpenClaw worktree on branch
meow/refresh-84827-dashboard-shortcuts, rebased onorigin/main4f26cc9090, pushed as3bec2bcca39c35ac417f498a23cbc70ba1aeb6a6.Exact steps or command run after this patch:
node scripts/run-vitest.mjs ui/src/ui/navigation.browser.test.ts --reporter=verbosenode scripts/run-vitest.mjs ui/src/ui/views/chat.test.ts --reporter=verbosepnpm exec oxfmt --check --threads=1 docs/web/control-ui.md ui/src/i18n/locales/en.ts ui/src/styles/chat/layout.css ui/src/ui/app-keyboard-shortcuts.ts ui/src/ui/app.ts ui/src/ui/navigation.browser.test.ts ui/src/ui/views/chat.test.ts ui/src/ui/views/chat.tsnode scripts/run-oxlint.mjs ui/src/ui/app-keyboard-shortcuts.tspnpm ui:i18n:checkpnpm tsgo:test:uigit diff --check origin/main...HEADgit merge-tree --write-tree origin/main HEADtbx_01kspf60p4nt0mn1ty963txesm/ run26555650911, commandpnpm check:changedorigin/main,node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test-origin-main-recheck.tsbuildinfoEvidence after fix:
navigation.browser.test.ts: 18 passed.chat.test.ts: 59 passed.oxfmt, focusedoxlint,ui:i18n:check,tsgo:test:ui,git diff --check, andmerge-treepassed locally.ui:i18n:checkreported all 18 locales clean, with the expected 3 fallback keys from the regenerated shortcut strings.3bec2bcca39c:check-lint,checks-node-core-ui,check-docs,preflight,security-fast, and workflow sanity checks passed.Observed result after fix:
/focuses/switches to chat,Njumps to new messages only when available, Escape dismisses transient dashboard UI in the expected priority order, Cmd/Ctrl+K still opens the command palette, and printable dashboard shortcuts do nothing from editable/editor targets.What was not tested: browser smoke was not run. The broad changed gate did not complete: the Testbox wrapper detached with exit 143 and the backing Action was cancelled after it stayed in
Run Testbox; the samecheck-test-typesfailure currently reproduces on pristineorigin/mainin unrelatedsrc/agents/minimax-vlm.normalizes-api-key.test.tsandsrc/agents/tools/pdf-native-providers.test.tsfiles.