feat: Improve visibility of key bindings#1064
Conversation
… stuff to shared space
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can customize the tone of the review comments and chat replies.Configure the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d08233a328
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const canSave = | ||
| normalizedDraftValue.length > 0 && normalizedDraftValue !== currentValue; |
There was a problem hiding this comment.
Disable saving while current keybindings are unresolved
canSave is derived only from normalizedDraftValue !== currentValue, so when this dialog is opened before server config finishes loading (the callers pass an empty keybindings array during that window), currentValue is null and every non-empty default draft looks “dirty.” Hitting Save in that state writes an override via upsertKeybinding, which replaces that command’s defaults; for multi-default commands like chat.new, this can silently drop one of the shipped shortcuts. Please gate saves until the current keybindings snapshot is loaded.
Useful? React with 👍 / 👎.
Summary
Adds a "Keys" button to the top navigation bar that opens a keybindings dialog, making shortcuts more discoverable without digging through settings.
What Changed
Added a "Keys" button to the top navigation bar that opens a keybindings dialog. The dialog displays all available key bindings grouped by category (Workspace, Chat, etc.) and allows users to:
With also disable the button in the settings and open the keyboard shortcuts dialog from the settings in the existing keyboard shortcuts section.
Why
Key bindings are currently only accessible through settings, making them easy to overlook. Many users rely on keyboard shortcuts for faster navigation, and having a dedicated, visible entry point in the top nav makes discoverability much better.
Resolves #1044
UI Changes
Before:
No dedicated shortcut access in the top navigation.
After:
A "Keys" button is added to the top navigation bar. Clicking it opens a dialog listing all keybindings with inline editing and reset capabilities.
Checklist
Note
Add in-app keybindings manager dialog with chat header button
KeybindingsControlcomponent (KeybindingsControl.tsx) that renders a dialog for viewing, editing, and restoring default keybindings, persisting changes viaserver.upsertKeybinding.ChatHeaderthat opens the keybindings dialog, controlled by a newshowHeaderKeybindingsButtonapp setting (defaults totrue).showHeaderKeybindingsButtonand a 'Manage keybindings' button in the settings route (_chat.settings.tsx).DEFAULT_KEYBINDINGSto a new shared package export (packages/shared/src/keybindings.ts) so both server and web can import it.keybindingValueFromEvent,keybindingValueForCommand, andshortcutLabelsForCommand.Macroscope summarized d08233a.