Conversation
…etters Settings lists New chat as Shift+N, and `matchesHotkey` compared `KeyboardEvent.key`. `key` follows the layout, which is right on Dvorak, where the key that writes N is not the key QWERTY calls N. A layout that writes another script has no key that writes an N at all. Shift and the N key write "Т" on Russian and "Ν" (Greek capital nu) on Greek, so the shortcut never fired for anybody with one of those layouts selected. The combo's key is now read from `key` as before, unless `key` is a single character outside ASCII. Then it comes from the physical key in `code` (`KeyN` reads as "n"). Latin layouts behave exactly as they did, the modifiers are still compared exactly, and a non-Latin character on a key with no letter of its own matches nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 16, 2026 10:52
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
What this changes
Settings → Keyboard shortcuts lists New chat as Shift+N, and
useHotkeymatches it withmatchesHotkey, which comparedevent.key.toLowerCase()to"n".keyis the character the layout writes. That is the right thing to compare on a layout that only moves letters around. On Dvorak, the key that writes N is the one QWERTY calls L, and that is the key a person presses when told "N". A layout that writes another script has no key that writes an N at all:keycode"Т"KeyN"Ν"KeyN"N"KeyL"B"KeyNSo for anybody with such a layout selected, the one shortcut the app lists does nothing.
A new
keyOf(event)reads the combo key fromkeyexactly as before, unlesskeyis a single character outside ASCII. Only in that case does it read the physical key fromcode:KeyNreads asn, andDigit2as2. Ifcodenames no letter or digit, the written character stands and matches nothing. Every modifier is still compared exactly, and nothing else inmatchesHotkeyoruseHotkeychanges, including the editable-target guard.Where it runs
Boundary and audit
/channel/new.Changelog
CHANGELOG.mdunderUnreleased.Proof
New
app/tests/hotkey-layouts.test.ts. It callsmatchesHotkeywith the registry's ownnew-chatcombo and keydowns shaped the way a browser reports them, withkeyfrom the layout andcodefrom the physical key.On
main(only the test file added):The two passing cases are pins. Dvorak still goes by the letter, in both directions. The modifiers stay exact on the physical key: no Shift, extra Ctrl/Meta, another key's Cyrillic letter, a non-letter key, and the Shift key itself all match nothing.
With the fix:
bun test app/tests/hotkey-layouts.test.ts: 3 pass, 0 fail. Every branch ofkeyOfruns: a multi-characterkey, an ASCIIkey, and a non-ASCIIkeyon a letter key and on a non-letter key.bun test app/: 853 pass, 29 fail. Onmainit is 850 pass with the same 29 failures, all from this Windows machine:serve.test.tsport and websocket cases, Windows path separators, and a relative-time assertion reading a Korean locale.bun run typecheck(app, server, worker): exit 0.bunx biome checkon the changed files: clean.This PR adds its line at the top of
## Unreleased, the same place other open PRs add theirs, so the changelog may conflict. I'm happy to rebase.🤖 Generated with Claude Code