The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 21:45 UTC
fix(web): Mod+B bolds on non-Latin layouts (#13409)
ValeraZSD committed
Sep 26, 2026 at 06:14 UTC
5d707bb71de19eb0eb6fe4688602ee853aec2e3c
2 files changed
+15
-1
apps/web/src/keybindings.test.ts
+14
@@ -1076,6 +1076,20 @@ describe("isRichTextBoldShortcut", () => {
1076
assert.isTrue(isRichTextBoldShortcut(event({ key: "B", ctrlKey: true })));
1077
});
1078
1079
+ it("matches the B key on non-Latin layouts, like the sidebar toggle does", () => {
1080
+ const cyrillicB = event({ key: "и", code: "KeyB", ctrlKey: true });
1081
+ assert.isTrue(isRichTextBoldShortcut(cyrillicB));
1082
+ assert.strictEqual(
1083
+ resolveShortcutCommand(cyrillicB, DEFAULT_BINDINGS, { platform: "Win32" }),
1084
+ "sidebar.toggle",
1085
+ );
1086
+ });
1087
+
1088
+ it("follows the letter a Latin layout types, not the physical key", () => {
1089
+ assert.isFalse(isRichTextBoldShortcut(event({ key: "x", code: "KeyB", ctrlKey: true })));
1090
+ assert.isTrue(isRichTextBoldShortcut(event({ key: "b", code: "KeyN", ctrlKey: true })));
1091
+ });
1092
+
1093
it("ignores shifted, alted, bare, and non-keydown presses", () => {
1094
assert.isFalse(isRichTextBoldShortcut(event({ key: "b", metaKey: true, shiftKey: true })));
1095
assert.isFalse(isRichTextBoldShortcut(event({ key: "b", metaKey: true, altKey: true })));
apps/web/src/keybindings.ts
+1
-1
@@ -425,7 +425,7 @@ export function isRichTextBoldShortcut(event: ShortcutEventLike): boolean {
425
return false;
426
}
427
return (
428
- event.key.toLowerCase() === "b" &&
428
+ resolveEventKeys(event).has("b") &&
429
(event.metaKey || event.ctrlKey) &&
430
!event.altKey &&
431
!event.shiftKey