Skip to content

Commit d1c49ba

Browse files
authored
fix(app): move message navigation off cmd+arrow (#18728)
1 parent 3ea72ae commit d1c49ba

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

packages/app/src/context/command-keybind.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@ describe("command keybind helpers", () => {
3232
expect(matchKeybind(keybinds, new KeyboardEvent("keydown", { key: ",", ctrlKey: true, altKey: true }))).toBe(false)
3333
})
3434

35+
test("matchKeybind supports bracket keys", () => {
36+
const keybinds = parseKeybind("mod+alt+[, mod+alt+]")
37+
const prev = keybinds[0]
38+
const next = keybinds[1]
39+
40+
expect(
41+
matchKeybind(
42+
keybinds,
43+
new KeyboardEvent("keydown", { key: "[", ctrlKey: prev?.ctrl, metaKey: prev?.meta, altKey: true }),
44+
),
45+
).toBe(true)
46+
expect(
47+
matchKeybind(
48+
keybinds,
49+
new KeyboardEvent("keydown", { key: "]", ctrlKey: next?.ctrl, metaKey: next?.meta, altKey: true }),
50+
),
51+
).toBe(true)
52+
})
53+
3554
test("formatKeybind returns human readable output", () => {
3655
const display = formatKeybind("ctrl+alt+arrowup")
3756

packages/app/src/pages/session/use-session-commands.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,15 @@ export const useSessionCommands = (actions: SessionCommandContext) => {
333333
id: "message.previous",
334334
title: language.t("command.message.previous"),
335335
description: language.t("command.message.previous.description"),
336-
keybind: "mod+arrowup",
336+
keybind: "mod+alt+[",
337337
disabled: !params.id,
338338
onSelect: () => navigateMessageByOffset(-1),
339339
}),
340340
sessionCommand({
341341
id: "message.next",
342342
title: language.t("command.message.next"),
343343
description: language.t("command.message.next.description"),
344-
keybind: "mod+arrowdown",
344+
keybind: "mod+alt+]",
345345
disabled: !params.id,
346346
onSelect: () => navigateMessageByOffset(1),
347347
}),

0 commit comments

Comments
 (0)