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
This commit is contained in:
1 parent
61e9ba4b19
commit
ef4ce2e1ec
8 files changed
+122
-41
No files matched your search
@@ -313,6 +313,8 @@ describe("WebSocket Server", () => {
|
||||
{ key: "mod+j", command: "terminal.toggle" },
|
||||
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
|
||||
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
|
||||
{ key: "mod+shift+o", command: "chat.new" },
|
||||
{ key: "mod+o", command: "editor.openFavorite" },
|
||||
],
|
||||
});
|
||||
});
|
||||
@@ -347,6 +349,8 @@ describe("WebSocket Server", () => {
|
||||
expect(response.result).toEqual({
|
||||
cwd: "/my/workspace",
|
||||
keybindings: [
|
||||
{ key: "mod+shift+o", command: "chat.new" },
|
||||
{ key: "mod+o", command: "editor.openFavorite" },
|
||||
{ key: "cmd+j", command: "terminal.toggle" },
|
||||
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
|
||||
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
|
||||
@@ -386,6 +390,8 @@ describe("WebSocket Server", () => {
|
||||
keybindings: [
|
||||
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
|
||||
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
|
||||
{ key: "mod+shift+o", command: "chat.new" },
|
||||
{ key: "mod+o", command: "editor.openFavorite" },
|
||||
{ key: "mod+j", command: "terminal.toggle" },
|
||||
],
|
||||
});
|
||||
@@ -426,6 +432,8 @@ describe("WebSocket Server", () => {
|
||||
{ key: "mod+j", command: "terminal.toggle" },
|
||||
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
|
||||
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
|
||||
{ key: "mod+shift+o", command: "chat.new" },
|
||||
{ key: "mod+o", command: "editor.openFavorite" },
|
||||
],
|
||||
});
|
||||
expect(
|
||||
@@ -461,6 +469,8 @@ describe("WebSocket Server", () => {
|
||||
{ key: "mod+j", command: "terminal.toggle" },
|
||||
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
|
||||
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
|
||||
{ key: "mod+shift+o", command: "chat.new" },
|
||||
{ key: "mod+o", command: "editor.openFavorite" },
|
||||
],
|
||||
});
|
||||
expect(
|
||||
|
||||
@@ -74,6 +74,8 @@ const DEFAULT_KEYBINDINGS: KeybindingsConfig = [
|
||||
{ key: "mod+j", command: "terminal.toggle" },
|
||||
{ key: "mod+d", command: "terminal.split", when: "terminalFocus" },
|
||||
{ key: "mod+shift+d", command: "terminal.new", when: "terminalFocus" },
|
||||
{ key: "mod+shift+o", command: "chat.new" },
|
||||
{ key: "mod+o", command: "editor.openFavorite" },
|
||||
];
|
||||
|
||||
function mergeWithDefaultKeybindings(custom: KeybindingsConfig): KeybindingsConfig {
|
||||
|
||||
Reference in new issue
Block a user