M4.2: Lutra-own shortcuts for the Changes window
vcs.commit moves from Mod+K (the public default keymap's Commit) to Mod+Alt+Shift+M, and vcs.openChanges from Mod+Alt+G (CodeMirror's go to line in basicSetup, which the global listener would swallow) to Mod+Alt+Shift+G. Both were checked against the public Windows and macOS default keymap pages, Lutra's registered shortcuts and CodeMirror's keys. Tests and docs follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f67f6b9f7c
commit
eb7e6376b7
8 changed files with 14 additions and 13 deletions
|
|
@ -420,15 +420,15 @@ describe("the vcs commands in the main layout", () => {
|
|||
defaultShortcut?: string;
|
||||
menuPath?: string;
|
||||
}[];
|
||||
expect(registered.find((c) => c.id === "vcs.openChanges")).toMatchObject({ defaultShortcut: "Mod+Alt+G", menuPath: "Git/Changes" });
|
||||
expect(registered.find((c) => c.id === "vcs.commit")).toMatchObject({ defaultShortcut: "Mod+K", menuPath: "Git/Commit…" });
|
||||
expect(registered.find((c) => c.id === "vcs.openChanges")).toMatchObject({ defaultShortcut: "Mod+Alt+Shift+G", menuPath: "Git/Changes" });
|
||||
expect(registered.find((c) => c.id === "vcs.commit")).toMatchObject({ defaultShortcut: "Mod+Alt+Shift+M", menuPath: "Git/Commit…" });
|
||||
expect(registered.find((c) => c.id === "vcs.refresh")?.menuPath).toBe("Git/Refresh Changes");
|
||||
});
|
||||
|
||||
it("opens the tab with its shortcut, focuses the box with vcs.commit and refreshes", async () => {
|
||||
const wrapper = await mountLayout();
|
||||
expect(wrapper.find("[data-test=changes]").exists()).toBe(false);
|
||||
window.dispatchEvent(new KeyboardEvent("keydown", { key: "g", code: "KeyG", ctrlKey: true, altKey: true, bubbles: true }));
|
||||
window.dispatchEvent(new KeyboardEvent("keydown", { key: "G", code: "KeyG", ctrlKey: true, altKey: true, shiftKey: true, bubbles: true }));
|
||||
await flushPromises();
|
||||
expect(wrapper.get("[data-test=changes]").isVisible()).toBe(true);
|
||||
const commands = useCommandsStore(pinia);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue