fix: adapt keyboard shortcut display for macOS#2484
Open
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Open
fix: adapt keyboard shortcut display for macOS#2484Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Conversation
Closes QwenLM#2227 On macOS, keyboard shortcut hints now use native modifier symbols (⌃ for Ctrl, ⌘ for Cmd, ⌥ for Alt, ⇧ for Shift) instead of the generic "ctrl+", "cmd+" text format. - Add formatShortcut() utility in shortcutFormatter.ts - Apply to KeyboardShortcuts panel and retry hint messages - Non-macOS platforms are unaffected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
On macOS, keyboard shortcut hints now use native modifier symbols (
⌃for Ctrl,⌘for Cmd,⌥for Alt,⇧for Shift) instead of the generic text format.Closes #2227
Dive Deeper
The CLI keyboard shortcut panel and error retry hints displayed shortcuts like
ctrl+y,cmd+vregardless of platform. On macOS, the convention is to use symbolic modifiers (⌃Y,⌘V).Changes:
packages/cli/src/ui/utils/shortcutFormatter.ts— NewformatShortcut()utility that converts modifier names to macOS symbols whenprocess.platform === "darwin"packages/cli/src/ui/components/KeyboardShortcuts.tsx— ApplyformatShortcut()to shortcut key displaypackages/cli/src/ui/hooks/useGeminiStream.ts— ApplyformatShortcut()to "Press Ctrl+Y to retry" hint messagespackages/cli/src/ui/utils/shortcutFormatter.test.ts— Tests for Mac symbol conversion, multi-part shortcuts, and non-Mac passthroughNon-macOS platforms are completely unaffected — the formatter is a no-op on Linux/Windows.
Reviewer Test Plan
⌃Y,⌃C,⌘Vetc.⌃Yinstead ofCtrl+Yctrl+y,ctrl+c)Testing Matrix
Linked issues / bugs
Closes #2227