Repository navigation
Conversation
|
@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel. A member of the Team first needs to authorize it. |
…d Forward on Norwegian (BRA-2238) Back and Forward are matched by the key's place (e.code), so on a layout where [ and ] need ⌥ they're ⌘ and the keys right of P. The arrows' tooltips, the Keyboard shortcuts sheet, Settings → Shortcuts and ⌘K now show those keys: ⌘Å and ⌘¨ on Norwegian, ⌘Ü and ⌘+ on German. A table entry's code says which keys go by place (lib/key-layout.ts); the layout comes from navigator.keyboard.getLayoutMap(), the Mac app's key_layout command (UCKeyTranslate on the input source in use, keys.rs), and bare keys pressed in those places. Unknown, it shows a US keyboard's keys. No key binding changes. Every shortcut description is one short clause that fits its line in the sheet; the details moved to docs/guides/keyboard-shortcuts.mdx. Tip remounts its tooltip when its child's disabled flips, so Back's and Forward's tooltips show on hover once they're enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stener1
force-pushed
the
bra-2238-layout-aware-shortcuts
branch
from
October 23, 2026 22:54
e1338b3 to
a838a6b
Compare
This branch has not been deployed
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.
Summary
Back and Forward (⌘[ / ⌘]) are matched by the key's place (
e.code), so on a layout where [ and ] need ⌥ they are ⌘ and the keys right of P. The UI never said so. Now every place that shows a shortcut's keys shows the key in that place on the layout in use: ⌘Å / ⌘¨ on Norwegian, ⌘Ü / ⌘+ on German, still ⌘[ / ⌘] on US. No key binding changes.Unknown layout → a US keyboard's keys, as before. The ⌘⌥ letter shortcuts (⌘⌥D/C/S/I) go by place too, so they follow the layout as well (⌘⌥E on Dvorak).
Also:
docs/guides/keyboard-shortcuts.mdx. Settings → Shortcuts also searches by the menu name and by the keys either way (⌘åand⌘[both find Back).Tipwraps a disabled child in a span; when the arrow became enabled the trigger element changed and hover never opened it (keyboard focus did).Tipnow remounts its tooltip whendisabledflips.drive.mjstakes a scenarioinit(an init script, here a stubbed layout); newkeyboard-layoutandkeyboard-layout-usscenarios;navigation-history.mdhashistory-layout.Evidence
Driven with the verify skill (
keyboard-layout,keyboard-layout-us): the production build on the mock fixtures in Chromium, withgetLayoutMap()stubbed, no console errors.The Mac side, on a real Mac (macOS 27, the Mac mini):
cargo test --libpasses all 7, including the newkeys::tests::keys_in_their_place_on_each_layout, which reads the installed layouts through the sameUCKeyTranslatepath without switching to them:Checks:
pnpm typecheck:plugins,check:titles,check:type,check:grid,check:cspandcheck:themespass. So dopnpm test(580, with the newkey-layout.test.tsand a 40-character cap on descriptions),pnpm build,npx tsc -p e2eand(cd docs-site && pnpm build).e2e/back-forward.spec.tspasses, with a new Norwegian test. That test switches to US with the window focused the whole time and checks the sheet follows.keyboard.spec.ts,compare.spec.tsandnavigation-historypass too.keyboard.spec.ts:173and two insidebar-fleet.spec.ts.navigation-historyfailed once on a 5px dashboard scroll difference, then passed 3 more times.cargo checkcouldn't run on the devbox (no GTK dev libraries).keys.rscompiles for Linux on its own with-D warnings, and its non-macOS path returns an empty map.Review: Codex review and adversarial review found two things, both fixed:
A simplify pass replaced the hard-coded ⌘⌥D/C/S hints with
keysFor. It also added a test tying each tablecodeto the key handler, and limits the native layout call to the Mac app.A person checks the Mac app (the mock stubs the layout):
NSMenuItem.allowsAutomaticKeyEquivalentLocalization, on by default, and muda leaves it on). The items still hand mudaCmdOrCtrl+[, so what it reads (⌘Å or ⌘[) is up to macOS. muda can't take a layout key like Å as an accelerator.Merge Danger
Door: two-way
Display, copy and docs. No key bindings, no stored data. Reverting the PR undoes it.
Blast Radius: small
Tipremounts its tooltip when its child'sdisabledflips, so a tooltip open at that moment closes.key_layout(read-only, sync, main thread).🤖 Generated with Claude Code