Skip to content

Commit 934037c

Browse files
binbandithuxcruxeggfriedrice24Noojunojuliusmarminge
authored
feat(web): add extensible command palette (#1103)
Co-authored-by: Hugo Blom <6117705+huxcrux@users.noreply.github.com> Co-authored-by: eggfriedrice <eggfriedricew.g.o@gmail.com> Co-authored-by: Jono Kemball <jono-kemball@idexx.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5467d11 commit 934037c

24 files changed

Lines changed: 2102 additions & 236 deletions

KEYBINDINGS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ 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+k", "command": "commandPalette.toggle", "when": "!terminalFocus" },
2627
{ "key": "mod+n", "command": "chat.new", "when": "!terminalFocus" },
2728
{ "key": "mod+shift+o", "command": "chat.new", "when": "!terminalFocus" },
2829
{ "key": "mod+shift+n", "command": "chat.newLocal", "when": "!terminalFocus" },
@@ -50,6 +51,7 @@ Invalid rules are ignored. Invalid config files are ignored. Warnings are logged
5051
- `terminal.split`: split terminal (in focused terminal context by default)
5152
- `terminal.new`: create new terminal (in focused terminal context by default)
5253
- `terminal.close`: close/kill the focused terminal (in focused terminal context by default)
54+
- `commandPalette.toggle`: open or close the global command palette
5355
- `chat.new`: create a new chat thread preserving the active thread's branch/worktree state
5456
- `chat.newLocal`: create a new chat thread for the active project in a new environment (local/worktree determined by app settings (default `local`))
5557
- `editor.openFavorite`: open current project/worktree in the last-used editor

apps/server/src/keybindings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const DEFAULT_KEYBINDINGS: ReadonlyArray<KeybindingRule> = [
6161
{ key: "mod+n", command: "terminal.new", when: "terminalFocus" },
6262
{ key: "mod+w", command: "terminal.close", when: "terminalFocus" },
6363
{ key: "mod+d", command: "diff.toggle", when: "!terminalFocus" },
64+
{ key: "mod+k", command: "commandPalette.toggle", when: "!terminalFocus" },
6465
{ key: "mod+n", command: "chat.new", when: "!terminalFocus" },
6566
{ key: "mod+shift+o", command: "chat.new", when: "!terminalFocus" },
6667
{ key: "mod+shift+n", command: "chat.newLocal", when: "!terminalFocus" },
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { create } from "zustand";
2+
3+
interface CommandPaletteStore {
4+
open: boolean;
5+
setOpen: (open: boolean) => void;
6+
toggleOpen: () => void;
7+
}
8+
9+
export const useCommandPaletteStore = create<CommandPaletteStore>((set) => ({
10+
open: false,
11+
setOpen: (open) => set({ open }),
12+
toggleOpen: () => set((state) => ({ open: !state.open })),
13+
}));

0 commit comments

Comments
 (0)