Skip to content

fix(desktop): keyboard shortcuts show macOS glyphs (⌘ N) on Windows instead of Ctrl #3876

Closed

Description

@me2seeks

What happened

Desktop shortcut display strings are hard-coded to macOS glyphs on all platforms. The behavior is correct (Ctrl+N works on Windows), but the labels still show ⌘.

  • Sidebar "New Task" button (packages/ui/src/session-sidebar-nav.tsx:69) always renders <kbd>⌘ N</kbd>:

    endContent={<kbd className="maka-nav-kbd" aria-hidden="true">⌘ N</kbd>}

    On Windows it should be Ctrl N.

  • Keyboard Help panel (apps/desktop/src/renderer/locales/shell-copy.ts:1119-1126 zh / 1644-1658 en) hard-codes:

    { keys: ['⌘', 'K'], description: 'Open command palette' },
    { keys: ['⌘', 'N'], description: 'Create a new task' },
    { keys: ['⌘', ','], description: 'Open Settings' },
    { keys: ['⌘', 'Shift', 'D'], description: 'Copy diagnostics' },

    keyboard-help.tsx only renders copy.sections; ASTRYX_KEY_TOKENS['⌘']='mod' affects hotkey binding, not display.

  • Static command hints in the same file also hard-code macOS:

    • action:open-settings: hint: '⌘,' → Windows Ctrl+,
    • action:side-chat: hint: '⌥⌘S' → Windows Ctrl+Alt+S
    • diag:copy-diagnostics: hint: '⇧⌘D · …' → Windows Ctrl+Shift+D

For comparison, the actual shortcut handling is already cross-platform:

// apps/desktop/src/renderer/app-shell-effects.ts:269
useHotkeys([
  { keys: 'mod+,', allowInInputs: true, onPress: () => openSettings() },
  { keys: 'mod+n', allowInInputs: true, onPress: (e) => { if (!e.shiftKey) createSession() } },
])

mod resolves to Cmd on macOS and Ctrl on Windows/Linux, so Ctrl+N correctly creates a new task on Windows — only the UI text is wrong.

Similarly, the native menu is correct:

// apps/desktop/src/main/application-menu.ts:54-102
if (platform !== 'darwin') return null; // renderer owns shortcuts on Win/Linux
{ label: 'New Task', accelerator: 'CmdOrCtrl+N' } // only on darwin

Expected:

  • Windows/Linux: Ctrl+N (New Task), Ctrl+K (Command palette), Ctrl+, (Settings), Ctrl+Shift+D (Diagnostics) in both the sidebar kbd and Keyboard Help.
  • macOS: keep ⌘ N / ⌘ K / ⌘ , / ⇧⌘D.
  • Also map ⇧→Shift, ⌥→Alt on Windows.

Suggested fix:
Reuse existing platform signal window.maka.app.info().platform (darwin/win32/linux, already written to document.documentElement[data-os] in app-shell-effects.ts:102) to branch display strings, e.g. a formatShortcut(['mod','n']) helper or platform-aware getShellCopy(platform) / SessionSidebarNav prop. Avoid hard-coding ⌘/⌥/⇧ in shell-copy.ts — derive them from platform === 'darwin'.

How to reproduce

  1. Launch Desktop on Windows (info.platform === 'win32'), or inspect the renderer with any platform mock.
  2. Observe the left Session sidebar: the "New Task" row shows ⌘ N on the right (expected Ctrl N on Windows).
  3. Press ? to open the Keyboard Shortcuts panel → "General" section shows ⌘ N / ⌘ K / ⌘ , / ⌘ Shift D (Windows should show Ctrl prefix).
  4. Press Ctrl+N — a new task is correctly created (behavior is fine, only display is wrong).

Environment

  • Maka version or commit: 2b4c0deaa (main, 2026-08-26)
  • OS and version: Reproduces on Windows (platform: win32); macOS displays correctly and serves as the reference
  • Surface: Desktop (Electron + Renderer, packages/ui + apps/desktop/src/renderer)
  • Node.js version: N/A (desktop build)

Logs, screenshots, or additional context

No runtime error; functional shortcut mod+n works, data-os attribute is already set correctly. Additional file refs:

  • packages/ui/src/session-sidebar-nav.tsx:69 — hard-coded <kbd>⌘ N</kbd>
  • apps/desktop/src/renderer/locales/shell-copy.ts — all ⌘ / ⌥ / ⇧ hints
  • apps/desktop/src/renderer/keyboard-help.tsx:40-41 — ASTRYX_KEY_TOKENS maps ⌘→mod for binding only
  • apps/desktop/src/renderer/app-shell-effects.ts:102 — data-os source
  • apps/desktop/src/main/application-menu.ts:54-102 — correct platform-branching reference implementation
中文详情 / Chinese details

Desktop 上的「新建任务」旁快捷键提示以及键盘帮助面板(? / ⌘/)在所有平台都固定显示为 macOS 样式 ⌘ N / ⌘ K / ⌘ , / ⇧⌘D 等,而在 Windows 上按平台约定应显示为 Ctrl N / Ctrl K / Ctrl , / Ctrl+Shift+D。

功能层是正确的:app-shell-effects.ts:269 已使用 mod 跨平台抽象,mod 在 macOS 解析为 Cmd、Win/Linux 解析为 Ctrl,所以 Ctrl+N 确实能新建任务,问题只在展示层写死了 ⌘。

展示层写死位置:

  1. packages/ui/src/session-sidebar-nav.tsx:69 侧边栏「新建任务」按钮右侧 ⌘ N
  2. shell-copy.ts:1119-1126 / 1644-1658 keyboardHelp 的 ⌘ K / ⌘ N / ⌘ , / ⌘ Shift D
  3. 同文件 hint: '⌘,' / '⌥⌘S' / '⇧⌘D'

预期:Win/Linux 显示 Ctrl 前缀,macOS 保持 ⌘。复用 window.maka.app.info().platform → data-os 做平台分支,避免在 shell-copy.ts 硬编码字形,⇧/⌥ 同步映射为 Shift/Alt。

复现步骤:在 Win 上启动 → 观察侧边栏 ⌘ N → 打开 ? 快捷键面板查看 ⌘ 前缀 → 按 Ctrl+N 功能正常仅显示错误。

Activity

  1. changed the title [-]fix(desktop): Windows 仍显示 ⌘ N 等 macOS 快捷键字形(新建任务/键盘帮助/命令面板 hint)[/-] [+]fix(desktop): keyboard shortcuts show macOS glyphs (⌘ N) on Windows instead of Ctrl[/+] on Aug 26, 2026
  2. added 2 commits that reference this issue on Aug 26, 2026
    0a7460a
    fe4372a
  3. added 4 commits that reference this issue on Aug 26, 2026
    ca01e00
    5ebf3df
    c6bbff9
    0882469
  4. added
    bug
    help wanted
    on Aug 29, 2026
  5. added theissue type on Aug 29, 2026
  6. ggbdpq commented on Sep 1, 2026

    @ggbdpq
    Contributor

    take

  7. added a commit that references this issue on Sep 1, 2026
    4843d94
  8. added a commit that references this issue on Sep 1, 2026
    195fa15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issuehelp wanted

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions