Skip to content

App: keyboard shortcuts cannot be changed, and there is no command palette - #833

Closed
itz4blitz wants to merge 1 commit into
mainfrom
issue/789-command-palette
Closed

itz4blitz wants to merge 1 commit into
mainfrom
issue/789-command-palette

Conversation

@itz4blitz

Copy link
Copy Markdown
Collaborator

What changed and why

Settings › Shortcuts can change a key. Click a row, press the new keys, and Reset puts the defaults back. A key another command already uses is refused. The quick switcher lists commands after >: menu actions, set status, pause notifications, toggle mute, sign in, and open a settings section. With a message row focused, E, R, +, T and Delete run the action when that message allows it.

P and U are listed and resolve the message. They do not call out: pinning and mark-unread-from-here have no request. Up on an empty composer is the edit-last binding. The composer does not read it yet, because that file is owned by other pull requests. Undo, Redo, Cut, Copy, Paste and Select All stay the platform's own keys.

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

Proof

Scenario: e2e/scenarios/command-palette

Lab run: not posted yet. The driver sets TINYCLIENT_PROVE=command-palette and exits 0 only when rebinding Quick Switcher moves the chord and the menu label. A build without that arm opens the window and the driver fails.

Locally: cargo test -p tinyclient --features gui --bins (the keymap tests and the caption test passed; one Windows named-pipe test failed because the primary pipe was already taken, and that file is not in this diff). cargo clippy -p tinyclient --features gui --all-targets.

Not tested: clicking a row in the Settings window, the > list on screen, or a message key in a live conversation.

Compatibility

No protocol change. Set status and pause notifications use the requests the app already sends.

Risk and rollback

A saved chord replaces the default until Reset, or until the keymap file is removed. Revert this change to go back to the fixed table.

Release note

Shortcuts can be changed in Settings, and the quick switcher runs commands after >.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Tiny Code Review

⚠️ Code review unavailable · run

the AI provider rate-limited the request

This is advice, not a gate. Re-run with the agent:review label or a /review comment.

@unRekable unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

🟡 1 finding (0 blocking).

The PR moves every hard-coded chord into one keymap catalog, lets Settings rebind rows with conflict and typing checks persisted to a small overrides file, and turns > in the quick switcher into a command palette; palette commands run through chatd via the existing background ask pattern, so no process boundary or wire field is touched. The rebind path validates parse, conflicts and defaults, and re-registers every binding site through rebind_keys. It fails on one point: rebinding never re-sets the menu bar, so on macOS the old chord stays baked into the NSMenuItem — the menu keeps showing the old key and the OS keeps firing the action on it, which also means a key the keymap now considers free is still taken until some rename happens to trigger refresh_menus.

Residual risk

  • In command_hits, only the first row of the result carries a section header, and it is hard-coded to "Commands" — with a bare > the first row is a "Go to …" place row, so it is headed "Commands".
  • Keymap::save ignores write failures (let _ = std::fs::write), so a rebind can look applied in Settings and be gone after a restart with no hint.
  • message_shortcut passes Focus::Message unconditionally and shortcut_message targets the hovered row or the last non-system message; with the message list focused but no row hovered, Shift+Delete at-once deletes the user's own latest message (the same at-once path as today's Shift-click, but reachable without pointing at a row).


/// Drops every chord and binds the stock map plus whatever Settings saved.
pub(crate) fn rebind_keys(cx: &mut App) {
cx.clear_key_bindings();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: rebind_keys clears and re-registers the in-app bindings but nothing re-sets the menus, and Shell::refresh_menus compares only places/open/update-label, so a rebind never triggers a rebuild. On macOS the key equivalents are baked into the NSMenuItems at set_menus time (vendor/gpui_ce_macos/src/platform.rs builds them from the binding registry once), so after rebinding Quick Switcher the menu bar still shows and still fires ⌘K while Settings and the Help page say ⇧⌘P; the old chord also never frees up, so a command rebound onto it silently shares the key with the menu. Fix inside rebind_keys: after rebinding, force a menu rebuild (or fold keymap state into refresh_menus' signature and call it) so the menu, its key equivalents and the keymap agree.

@itz4blitz

Copy link
Copy Markdown
Collaborator Author

Superseded by and merged in #903 (d387971 — Release 2026-11-20 combined PR).

@itz4blitz itz4blitz closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants