feat(web-ui): global command palette (Cmd/Ctrl+K) - #1386
Conversation
f9b5f12 to
38ee71c
Compare
38ee71c to
38d2ff6
Compare
Add a cross-platform command palette opened with ⌘K (Ctrl+K on Windows/Linux), with two groups: - Actions: New chat, Go to Inbox/Settings, toggle the conversations and workspace sidebars, and open the keyboard-shortcuts dialog. Filtered client-side against the query. - Sessions: fuzzy session switching from the same server-search source the sidebar uses (useConversations → GET /v1/sessions?search_query=), debounced, so the palette finds sessions beyond the first page rather than client-filtering one page. Archived excluded, matching the sidebar default. The hotkey is bound once in AppShell and bails when focus is inside an xterm terminal or the Monaco editor (both own ⌘K), and is disabled in embedded mode where ⌘K belongs to the host page. The desktop (Electron) app loads the same SPA and binds only ⌘N/⌘F natively, so ⌘K reaches the renderer unchanged. Adds an 'Open command palette · ⌘K' row to the keyboard-shortcuts dialog, a ResizeObserver test polyfill cmdk needs under jsdom, colocated Vitest coverage, and a Playwright e2e (tests/e2e_ui/sessions/test_command_palette.py). Signed-off-by: Dimitar Dimitrov <dimitardimitrov9205@gmail.com>
Give each palette Action the same icon as its equivalent button elsewhere in the UI (new chat, inbox, settings, sidebar toggles) so the palette reads as a shortcut to those surfaces. Icons inherit the item's foreground color rather than the muted tone, matching the label text. Remove the "Keyboard shortcuts" action — the palette is for imperative commands, not opening an informational dialog. Widen the palette so the two columns of longer session labels aren't cramped. Co-authored-by: Isaac
38d2ff6 to
2a92f7d
Compare
daniellok-db
left a comment
There was a problem hiding this comment.
lg, thanks for working on this!
|
🏷️ Doc impact: Adds a new user-facing command palette (⌘/Ctrl+K) with actions and session switching, plus a new documented keyboard shortcut, affecting the web UI usage/keyboard-shortcuts docs. Drafting a docs PR to Auto-classified on merge. Set the label manually before merging to override. · run |
|
Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com>
* docs: document omnigent-ai/omnigent#1722 (#261) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2018 (#265) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#1386 (#272) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2156 (#278) * docs: document omnigent-ai/omnigent#2156 * Apply suggestion from @serena-ruan * Apply suggestions from code review Co-authored-by: Serena Ruan <82044803+serena-ruan@users.noreply.github.com> --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <82044803+serena-ruan@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2022 (#268) * docs: document omnigent-ai/omnigent#2022 * docs: add steering gif and simplify message queue section Co-authored-by: Isaac --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <serena.rxy@gmail.com> * chore(api): sync openapi.json from omnigent@3c7a558 (#274) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#526 (#279) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: rename hindsight extra to memory (omnigent[memory]) (#282) The memory tools ship under the `memory` extra (omnigent[memory]), not `hindsight`. Update the install instruction and extra name to match. The Hindsight product name and the hindsight_* tool names are unchanged. * docs: document default base branch for new worktrees (#284) * docs: document default base branch for new worktrees * docs: condense worktree branches section and add setting demo gif Co-authored-by: Isaac --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <serena.rxy@gmail.com> * chore(api): sync openapi.json from omnigent@7fb779f (#281) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * chore(api): sync openapi.json from omnigent@60e775a (#288) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2152 (#280) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#1859 (#277) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2135 (#276) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <82044803+serena-ruan@users.noreply.github.com> Co-authored-by: Serena Ruan <serena.rxy@gmail.com> Co-authored-by: Pat Sukprasert <pattara.sk127@gmail.com> Co-authored-by: Dhruv Gupta <dhruv.gupta@databricks.com>
* feat(web-ui): global command palette (⌘K) Add a cross-platform command palette opened with ⌘K (Ctrl+K on Windows/Linux), with two groups: - Actions: New chat, Go to Inbox/Settings, toggle the conversations and workspace sidebars, and open the keyboard-shortcuts dialog. Filtered client-side against the query. - Sessions: fuzzy session switching from the same server-search source the sidebar uses (useConversations → GET /v1/sessions?search_query=), debounced, so the palette finds sessions beyond the first page rather than client-filtering one page. Archived excluded, matching the sidebar default. The hotkey is bound once in AppShell and bails when focus is inside an xterm terminal or the Monaco editor (both own ⌘K), and is disabled in embedded mode where ⌘K belongs to the host page. The desktop (Electron) app loads the same SPA and binds only ⌘N/⌘F natively, so ⌘K reaches the renderer unchanged. Adds an 'Open command palette · ⌘K' row to the keyboard-shortcuts dialog, a ResizeObserver test polyfill cmdk needs under jsdom, colocated Vitest coverage, and a Playwright e2e (tests/e2e_ui/sessions/test_command_palette.py). Signed-off-by: Dimitar Dimitrov <dimitardimitrov9205@gmail.com> * feat(web-ui): reuse UI icons in command palette, drop shortcuts action Give each palette Action the same icon as its equivalent button elsewhere in the UI (new chat, inbox, settings, sidebar toggles) so the palette reads as a shortcut to those surfaces. Icons inherit the item's foreground color rather than the muted tone, matching the label text. Remove the "Keyboard shortcuts" action — the palette is for imperative commands, not opening an informational dialog. Widen the palette so the two columns of longer session labels aren't cramped. Co-authored-by: Isaac --------- Signed-off-by: Dimitar Dimitrov <dimitardimitrov9205@gmail.com> Co-authored-by: Dimitar Dimitrov <dimitardimitrov9205@gmail.com> Co-authored-by: Daniel Lok <daniel.lok@databricks.com> Signed-off-by: Aditya Devarapalli <adityareddyd2@gmail.com>
* docs: document omnigent-ai/omnigent#1722 (#261) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2018 (#265) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#1386 (#272) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2156 (#278) * docs: document omnigent-ai/omnigent#2156 * Apply suggestion from @serena-ruan * Apply suggestions from code review Co-authored-by: Serena Ruan <82044803+serena-ruan@users.noreply.github.com> --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <82044803+serena-ruan@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2022 (#268) * docs: document omnigent-ai/omnigent#2022 * docs: add steering gif and simplify message queue section Co-authored-by: Isaac --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <serena.rxy@gmail.com> * chore(api): sync openapi.json from omnigent@3c7a558 (#274) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#526 (#279) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: rename hindsight extra to memory (omnigent[memory]) (#282) The memory tools ship under the `memory` extra (omnigent[memory]), not `hindsight`. Update the install instruction and extra name to match. The Hindsight product name and the hindsight_* tool names are unchanged. * docs: document default base branch for new worktrees (#284) * docs: document default base branch for new worktrees * docs: condense worktree branches section and add setting demo gif Co-authored-by: Isaac --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <serena.rxy@gmail.com> * chore(api): sync openapi.json from omnigent@7fb779f (#281) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * chore(api): sync openapi.json from omnigent@60e775a (#288) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2152 (#280) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#1859 (#277) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document omnigent-ai/omnigent#2135 (#276) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> * docs: document official kubernetes server image variant (#285) Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> --------- Co-authored-by: omnigent-ci[bot] <294685417+omnigent-ci[bot]@users.noreply.github.com> Co-authored-by: Serena Ruan <82044803+serena-ruan@users.noreply.github.com> Co-authored-by: Serena Ruan <serena.rxy@gmail.com> Co-authored-by: Pat Sukprasert <pattara.sk127@gmail.com> Co-authored-by: Dhruv Gupta <dhruv.gupta@databricks.com> Co-authored-by: Daniel Lok <daniel.lok@databricks.com>
…ed mode ## Related issue Linear: OMNI-5473 (cmd + k doesn't work in managed for desktop app) ## Summary - The ⌘K palette hotkey was gated off in embedded mode on the theory "⌘K belongs to the host page" (introduced with the palette in #1386). That host ⌘K doesn't exist, so on managed servers the chord was dead everywhere — most visibly in the desktop app, where the embed build is the whole window. - Drop the `isEmbedded` gate: the hotkey now binds in every mode. In the embedded build the host page is still loaded (CSS-hidden in the desktop shell), so the listener binds in the capture phase and claims the chord ahead of any host-page listener; the Monaco/terminal early-return still lets owned chords through. ## Test Plan - `npx vitest run src/hooks/useCommandPaletteHotkey.test.tsx` — 12 pass, incl. capture-phase claiming the chord ahead of document-level listeners, and focused-Monaco chords still propagating to them. - `npx vitest run src/shell/AppShell.test.tsx src/shell/AppShell.subagent-nav.test.tsx src/shell/CommandPalette.test.tsx` — 129 pass. - `npm run type-check`, `oxlint`, `prettier --check` — clean. - Manual: desktop app on a managed server URL, press ⌘K → palette opens; same URL in a browser tab, ⌘K now opens the Omnigent palette there too. ## Demo N/A — hotkey behavior fix, no visual change. ## Type of change - [x] Bug fix - [ ] Feature - [ ] UI / frontend change - [ ] Refactor / chore - [ ] Docs - [ ] Test / CI - [ ] Breaking change ## Test coverage - [x] Unit tests added / updated - [ ] Integration tests added / updated - [ ] E2E tests added / updated - [ ] Manual verification completed - [x] Existing tests cover this change - [ ] Not applicable ## Changelog ⌘K now opens the command palette everywhere, including the desktop app on managed servers Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
…ed mode (#5569) ## Related issue Linear: OMNI-5473 (cmd + k doesn't work in managed for desktop app) ## Summary - The ⌘K palette hotkey was gated off in embedded mode on the theory "⌘K belongs to the host page" (introduced with the palette in #1386). That host ⌘K doesn't exist, so on managed servers the chord was dead everywhere — most visibly in the desktop app, where the embed build is the whole window. - Drop the `isEmbedded` gate: the hotkey now binds in every mode. In the embedded build the host page is still loaded (CSS-hidden in the desktop shell), so the listener binds in the capture phase and claims the chord ahead of any host-page listener; the Monaco/terminal early-return still lets owned chords through. ## Test Plan - `npx vitest run src/hooks/useCommandPaletteHotkey.test.tsx` — 12 pass, incl. capture-phase claiming the chord ahead of document-level listeners, and focused-Monaco chords still propagating to them. - `npx vitest run src/shell/AppShell.test.tsx src/shell/AppShell.subagent-nav.test.tsx src/shell/CommandPalette.test.tsx` — 129 pass. - `npm run type-check`, `oxlint`, `prettier --check` — clean. - Manual: desktop app on a managed server URL, press ⌘K → palette opens; same URL in a browser tab, ⌘K now opens the Omnigent palette there too. ## Demo N/A — hotkey behavior fix, no visual change. ## Type of change - [x] Bug fix - [ ] Feature - [ ] UI / frontend change - [ ] Refactor / chore - [ ] Docs - [ ] Test / CI - [ ] Breaking change ## Test coverage - [x] Unit tests added / updated - [ ] Integration tests added / updated - [ ] E2E tests added / updated - [ ] Manual verification completed - [x] Existing tests cover this change - [ ] Not applicable ## Changelog ⌘K now opens the command palette everywhere, including the desktop app on managed servers Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
Related issue
Closes #1385
Summary
Add a global command palette opened with Cmd+K (Ctrl+K on Windows/Linux), available across the web UI and the desktop (Electron) app. It has two groups:
useConversations->GET /v1/sessions?search_query=, debounced), so it finds sessions beyond the first page rather than client-filtering a single page. Archived sessions excluded, matching the sidebar default.The hotkey is bound once in
AppShell. It does not fire when focus is inside an xterm terminal or the Monaco editor (both own Cmd/Ctrl+K), and is disabled in embedded mode where Cmd/Ctrl+K belongs to the host page. The desktop app loads the same SPA and binds only Cmd/Ctrl+N and Cmd/Ctrl+F natively, so Cmd/Ctrl+K reaches the renderer unchanged. Adds an "Open command palette" row to the keyboard-shortcuts dialog.Complements PR #1064 (Cmd/Ctrl+Shift+F sidebar search): that PR reserved Cmd/Ctrl+K for exactly this palette. The two are additive and the palette coexists with the existing sidebar search.
Type of change
Test coverage
Coverage rationale
Vitest unit tests:
useCommandPaletteHotkey.test.tsx: the chord predicate (Cmd/Ctrl+K, rejecting Alt/Shift/AltGraph/other keys), auto-repeat ignore, disabled mode, bail when focus is in an xterm/Monaco surface, and listener cleanup on unmount.CommandPalette.test.tsx: action commands render, run, and close the palette (navigation, sidebar-toggle callbacks, keyboard-shortcuts); client-side action filtering; session list mapping with the "New session" fallback; debounced server search (archived excluded); page dedupe; and the empty state.KeyboardShortcutsDialog.test.tsx: the new "Open command palette" row.Playwright e2e (
tests/e2e_ui/sessions/test_command_palette.py): Cmd/Ctrl+K opens the palette from a focused composer, selecting a session navigates to it, and the palette closes. It selects from the default session list rather than typing-to-filter, because the server search reindex is asynchronous and would make a type-then-filter assertion timing-dependent (search filtering is covered by the unit tests).Also adds a no-op
ResizeObserverpolyfill totest-setup.ts(cmdk constructs one on mount; jsdom does not implement it), guarded so it never clobbers a real implementation or the per-test stubs other suites set.Validated locally (from
ap-web/):npm run type-checknpm test(3158 passed, 3 expected fail, 2 skipped)npm run buildnpx oxlinton the touched files (clean; fullnpm run lintreports pre-existing errors outside this change)E2E (repo root, venv active):
python -m pytest tests/e2e_ui/sessions/test_command_palette.py --ui-skip-build(passes). Manually verified in a real browser and in the desktop app.