Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): Ctrl+Plus zooms in again on German keyboards #14739

Closedevolveperformance(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/14739/headopened View on GitHub

Showing 2 changed files with 58 additions and 1 deletion.

x
0 of 2 viewed, 2 left
48 additions and 0 deletionsapps/web/src/keybindings.test.tsModified
View file
@@ -977,6 +977,54 @@
});
​
+ it("leaves mod plus a zoom character to zoom on layouts that type it elsewhere", () => {
+ const keybindings = compile([
+ { shortcut: modShortcut("]"), command: "navigation.forward" },
+ { shortcut: modShortcut("]", { shiftKey: true }), command: "thread.next" },
+ {
+ shortcut: modShortcut("+"),
+ command: "preview.zoomIn",
+ whenAst: whenIdentifier("previewFocus"),
+ },
+ ]);
+ // German layouts type "+" on the key US layouts label "]".
+ const germanPlus = event({ key: "+", code: "BracketRight", ctrlKey: true });
+​
+ assert.isNull(resolveShortcutCommand(germanPlus, keybindings, { platform: "Win32" }));
+ assert.strictEqual(
+ resolveShortcutCommand(germanPlus, keybindings, {
+ platform: "Win32",
+ context: { previewFocus: true },
+ }),
+ "preview.zoomIn",
+ );
+ // Shift on that key types "*", which still falls back to the physical "]".
+ assert.strictEqual(
+ resolveShortcutCommand(
+ event({ key: "*", code: "BracketRight", ctrlKey: true, shiftKey: true }),
+ keybindings,