Skip to content

fix(desktop): spell keyboard shortcut labels per platform - #3887

Open
riba2534 wants to merge 4 commits into
apache:mainfrom
riba2534:cursor/desktop-platform-aware-shortcut-labels-d7d5
Open

fix(desktop): spell keyboard shortcut labels per platform#3887
riba2534 wants to merge 4 commits into
apache:mainfrom
riba2534:cursor/desktop-platform-aware-shortcut-labels-d7d5

Conversation

@riba2534

Copy link
Copy Markdown

Fixes #3876.

Shortcut bindings are already cross-platform (mod to Cmd on macOS, Ctrl elsewhere). The labels were hard-coded as macOS glyphs, so Windows/Linux showed Cmd-N instead of Ctrl-N.

This adds a platform-aware formatter keyed on app.info().platform. Locale catalogs now use neutral tokens (mod, shift, alt). Bindings are unchanged.

AI use: generative tooling made a substantive contribution.

@M4n5ter
M4n5ter force-pushed the cursor/desktop-platform-aware-shortcut-labels-d7d5 branch from a137005 to 3ba2395 Compare August 26, 2026 09:25
Shortcut BINDINGS were already cross-platform: every entry is registered as
`mod`, which Astryx resolves to Command on macOS and Control everywhere else,
so Ctrl+N has always created a task on Windows. The LABELS were written once,
in macOS glyphs, and shown to everyone — the rail's new-task row read
`⌘ N`, the palette hints read `⌘,` / `⌥⌘S` / `⇧⌘D`, and the shortcuts
sheet was authored with a literal `⌘`.

Adds a single owner for how a shortcut is spelled (`formatShortcut` in
@maka/ui), keyed on the host OS the main process reports and published through
HostPlatformProvider. The locale catalogs now carry neutral tokens
(`mod`, `shift`, `alt`) instead of glyphs, since a shortcut is not
localized — only the platform varies. No binding changes.

Astryx's Kbd resolves `mod` but spells ctrl/alt/shift with Apple glyphs on
every platform, so chips that carry a modifier are now product-drawn from the
same theme tokens; Kbd stays where the keys are identical everywhere (the
palette footer's arrows, Enter and Esc).

Closes apache#3876
The bug in apache#3876 was that only one platform's spelling had ever been checked,
so these read the real locale catalogs through the real formatter — the same
call the shortcuts sheet and the palette make — on all three platforms.

Two of them are regression fences rather than examples: no palette hint may
carry an Apple modifier glyph off macOS, and no sheet row may be authored with
one at all, since a row that arrives already spelled has no platform left to
answer to.
@M4n5ter
M4n5ter force-pushed the cursor/desktop-platform-aware-shortcut-labels-d7d5 branch from 3ba2395 to 827a056 Compare August 26, 2026 09:58
@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Aug 27, 2026
The platform-aware shortcut label work added shortcut-keys.tsx, its
stylesheet and host-platform-context.tsx, so the generated surface
inventory no longer matched disk and the coverage gate failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant