Add configurable global hotkeys (#1305)

This commit is contained in:
ZacharyZcR
2026-08-24 01:10:19 +08:00
committed by GitHub
parent 9ee50d624a
commit cad7520c9f
7 changed files with 121 additions and 1 deletions
@@ -4,6 +4,9 @@ const VALID_ACTION_TYPES = [
"sendControlCode",
"sendText",
"runSnippet",
"nextTab",
"previousTab",
"openCommandPalette",
];
export function isValidKeyCombo(combo: unknown): boolean {
@@ -36,6 +36,13 @@ describe("isValidKeybindingAction", () => {
expect(isValidKeybindingAction({ type: "paste" })).toBe(true);
});
it.each(["nextTab", "previousTab", "openCommandPalette"])(
"accepts the global %s action",
(type) => {
expect(isValidKeybindingAction({ type })).toBe(true);
},
);
it("rejects an unknown action type", () => {
expect(isValidKeybindingAction({ type: "explode" })).toBe(false);
});