Fix typos, mistake, and from PR 3677 a wrong test

This commit is contained in:
VariableVince
2026-04-22 01:49:32 +02:00
parent 91be76607f
commit c5d8fe69c3
4 changed files with 9 additions and 7 deletions
+2 -1
View File
@@ -384,7 +384,8 @@ export class HelpModal extends BaseModal {
<tr class="hover:bg-white/5 transition-colors">
<td class="py-3 pl-4 border-b border-white/5">
<div class="inline-flex items-center gap-2">
${this.renderKey(keybinds.emojiMenuModifier)}
${this.renderKey("Alt")}
<!-- Listens to e.altKey, either AltLeft or AltRight -->
<span class="text-white/40 font-bold">+</span>
${this.renderKey(keybinds.resetGfx)}
</div>
+2 -1
View File
@@ -90,8 +90,9 @@ export class UserSettingModal extends BaseModal {
const { action, value, prevValue } = e.detail;
let { key } = e.detail;
// TODO: remove after testing
console.info(
"handleKeybindChange recieved value: " + value,
"handleKeybindChange received value: " + value,
", key: " + key,
);
+2 -2
View File
@@ -380,7 +380,7 @@ export function formatKeyForDisplay(value: string): string {
Backslash: "\\",
Shift: "Shift ⇧",
ShiftLeft: "Shift ⇧",
ShiftRight: "Shift",
ShiftRight: "Shift",
Control: "Ctrl",
// "Alt Gr" emits ControlLeft+Alt in Windows on many keyboard layouts and we catch the first code.
// Is undiscernable normally from ControlLeft but user sees "alt gr" on the key so display it too
@@ -389,7 +389,7 @@ export function formatKeyForDisplay(value: string): string {
Alt: Platform.isMac ? "⌥" : "Alt",
AltLeft: Platform.isMac ? "⌥" : "Alt",
AltRight: Platform.isMac ? "⌥" : "Alt",
Metat: Platform.isMac ? "⌘" : "⊞",
Meta: Platform.isMac ? "⌘" : "⊞",
MetaLeft: Platform.isMac ? "⌘" : "⊞", //"⊞" is Windows key, "⌘" is Command key on Mac
MetaRight: Platform.isMac ? "⌘" : "⊞",
Escape: "Esc", // Cannot be bound to action by user, but used as reserved key
+3 -3
View File
@@ -909,11 +909,11 @@ describe("Warship box selection (Shift+drag)", () => {
expect(mockCanvas.style.cursor).toBe("crosshair");
});
test("ShiftRight keydown also sets cursor to crosshair", () => {
test("ShiftRight keydown does not set cursor to crosshair", () => {
// ShiftRight is not the default shiftKey keybind (ShiftLeft is).
// This test verifies the configured shiftKey works, not a hardcoded ShiftRight.
window.dispatchEvent(new KeyboardEvent("keydown", { code: "ShiftLeft" }));
expect(mockCanvas.style.cursor).toBe("crosshair");
window.dispatchEvent(new KeyboardEvent("keydown", { code: "ShiftRight" }));
expect(mockCanvas.style.cursor).not.toBe("crosshair");
});
test("Shift keyup resets cursor when no selection box active", () => {