[PR #6649] [CLOSED] feat(client): Ctrl+K command palette and "?" keyboard shortcuts overlay #7272

Closed
opened 2026-10-23 04:18:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6649
Author: @SirAdoni
Created: 9/25/2026
Status: ❌ Closed

Base: staging ← Head: contrib/command-palette


📝 Commits (10+)

  • 8243af0 feat(client): add a Ctrl+K command palette
  • 4213bd0 feat(client): add a "?" keyboard shortcuts overlay
  • 4bae1ab fix(client): give focus back to the palette's opener when it closes
  • 3367bdc test(e2e): expect the command palette button in the mobile top bar order
  • d050199 style(client): render palette and shortcut keys in the app font
  • 6eff16f fix(client): close overlaying panels when the palette opens a chat or Home
  • f8d3bc1 fix(client): open the palette with the platform's own modifier only
  • e34c505 fix(client): navigate from the palette only after the editor leaves
  • 4ac699e test(client): make the palette ranking check need the recency boost
  • 664a0ac fix(client): let the palette close a saved editor and navigate

📊 Changes

17 files changed (+1696 additions, -5 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 e2e/core-flows.e2e.ts (+2 -0)
📝 packages/client/src/components/chat/HomeNewChatLauncher.tsx (+17 -5)
➕ packages/client/src/components/command-palette/CommandPalette.tsx (+382 -0)
➕ packages/client/src/components/command-palette/CommandPaletteHost.tsx (+219 -0)
➕ packages/client/src/components/command-palette/KeyboardShortcutsOverlay.tsx (+61 -0)
➕ packages/client/src/components/command-palette/palette-navigation.ts (+52 -0)
📝 packages/client/src/components/layout/AppShell.tsx (+2 -0)
📝 packages/client/src/components/layout/TopBar.tsx (+25 -0)
➕ packages/client/src/lib/command-palette.ts (+301 -0)
📝 packages/client/src/lib/editor-leave.ts (+12 -0)
➕ packages/client/src/lib/keyboard-shortcuts.ts (+89 -0)
📝 packages/client/src/lib/modal-overlay-registry.ts (+5 -0)
➕ packages/client/src/lib/settings-targets.ts (+9 -0)
📝 packages/client/src/localization/locales/en.json (+65 -0)
➕ packages/client/src/stores/command-palette.store.ts (+21 -0)
➕ scripts/regressions/command-palette.regression.ts (+430 -0)

📄 Description

Rebased 2026-09-25 onto upstream staging e15c9e558. Hashes below are the rebased ones. The rebase had no conflicts. Re-checked after it: install, shared build, tsc (shared, server, client), locale check and this branch's own regressions, all passing. The full suites and CodeRabbit reviews listed below ran on the previous base, one or two staging updates earlier.

Base: staging (e15c9e558) · Head: contrib/command-palette (f8d3bc10e)


Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6624
Part 3 of the engine foundations series, see #6624.

This PR is independent of the other parts. It targets staging directly and can be merged, reviewed or declined on its own.

Why this change

  • There's no quick way to jump around the app. Reaching a chat, character, lorebook or Settings tab takes several clicks through panels.
  • The app has keyboard shortcuts, but nothing lists them.

What changed

7 commits on staging e15c9e558, oldest first, 16 files:

  • 8243af09a feat(client): add a Ctrl+K command palette.
  • 4213bd0d6 feat(client): add a "?" keyboard shortcuts overlay.
  • 4bae1ab70 fix(client): give focus back to the palette's opener when it closes.
  • 3367bdc54 test(e2e): expect the command palette button in the mobile top bar order.
  • d050199e3 style(client): render palette and shortcut keys in the app font.
  • 6eff16f4c fix(client): close overlaying panels when the palette opens a chat or Home.
  • f8d3bc10e fix(client): open the palette with the platform's own modifier only.

Command palette

  • Opens with Ctrl+K, or Cmd+K on a Mac. Only the platform's own modifier opens it: Cmd+K on Mac, Ctrl+K everywhere else.
  • On touch screens, a search button in the top bar opens it.
  • It lists only things that exist upstream: chats, characters, personas, lorebooks, presets, the Settings tabs, and generic actions such as a new chat, opening a panel, or switching theme.
  • When it closes, focus returns to whatever opened it.
  • There is no feature switch. The palette is always available.

"?" overlay

  • Pressing ? while not typing, or picking Keyboard shortcuts in the palette, shows the shortcuts that really exist. Nothing is listed that the app doesn't do.

e2e fix

  • e2e/core-flows.e2e.ts: "mobile topbar remains reachable" now expects the new command palette button in the top bar order. This was the cause of the mobile-chromium and mobile-webkit failures on the earlier umbrella PR #6625.

Review fixes (local CodeRabbit)

  • Two legitimate findings, both fixed, none open:
    • Opening a chat or Home from the palette now closes overlaying panels, using the same panel breakpoint check as the TopBar Home button.
    • The palette opens with the platform modifier only.

Matching existing UI

The palette reuses what the app already has:

  • Dialogs use ui/Modal.
  • The top-bar button uses the same classes as the TopBar Home and Settings buttons (TopBar.tsx).
  • Result rows copy the quick-action rows in ConversationInput.tsx.
  • Section headers follow CharacterEditor.tsx:1683, and the search icon follows CharactersPanel.tsx:858.
  • Keys are plain bordered chips in the app font. Upstream has no monospace kbd style, so none was added.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

The boxes are left unticked for a human, per AGENTS.md. Everything below ran on the tip f8d3bc10e.

Check Result
tsc --noEmit clean, 5 runs
Lint 0 errors (1 warning in GameNarration.tsx, already on staging)
Prettier, locales, builds pass
Full regression suite, Windows 11 367 / 372. The 5 failures are the known Windows-only ones.
CI-equivalent, Linux (WSL Ubuntu 24.04) complete-node-regressions 372 / 372
e2e mobile-chromium, full run 426 / 427. The 1 failure passes when run alone. On plain staging, this project had load timeouts that all passed on rerun.
e2e mobile-webkit, shards 1 and 6 Fail only the same tests that fail on plain staging: advanced-memory Chat Settings, assigned-chat-sweep library cards, assigned-issue-sweep Android browser handoff, and core-flows software keyboard.

Manual verification notes

  • Checked the palette and the "?" overlay in the default and SillyTavern themes, light and dark, at desktop and phone sizes.
  • Checked for styles the app doesn't use: no cream backgrounds, italic accents, numbered or monospace labels, or pill buttons.
  • The regression scripts/regressions/command-palette.regression.ts covers the palette's actions and the overlay's shortcut list.

Human to tick

Based on the evidence above:

  • pnpm check passes locally: supported. Its steps (tsc, lint, Prettier, locales, builds, regressions) all passed, apart from the 5 known Windows-only failures, and Linux is 372 / 372. If you want the literal command, run pnpm check once before ticking.
  • Ran the app, clicked through the changes manually: supported for desktop and phone sizes in both themes, light and dark. Tick after trying it once yourself.
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed: supported (two CHANGELOG.md entries).

Not supported by the evidence, leave unticked unless done by hand:

  • Container built and ran: not run for this PR.
  • Checked edge cases: light and dark and the phone viewport were checked, but empty states and error paths were not recorded. Tick only after checking those too.
  • Above manual verification completed, and Read and followed CONTRIBUTING.md: only a human can confirm these.
  • No docs changes needed, Translated docs, and Version/release files updated: do not apply.

Needs manual verification

  • Cmd+K on a real Mac.
  • Touch on a real iPhone and a real Android phone (top-bar button, palette, overlay).
  • A screen reader pass over the palette and the overlay.
  • The mobile-webkit shards other than 1 and 6.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

The PR adds two CHANGELOG entries under [Unreleased] and new English strings in en.json. No README or CONTRIBUTING changes, and no version bump.

UI evidence (if applicable)

Screenshots from a test instance with invented data, taken on this branch.

Ctrl+K palette with results

Ctrl+K palette with results
"?" keyboard shortcuts overlay

"?" keyboard shortcuts overlay
Palette on a phone (390x844)

Palette on a phone (390x844)

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Open a command palette with Ctrl+K (Cmd+K on Mac) or the top-bar search button to find destinations and actions. Recently opened items appear first.
    • View keyboard shortcuts grouped by context with ? when you’re not typing, or from the command palette. Shortcuts that depend on settings are identified.
    • Navigate to chats, settings, and other actions from the palette. Unsaved changes are protected by a confirmation before leaving an editor.
  • Bug Fixes
    • The palette won’t open over another dialog, and Ctrl+K continues to work in text fields that use it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6649 **Author:** [@SirAdoni](https://github.com/SirAdoni) **Created:** 9/25/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `contrib/command-palette` --- ### 📝 Commits (10+) - [`8243af0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8243af09a7bea61e8f9b874410bb30182d056666) feat(client): add a Ctrl+K command palette - [`4213bd0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4213bd0d6601698567269268f89b6c5447085556) feat(client): add a "?" keyboard shortcuts overlay - [`4bae1ab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4bae1ab707393c7583b4397f003e58117f8ee971) fix(client): give focus back to the palette's opener when it closes - [`3367bdc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3367bdc546b661e195629c1552d13d1ddc1d3660) test(e2e): expect the command palette button in the mobile top bar order - [`d050199`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d050199e30d76cb53e54046a2b1e852568989379) style(client): render palette and shortcut keys in the app font - [`6eff16f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6eff16f4cde0a4c952102498c710ea2488d8a4f3) fix(client): close overlaying panels when the palette opens a chat or Home - [`f8d3bc1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f8d3bc10ecc500a42776354b1088e3d01feda044) fix(client): open the palette with the platform's own modifier only - [`e34c505`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e34c505c43592987dab776ccb6dd31e8d736cd50) fix(client): navigate from the palette only after the editor leaves - [`4ac699e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ac699e6e1747d7f795f67621dcaa1ce883dafe6) test(client): make the palette ranking check need the recency boost - [`664a0ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/664a0acaffa2d9ea616fd4f9627891b892b25309) fix(client): let the palette close a saved editor and navigate ### 📊 Changes **17 files changed** (+1696 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `e2e/core-flows.e2e.ts` (+2 -0) 📝 `packages/client/src/components/chat/HomeNewChatLauncher.tsx` (+17 -5) ➕ `packages/client/src/components/command-palette/CommandPalette.tsx` (+382 -0) ➕ `packages/client/src/components/command-palette/CommandPaletteHost.tsx` (+219 -0) ➕ `packages/client/src/components/command-palette/KeyboardShortcutsOverlay.tsx` (+61 -0) ➕ `packages/client/src/components/command-palette/palette-navigation.ts` (+52 -0) 📝 `packages/client/src/components/layout/AppShell.tsx` (+2 -0) 📝 `packages/client/src/components/layout/TopBar.tsx` (+25 -0) ➕ `packages/client/src/lib/command-palette.ts` (+301 -0) 📝 `packages/client/src/lib/editor-leave.ts` (+12 -0) ➕ `packages/client/src/lib/keyboard-shortcuts.ts` (+89 -0) 📝 `packages/client/src/lib/modal-overlay-registry.ts` (+5 -0) ➕ `packages/client/src/lib/settings-targets.ts` (+9 -0) 📝 `packages/client/src/localization/locales/en.json` (+65 -0) ➕ `packages/client/src/stores/command-palette.store.ts` (+21 -0) ➕ `scripts/regressions/command-palette.regression.ts` (+430 -0) </details> ### 📄 Description > **Rebased 2026-09-25** onto upstream staging `e15c9e558`. Hashes below are the rebased ones. The rebase had no conflicts. Re-checked after it: install, shared build, tsc (shared, server, client), locale check and this branch's own regressions, all passing. The full suites and CodeRabbit reviews listed below ran on the previous base, one or two staging updates earlier. **Base:** `staging` (`e15c9e558`) · **Head:** `contrib/command-palette` (`f8d3bc10e`) --- > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6624 Part 3 of the engine foundations series, see #6624. This PR is independent of the other parts. It targets `staging` directly and can be merged, reviewed or declined on its own. ## Why this change - There's no quick way to jump around the app. Reaching a chat, character, lorebook or Settings tab takes several clicks through panels. - The app has keyboard shortcuts, but nothing lists them. ## What changed 7 commits on `staging` `e15c9e558`, oldest first, 16 files: - `8243af09a` feat(client): add a Ctrl+K command palette. - `4213bd0d6` feat(client): add a "?" keyboard shortcuts overlay. - `4bae1ab70` fix(client): give focus back to the palette's opener when it closes. - `3367bdc54` test(e2e): expect the command palette button in the mobile top bar order. - `d050199e3` style(client): render palette and shortcut keys in the app font. - `6eff16f4c` fix(client): close overlaying panels when the palette opens a chat or Home. - `f8d3bc10e` fix(client): open the palette with the platform's own modifier only. **Command palette** - Opens with **Ctrl+K**, or **Cmd+K** on a Mac. Only the platform's own modifier opens it: Cmd+K on Mac, Ctrl+K everywhere else. - On touch screens, a search button in the top bar opens it. - It lists only things that exist upstream: chats, characters, personas, lorebooks, presets, the Settings tabs, and generic actions such as a new chat, opening a panel, or switching theme. - When it closes, focus returns to whatever opened it. - There is no feature switch. The palette is always available. **"?" overlay** - Pressing **?** while not typing, or picking **Keyboard shortcuts** in the palette, shows the shortcuts that really exist. Nothing is listed that the app doesn't do. **e2e fix** - `e2e/core-flows.e2e.ts`: "mobile topbar remains reachable" now expects the new command palette button in the top bar order. This was the cause of the `mobile-chromium` and `mobile-webkit` failures on the earlier umbrella PR #6625. **Review fixes** (local CodeRabbit) - Two legitimate findings, both fixed, none open: - Opening a chat or Home from the palette now closes overlaying panels, using the same panel breakpoint check as the TopBar Home button. - The palette opens with the platform modifier only. **Matching existing UI** The palette reuses what the app already has: - Dialogs use `ui/Modal`. - The top-bar button uses the same classes as the TopBar Home and Settings buttons (`TopBar.tsx`). - Result rows copy the quick-action rows in `ConversationInput.tsx`. - Section headers follow `CharacterEditor.tsx:1683`, and the search icon follows `CharactersPanel.tsx:858`. - Keys are plain bordered chips in the app font. Upstream has no monospace `kbd` style, so none was added. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` The boxes are left unticked for a human, per `AGENTS.md`. Everything below ran on the tip `f8d3bc10e`. | Check | Result | |---|---| | `tsc --noEmit` | clean, 5 runs | | Lint | 0 errors (1 warning in `GameNarration.tsx`, already on `staging`) | | Prettier, locales, builds | pass | | Full regression suite, Windows 11 | 367 / 372. The 5 failures are the known Windows-only ones. | | CI-equivalent, **Linux** (WSL Ubuntu 24.04) | `complete-node-regressions` **372 / 372** | | e2e `mobile-chromium`, full run | 426 / 427. The 1 failure passes when run alone. On plain `staging`, this project had load timeouts that all passed on rerun. | | e2e `mobile-webkit`, shards 1 and 6 | Fail only the same tests that fail on plain `staging`: advanced-memory Chat Settings, assigned-chat-sweep library cards, assigned-issue-sweep Android browser handoff, and core-flows software keyboard. | ### Manual verification notes - Checked the palette and the "?" overlay in the default and SillyTavern themes, light and dark, at desktop and phone sizes. - Checked for styles the app doesn't use: no cream backgrounds, italic accents, numbered or monospace labels, or pill buttons. - The regression `scripts/regressions/command-palette.regression.ts` covers the palette's actions and the overlay's shortcut list. ## Human to tick Based on the evidence above: - **`pnpm check` passes locally**: supported. Its steps (tsc, lint, Prettier, locales, builds, regressions) all passed, apart from the 5 known Windows-only failures, and Linux is 372 / 372. If you want the literal command, run `pnpm check` once before ticking. - **Ran the app, clicked through the changes manually**: supported for desktop and phone sizes in both themes, light and dark. Tick after trying it once yourself. - **Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed**: supported (two `CHANGELOG.md` entries). Not supported by the evidence, leave unticked unless done by hand: - Container built and ran: not run for this PR. - Checked edge cases: light and dark and the phone viewport were checked, but empty states and error paths were not recorded. Tick only after checking those too. - Above manual verification completed, and Read and followed `CONTRIBUTING.md`: only a human can confirm these. - No docs changes needed, Translated docs, and Version/release files updated: do not apply. ## Needs manual verification - Cmd+K on a real Mac. - Touch on a real iPhone and a real Android phone (top-bar button, palette, overlay). - A screen reader pass over the palette and the overlay. - The `mobile-webkit` shards other than 1 and 6. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) The PR adds two CHANGELOG entries under `[Unreleased]` and new English strings in `en.json`. No README or CONTRIBUTING changes, and no version bump. ## UI evidence (if applicable) Screenshots from a test instance with invented data, taken on this branch. **Ctrl+K palette with results** ![Ctrl+K palette with results](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/780dd41d0bf7adadbd81503aba92931d32a48e3a/C-command-palette-results_desktop-light_v1.0.png) **"?" keyboard shortcuts overlay** !["?" keyboard shortcuts overlay](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/780dd41d0bf7adadbd81503aba92931d32a48e3a/C-keyboard-shortcuts-overlay_desktop-light_v1.0.png) **Palette on a phone (390x844)** ![Palette on a phone (390x844)](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/780dd41d0bf7adadbd81503aba92931d32a48e3a/C-command-palette_phone-light_v1.0.png) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Open a command palette with Ctrl+K (Cmd+K on Mac) or the top-bar search button to find destinations and actions. Recently opened items appear first. * View keyboard shortcuts grouped by context with **?** when you’re not typing, or from the command palette. Shortcuts that depend on settings are identified. * Navigate to chats, settings, and other actions from the palette. Unsaved changes are protected by a confirmation before leaving an editor. * **Bug Fixes** * The palette won’t open over another dialog, and Ctrl+K continues to work in text fields that use it. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7272
No description provided.