Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): record the layout character in the keybinding editor #15972

Mergedmacodev00(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/15972/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 96 additions and 4 deletions (loading 2).

x
0 of 5 viewed, 5 left
71 additions and 1 deletionapps/web/src/components/settings/KeybindingsSettings.logic.test.tsModified
View file
@@ -1,10 +1,13 @@
-import { describe, expect, it } from "vite-plus/test";
+import { assert, describe, expect, it } from "vite-plus/test";
import type { ResolvedKeybindingsConfig } from "@t3tools/contracts";
import {
compileResolvedKeybindingsConfig,
DEFAULT_RESOLVED_KEYBINDINGS,
+ parseKeybindingShortcut,
} from "@t3tools/shared/keybindings";
​
+import { resolveShortcutCommand } from "../../keybindings";
+​
import {
buildKeybindingRows,
buildKeybindingCommandOptions,
@@ -254,6 +257,73 @@
).toBe(expected);
});
​
+ it("records layout punctuation while preserving physical Alt shortcuts; saved bindings still trigger", () => {
+ for (const { key, code, altKey = false, shiftKey, expected, defaultInput } of [
+ { key: "#", code: "Backslash", shiftKey: false, expected: "#", defaultInput: "\\" },
+ {
+ key: "'",
+ code: "Backslash",
+ shiftKey: true,
+ expected: "shift+'",
+ defaultInput: "shift+\\",
+ },
+ {