Add issue-detail g i inbox shortcut

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-04-08 08:27:34 -05:00
parent ede3206423
commit 69ff793c6a
3 changed files with 163 additions and 1 deletions

View file

@ -4,6 +4,7 @@ import { describe, expect, it } from "vitest";
import {
hasBlockingShortcutDialog,
isKeyboardShortcutTextInputTarget,
resolveGoToInboxKeyAction,
resolveInboxQuickArchiveKeyAction,
} from "./keyboardShortcuts";
@ -109,4 +110,49 @@ describe("keyboardShortcuts helpers", () => {
hasOpenDialog: false,
})).toBe("disarm");
});
it("arms go-to-inbox on a clean g press", () => {
const button = document.createElement("button");
expect(resolveGoToInboxKeyAction({
armed: false,
defaultPrevented: false,
key: "g",
metaKey: false,
ctrlKey: false,
altKey: false,
target: button,
hasOpenDialog: false,
})).toBe("arm");
});
it("navigates to inbox on i after g", () => {
const button = document.createElement("button");
expect(resolveGoToInboxKeyAction({
armed: true,
defaultPrevented: false,
key: "i",
metaKey: false,
ctrlKey: false,
altKey: false,
target: button,
hasOpenDialog: false,
})).toBe("navigate");
});
it("disarms go-to-inbox instead of firing from an editor", () => {
const input = document.createElement("textarea");
expect(resolveGoToInboxKeyAction({
armed: true,
defaultPrevented: false,
key: "i",
metaKey: false,
ctrlKey: false,
altKey: false,
target: input,
hasOpenDialog: false,
})).toBe("disarm");
});
});