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
313 { key: "mod+j", command: "terminal.toggle" },313 { key: "mod+j", command: "terminal.toggle" },
314 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },314 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
315 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },315 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
316 { key: "mod+shift+o", command: "chat.new" },
317 { key: "mod+o", command: "editor.openFavorite" },
316 ],318 ],
317 });319 });
318 });320 });
@@ -347,6 +349,8 @@ describe("WebSocket Server", () => { · 28 unmodified lines
347 expect(response.result).toEqual({349 expect(response.result).toEqual({
348 cwd: "/my/workspace",350 cwd: "/my/workspace",
349 keybindings: [351 keybindings: [
352 { key: "mod+shift+o", command: "chat.new" },
353 { key: "mod+o", command: "editor.openFavorite" },
350 { key: "cmd+j", command: "terminal.toggle" },354 { key: "cmd+j", command: "terminal.toggle" },
351 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },355 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
352 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },356 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
@@ -386,6 +390,8 @@ describe("WebSocket Server", () => { · 33 unmodified lines
386 keybindings: [390 keybindings: [
387 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },391 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
388 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },392 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
393 { key: "mod+shift+o", command: "chat.new" },
394 { key: "mod+o", command: "editor.openFavorite" },
389 { key: "mod+j", command: "terminal.toggle" },395 { key: "mod+j", command: "terminal.toggle" },
390 ],396 ],
391 });397 });
@@ -426,6 +432,8 @@ describe("WebSocket Server", () => { · 34 unmodified lines
426 { key: "mod+j", command: "terminal.toggle" },432 { key: "mod+j", command: "terminal.toggle" },
427 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },433 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
428 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },434 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
435 { key: "mod+shift+o", command: "chat.new" },
436 { key: "mod+o", command: "editor.openFavorite" },
429 ],437 ],
430 });438 });
431 expect(439 expect(
@@ -461,6 +469,8 @@ describe("WebSocket Server", () => { · 29 unmodified lines
461 { key: "mod+j", command: "terminal.toggle" },469 { key: "mod+j", command: "terminal.toggle" },
462 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },470 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
463 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },471 { key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
472 { key: "mod+shift+o", command: "chat.new" },
473 { key: "mod+o", command: "editor.openFavorite" },
464 ],474 ],
465 });475 });
466 expect(476 expect(