authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-15 23:06:28-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-15 23:08:37-08:00
log228862ac564e8753e56286ee9936ce8352570768
tree315b31055fdcbc02239cc7a2b141c5b8f92b1394
parentbc22a71f10acf5d56ebc6f7b13966a7fc8fdc504

doc


3 files changed, 7 insertions(+), 21 deletions(-)

KEYBINDINGS.md+3-2
......@@ -23,8 +23,9 @@ See the full schema for more details: [`packages/contracts/src/keybindings.ts`](
2323 { "key": "mod+d", "command": "terminal.split", "when": "terminalFocus" },
2424 { "key": "mod+n", "command": "terminal.new", "when": "terminalFocus" },
2525 { "key": "mod+w", "command": "terminal.close", "when": "terminalFocus" },
26 { "key": "mod+shift+o", "command": "chat.new" },
27 { "key": "mod+shift+n", "command": "chat.newLocal" },
26 { "key": "mod+n", "command": "chat.new", "when": "!terminalFocus" },
27 { "key": "mod+shift+o", "command": "chat.new", "when": "!terminalFocus" },
28 { "key": "mod+shift+n", "command": "chat.newLocal", "when": "!terminalFocus" },
2829 { "key": "mod+o", "command": "editor.openFavorite" }
2930]
3031```
apps/server/src/keybindings.test.ts+1-17
......@@ -1,10 +1,6 @@
11import { assert, describe, it } from "vitest";
22
3import {
4 DEFAULT_KEYBINDINGS,
5 compileResolvedKeybindingRule,
6 parseKeybindingShortcut,
7} from "./keybindings";
3import { compileResolvedKeybindingRule, parseKeybindingShortcut } from "./keybindings";
84
95describe("server keybindings", () => {
106 it("parses shortcuts including plus key", () => {
......@@ -70,16 +66,4 @@ describe("server keybindings", () => {
7066 }),
7167 );
7268 });
73
74 it("defines defaults for terminal.close and chat.newLocal", () => {
75 assert.deepInclude(DEFAULT_KEYBINDINGS, {
76 key: "mod+w",
77 command: "terminal.close",
78 when: "terminalFocus",
79 });
80 assert.deepInclude(DEFAULT_KEYBINDINGS, {
81 key: "mod+shift+n",
82 command: "chat.newLocal",
83 });
84 });
8569});
apps/server/src/keybindings.ts+3-2
......@@ -29,8 +29,9 @@ export const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule> = [
2929 { key: "mod+d", command: "terminal.split", when: "terminalFocus" },
3030 { key: "mod+n", command: "terminal.new", when: "terminalFocus" },
3131 { key: "mod+w", command: "terminal.close", when: "terminalFocus" },
32 { key: "mod+shift+o", command: "chat.new" },
33 { key: "mod+shift+n", command: "chat.newLocal" },
32 { key: "mod+n", command: "chat.new", when: "!terminalFocus" },
33 { key: "mod+shift+o", command: "chat.new", when: "!terminalFocus" },
34 { key: "mod+shift+n", command: "chat.newLocal", when: "!terminalFocus" },
3435 { key: "mod+o", command: "editor.openFavorite" },
3536];
3637