fix(web): keyboard hints no longer assume macOS - #7715
Conversation
Three shortcut hints in the web UI rendered Mac key symbols unconditionally. The keybindings settings pills now derive their labels from the structured shortcut through a new formatShortcutLabelParts, which also fixes the "+" key and the lowercase names for Esc, Space and the arrows. The diff comment hint and the empty prompt-stash hint pick their label per platform, the stash one through shortcutLabelForCommand so a rebind is reflected too.
|
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR fixes keyboard shortcut hints to show platform-appropriate labels (Ctrl+X on Windows/Linux, ⌘X on Mac) instead of always assuming macOS. The changes are display-only, well-tested, and self-contained. You can add or adjust custom eligibility rules. Learn more. |
UI Changes
No screenshots: the change is text, and the strings are exact. On Windows/Linux:
mod+shift+dCtrl⇧DCtrlShiftDmod+escCtrlescCtrlEsc⌘/Ctrl Enter to sendCtrl+Enter to sendPress ⌘S with a prompt…Press Ctrl+S with a prompt…macOS is unchanged everywhere except the diff comment hint, which loses the
/Ctrlhalf.Checklist
Changes by Claude Opus 5 running in Claude Code.
Note
Low Risk
UI-only label formatting; shortcut matching is unchanged. Low chance of visual regressions in keybinding pills.
Overview
Shortcut hints no longer tell Windows/Linux users to press Mac keys.
formatShortcutLabelnow joinsformatShortcutLabelParts, so settings pills render each key from the structured shortcut instead of splitting a serialized string. That fixes mixed Mac glyphs (⇧/⌃on every OS), the+key, and named keys likeEsc.Diff comment send hints resolve to
⌘EnterorCtrl+Enter. The empty stash drawer usesshortcutLabelForCommandforcomposer.stash(or omits the key if unbound).Reviewed by Cursor Bugbot for commit 3d22677. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix keyboard hints to stop assuming macOS in web components
formatShortcutLabelPartsin keybindings.ts to produce per-key labels with platform-correct symbols (⌃⌥⇧⌘ on Mac, Ctrl/Alt/Shift/Meta elsewhere);formatShortcutLabelnow delegates to it⌘EnterorCtrl+Enterbased on host platform instead of the fixed⌘/Ctrl Enter to sendprimaryServerKeybindingsAtomand renders it in the empty-state hint, falling back to a generic message when unavailableKeybindingPillswitches from a stringvalueprop to a structuredshortcut: KeybindingShortcut, usingformatShortcutLabelPartsfor renderingKeybindingPillnow requires ashortcutprop instead ofvalue; any callers still passingvaluewill breakMacroscope summarized 3d22677.