History

Add configurable shortcuts for new chat and open-in-editor

- add `chat.new` and `editor.openFavorite` to keybinding contracts and server defaults - use shared keybinding matching in sidebar/chat view instead of hardcoded Cmd/Ctrl combos - document new commands/defaults and extend server/web keybinding tests

Julius Marminge committed 9 months ago

Commit ef4ce2e1 parent 61e9ba48 files · +122 −41Browse files

Showing the changes to apps/server/src/wsServer.test.ts (1 of 8 files). Show all

Unified · Split

apps/server/src/wsServer.test.ts+10−0
@@ -313,6 +313,8 @@ describe("WebSocket Server", () => { · 312 unmodified lines
313313 { key: "mod+j", command: "terminal.toggle" },
314314 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
315315 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
316+ { key: "mod+shift+o", command: "chat.new" },
317+ { key: "mod+o", command: "editor.openFavorite" },
316318 ],
317319 });
318320 });
@@ -347,6 +349,8 @@ describe("WebSocket Server", () => { · 28 unmodified lines
347349 expect(response.result).toEqual({
348350 cwd: "/my/workspace",
349351 keybindings: [
352+ { key: "mod+shift+o", command: "chat.new" },
353+ { key: "mod+o", command: "editor.openFavorite" },
350354 { key: "cmd+j", command: "terminal.toggle" },
351355 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
352356 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
@@ -386,6 +390,8 @@ describe("WebSocket Server", () => { · 33 unmodified lines
386390 keybindings: [
387391 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
388392 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
393+ { key: "mod+shift+o", command: "chat.new" },
394+ { key: "mod+o", command: "editor.openFavorite" },
389395 { key: "mod+j", command: "terminal.toggle" },
390396 ],
391397 });
@@ -426,6 +432,8 @@ describe("WebSocket Server", () => { · 34 unmodified lines
426432 { key: "mod+j", command: "terminal.toggle" },
427433 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
428434 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
435+ { key: "mod+shift+o", command: "chat.new" },
436+ { key: "mod+o", command: "editor.openFavorite" },
429437 ],
430438 });
431439 expect(
@@ -461,6 +469,8 @@ describe("WebSocket Server", () => { · 29 unmodified lines
461469 { key: "mod+j", command: "terminal.toggle" },
462470 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
463471 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
472+ { key: "mod+shift+o", command: "chat.new" },
473+ { key: "mod+o", command: "editor.openFavorite" },
464474 ],
465475 });
466476 expect(