Repository navigation
[KS] Menus: keep localized native root titles; exact Shift shortcuts (#449, #450) - #455
Merged
Merged
Conversation
…it (#449) A root with target { menu } merged into an existing native menu and set its title to the label, replacing the system's localized title (ar, fr). The label now names only a root Spark creates.
…ts (#450) AppKit matches a lowercase key equivalent to a key event made with keyEventWithType: (the test driver's) by its characters, ignoring Shift, so a published Cmd+Shift+N ran on Cmd+N and not on Cmd+Shift+N. The uppercase form matches only the shifted press, for driver and hardware events.
This was referenced Oct 13, 2026
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.
Refs #449, Refs #450
#449: located roots replaced the system's localized menu title
RNNativeMenuapplied a root'slabelas the title of the native root it located withtarget: { menu }(Window, Help, ...), replacing e.g. "نافذة"/"Fenêtre". A native root now keeps its own title; the label names only a root Spark creates when it is missing (a later owner's label can retitle that one, matching the Windows composer). Documented in docs/menus.md.#450: ⌘⇧N fired nothing under the driver
Root cause (standalone AppKit probes, macOS 27): Spark published
Cmd+Shift+Nas key equivalentnwith a Shift mask. Hardware (CGEvent-backed) events match that correctly. Key events made with+[NSEvent keyEventWithType:], which the in-app driver uses, are matched by their characters with Shift ignored:n+⇧⌘ ran on ⌘N and did nothing on ⌘⇧N. File ▸ New (⌘N) does not catch ⌘⇧N either; the issue's probe usedcharactersIgnoringModifiers: n, which neither hardware nor the driver produces. The driver bypasses local event monitors, so the shortcut map's router never sees driver keys and only the menu item can fire. Setting the keyboard type on the synthesized event did not change matching.Fix: a Shift+letter shortcut is published as AppKit's uppercase key equivalent (
Nwith ⇧⌘), which matches only the shifted press for both driver and hardware events. Documented in docs/menus.md.Tests
tests/application-menu.native.mm: localized Edit and Window roots keep their titles; a created root uses its label and a later owner retitles it; File ▸ New ⌘N + published ⌘⇧N: the published key isN, ⌘⇧N (synthesized and CGEvent) runs only New note, ⌘N runs only File ▸ New. Each part failed with its fix reverted (Edit menu lost its localized title;Shift shortcut did not use AppKit's uppercase key equivalent, and with only that assertion removed,Shift-Command-N did not run New note).e2e/flows/menus/macos-localized-root.yaml(checkMENU-ROOT-01, en/ar/fr): Menu Audit's Help contribution lands in مساعدة / Aide, with no English Help root.Verification
Run this session on macOS 27:
bun run typecheck: clean.bun run e2e:lint: 0 problems (342 files).bun run test: 1982 passed, 2 failed, both accepted:tests/node-runtime.test.ts(asdf node shim) andtests/motion-native.test.ts(frames check while the display sleeps).ks-lock native bun run e2e:run e2e/flows/menus e2e/flows/keyboard e2e/flows/internationalization e2e/flows/infra/catalog-driver.yaml --backend driveron a dev build with both fixes: 37 passed, 3 failed, 2 skipped (Windows). Passed includekeyboard/shortcut-map-rebind,menus/macos-localized-root(en, ar, fr),menus/macos-shortcut-takeover,internationalization/native-strings(en, ar, fr) andinfra/catalog-driver(4). Failed:menus/macos-helpandmenus/macos-items(×2), which use black-box-only steps (searchHelpMenu,assertMenuItem) the driver reports unsupported, as on the base.macos-localized-rootandshortcut-map-rebindon a dev build with the baseRNNativeMenu.mm: ar and fr fail ("مساعدة" is not in [..., Help, ...],"Aide" is not in [..., Help, ...]), and rebind fails as reported in [KS][KEY] shortcut-map-rebind: ⌘⇧N fires nothing under the driver #450.ks-lock gui) runs.