Skip to content

fix: adapt keyboard shortcut display for macOS#55

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-2484-fix-mac-keyboard-shortcut-display
Open

fix: adapt keyboard shortcut display for macOS#55
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-2484-fix-mac-keyboard-shortcut-display

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

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 QwenLM#2227

Dive Deeper

The CLI keyboard shortcut panel and error retry hints displayed shortcuts like ctrl+y, cmd+v regardless of platform. On macOS, the convention is to use symbolic modifiers (⌃Y, ⌘V).

Changes:

  • packages/cli/src/ui/utils/shortcutFormatter.ts — New formatShortcut() utility that converts modifier names to macOS symbols when process.platform === "darwin"
  • packages/cli/src/ui/components/KeyboardShortcuts.tsx — Apply formatShortcut() to shortcut key display
  • packages/cli/src/ui/hooks/useGeminiStream.ts — Apply formatShortcut() to "Press Ctrl+Y to retry" hint messages
  • packages/cli/src/ui/utils/shortcutFormatter.test.ts — Tests for Mac symbol conversion, multi-part shortcuts, and non-Mac passthrough

Non-macOS platforms are completely unaffected — the formatter is a no-op on Linux/Windows.

Reviewer Test Plan

  1. Run on macOS — verify shortcut panel shows ⌃Y, ⌃C, ⌘V etc.
  2. Trigger an API error — verify retry hint shows ⌃Y instead of Ctrl+Y
  3. Run on Linux/Windows — verify shortcuts display unchanged (ctrl+y, ctrl+c)

Testing Matrix

🍏 🪟 🐧
npm run

Linked issues / bugs

Closes QwenLM#2227

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
@BingqingLyu

BingqingLyu commented May 7, 2026

Copy link
Copy Markdown
Owner Author

Conflict Group 1

This PR shares modified functions with 4 other PR(s): #106, #6, #9, #96.

These PRs should be reviewed as a batch — merging one may affect the others.

Function File Also modified by
showCitations useGeminiStream.ts #106, #6, #9, #96
graph LR
    PR55["PR #55"]
    FshowCitations_6790["showCitations<br>useGeminiStream.ts"]
    PR55 -->|modifies| FshowCitations_6790
    PR106["PR #106"]
    PR106 -->|modifies| FshowCitations_6790
    PR6["PR #6"]
    PR6 -->|modifies| FshowCitations_6790
    PR9["PR #9"]
    PR9 -->|modifies| FshowCitations_6790
    PR96["PR #96"]
    PR96 -->|modifies| FshowCitations_6790
Loading

Posted by codegraph-ai conflict detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

提示快捷键没有适配不同型号的电脑

2 participants