Limit physical key fallback to non-Latin layout output - #4469
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Straightforward bug fix adding a regex guard to prevent physical key fallback when the layout already outputs a Latin letter. Change is well-scoped, clearly documented, and includes tests covering both the fix and preserved behavior for non-Latin layouts. You can customize Macroscope's approvability policy. Learn more. |
Shortcut matching accepted both the layout-derived key and the physical KeyA-KeyZ position for every keypress. On remapped Latin layouts one physical key then triggered shortcuts for two different letters, and a shortcut like mod+D consumed the key a user needs for mod+A. Keep the physical fallback only when the layout produces something other than a Latin letter, which is the case it was added for: non-Latin layouts and Option-modified symbols on macOS. Fixes pingdotgg#4434
dc1345e to
85645a8
Compare
## What's Changed * fix(desktop): route mouse thumb buttons to the in-app browser by @akosbalogh in pingdotgg/t3code#4459 * fix(web): keep the final segment of directory paths with a trailing separator by @jorvarea in pingdotgg/t3code#5460 * Keep block code plain when copying from rendered markdown by @yashranaway in pingdotgg/t3code#4468 * fix(web): add web app manifest so installed app keeps its scope by @Albro3459 in pingdotgg/t3code#4306 * Skip user hooks during Claude capability probes by @yashranaway in pingdotgg/t3code#4466 * fix(mobile): use Android monospace font family by @tastelessjolt in pingdotgg/t3code#4609 * fix(desktop): timestamps follow the OS locale instead of en-US by @brzzdev in pingdotgg/t3code#6190 * fix(web): keep multi-select questions open after the first click by @RaitP1 in pingdotgg/t3code#6646 * fix(web): stop clipping the changed-files expand hover on Windows by @mrmg in pingdotgg/t3code#6545 * fix(server): allow long-running git pushes by @devchaudhary24k in pingdotgg/t3code#6499 * fix(desktop): keep probing backend readiness while the process is alive by @lgwacker in pingdotgg/t3code#5526 * fix(server): allow install scripts in npm-global provider updates by @hey-jj in pingdotgg/t3code#5646 * fix: detect SSH remotes with non-git user prefixes (e.g. gitlab@) by @JackatDJL in pingdotgg/t3code#3649 * fix(web): describe what Ultracode does in the Reasoning picker by @delltrak in pingdotgg/t3code#6092 * fix(server): settle pending user-input requests when a Claude session stops by @AaronAbuUsama in pingdotgg/t3code#5127 * fix(server): stop replaying a command receipt for a different aggregate by @ostapondo in pingdotgg/t3code#5246 * fix(server): settle snoozed threads immediately by @0bkevin in pingdotgg/t3code#5379 * fix(mobile): prevent crash on sign out in settings by @shubhu121 in pingdotgg/t3code#4899 * fix(mobile): local-checkout threads record their branch so PR badges show by @Zeus-Deus in pingdotgg/t3code#4986 * fix(web): contain long approval commands by @Serendeep in pingdotgg/t3code#6503 * feat(web): make right panel maximize bindable by @husseinraoouf in pingdotgg/t3code#5091 * fix(server): respect inherited OPENCODE_CONFIG_CONTENT by @jonocodes in pingdotgg/t3code#4242 * fix(marketing): detect Mac chip on homepage download button by @mahdibm-dev in pingdotgg/t3code#4197 * Keep the server alive when a response write hits a dead socket by @yashranaway in pingdotgg/t3code#4470 * Limit physical key fallback to non-Latin layout output by @yashranaway in pingdotgg/t3code#4469 * fix: restore CLAUDE.md symlink target by @NgoQuocViet2001 in pingdotgg/t3code#3929 * fix(clients): default clone destination to folder plus repo name by @inayayousfi in pingdotgg/t3code#5989 * fix(web): keep timestamp date and time in the same locale by @juliusmarminge in pingdotgg/t3code#7081 * feat(desktop): add signal macOS DMG installer background by @Brechard in pingdotgg/t3code#6201 ## New Contributors * @akosbalogh made their first contribution in pingdotgg/t3code#4459 * @jorvarea made their first contribution in pingdotgg/t3code#5460 * @yashranaway made their first contribution in pingdotgg/t3code#4468 * @Albro3459 made their first contribution in pingdotgg/t3code#4306 * @tastelessjolt made their first contribution in pingdotgg/t3code#4609 * @brzzdev made their first contribution in pingdotgg/t3code#6190 * @RaitP1 made their first contribution in pingdotgg/t3code#6646 * @devchaudhary24k made their first contribution in pingdotgg/t3code#6499 * @lgwacker made their first contribution in pingdotgg/t3code#5526 * @JackatDJL made their first contribution in pingdotgg/t3code#3649 * @delltrak made their first contribution in pingdotgg/t3code#6092 * @AaronAbuUsama made their first contribution in pingdotgg/t3code#5127 * @0bkevin made their first contribution in pingdotgg/t3code#5379 * @shubhu121 made their first contribution in pingdotgg/t3code#4899 * @Zeus-Deus made their first contribution in pingdotgg/t3code#4986 * @husseinraoouf made their first contribution in pingdotgg/t3code#5091 * @jonocodes made their first contribution in pingdotgg/t3code#4242 * @mahdibm-dev made their first contribution in pingdotgg/t3code#4197 * @NgoQuocViet2001 made their first contribution in pingdotgg/t3code#3929 * @inayayousfi made their first contribution in pingdotgg/t3code#5989 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260815.1101...v0.0.34-nightly.20260815.1102 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260815.1102
What Changed
Shortcut matching only falls back to the physical
KeyA-KeyZposition when the layout-derived key is not itself a Latin letter. Two regression tests cover a non-Latin layout (still matched by position) and a remapped Latin layout (matched by layout output only).Why
resolveEventKeysaccepted both the layout key and the physical code for every keypress. On a remapped Latin layout one physical key then triggered shortcuts for two different letters at once: with a layout where physical D types "a", amod+Dbinding fires onmod+Aand the user can no longer select all text.The physical fallback exists for a real reason (Cyrillic and other non-Latin layouts, plus Option-modified symbols on macOS, produce keys that ASCII-defined shortcuts can never match), so it stays for exactly those cases: when
event.keyis not a Latin letter. When the layout already types Latin letters it speaks the shortcut vocabulary and is trusted alone.Fixes #4434
Testing
vp test run apps/web/src/keybindings.test.tspasses (43/43), including the existing Option-modifiedKeyBcase and the two new layout testspnpm typecheckin apps/web cleanvp linton changed files cleanChecklist
Note
Low Risk
Localized change to shortcut resolution with targeted tests; behavior shift only affects remapped Latin layouts where layout and physical labels disagreed.
Overview
Keyboard shortcuts no longer treat physical
KeyA–KeyZposition as an extra match when the layout already types a Latin letter.resolveEventKeysstill falls back toevent.codefor non-Latin output (e.g. Cyrillic) and macOS Option symbols, but remapped Latin layouts (physical D typinga) only match on the layout character—somod+Dno longer fires onmod+Aand system shortcuts like select-all are not shadowed.Two tests cover Cyrillic-on-physical-D still resolving
diff.toggle, and remapped Latin keys matching by layout output only.Reviewed by Cursor Bugbot for commit 85645a8. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Limit physical key code fallback in
resolveEventKeysto non-Latin layout outputPreviously,
resolveEventKeysalways added the physical letter derived fromevent.codeas a fallback candidate, which caused shortcuts to fire incorrectly when the keyboard layout produced a different Latin letter than the physical key label (e.g. key'a'on a key with codeKeyDwould match a binding for'd').Macroscope summarized 85645a8.