Commit aa0e3c7
authored
Command palette (Cmd+K) (#73)
* EditAgentDialog: self-load messages for title generation
Remove messages prop from EditAgentDialog and AgentHeader usage.
Dialog now fetches its own messages via createResource, keyed by agentId,
so Generate Title works without callers needing to pass message arrays.
Generate button is disabled while messages are loading.
Add tinykeys dependency (global keyboard listener utility, zero deps).
Add tests covering message loading, generate state, and save flow.
* Add command palette (Cmd+K) with global shortcut and agent context
New files:
- CommandPalette.tsx: Corvu Dialog-based palette with Navigation and Agent
sections, substring filtering, arrow key navigation, Enter to run.
Lazy-fetches agent metadata on open. Handles Edit Title, Edit Notes,
Archive, Export for the topmost agent (modal stack aware).
- command-palette-state.ts: Module-level signal for palette open/close,
importable without pulling in component code.
- CommandPalette.test.tsx: Tests for filterActions (empty, whitespace,
substring, case-insensitive, order).
Modified files:
- preferences.ts: Add commandPaletteShortcut preference (default $mod+k)
with localStorage persistence.
- WorkspaceLayout.tsx: Register tinykeys global Cmd+K listener via
createEffect; re-registers on shortcut preference change.
- LiveApp.tsx: Mount <CommandPalette /> alongside SkillLibraryDialog and
AgentSearchDialog.
- Header.tsx: Add KeyBindingInput component and Command Palette Shortcut
section in Settings popover. KeyBindingInput captures key combos from
onKeyDown events and stores them as tinykeys binding strings.
- EditAgentDialog.test.tsx: Format fix for Biome.
* CommandPalette: add Unarchive action for archived agents
Show 'Unarchive Agent' when the active agent is archived (archivedAt is
set) and 'Archive Agent' when it is not. Wire UnarchiveAgentDialog as a
sub-dialog rendered outside the palette shell, matching the Archive pattern.
* AgentSearchDialog: add keyboard navigation for results list
Arrow up/down moves through grouped results (wraps); Enter opens active
result in an agent modal; Cmd/Ctrl+Enter navigates directly to the agent
page and closes the search dialog. Active result highlighted via
aria-current and bg-accent/5 background on the card.
Active index resets to -1 when results change (new search query), so the
highlight is always fresh. Index starts at -1 so mouse-only usage is
unaffected.
Handler placed on Dialog.Content (not the input) to avoid double-firing
via event bubbling through the dialog wrapper.
Add 8 tests covering ArrowDown/Up, Enter, Cmd+Enter, Ctrl+Enter, wrap,
no-selection guard, and reset-on-new-search.
* Header: logo tap opens command palette
Replace the two separate logo divs (desktop icon+text, mobile icon-only)
with a single <button> that calls setIsCommandPaletteOpen(true) on click.
The button wraps the existing BirdhouseIcon and the conditionally-visible
'Birdhouse' text (hidden sm:block), preserving the exact same visual
layout. A single gradientId is used since both breakpoints now share the
same element.
Affordance: hover:opacity-70 / active:opacity-50 gives subtle feedback
without adding visual noise. The logo was not a link previously, so no
navigation behaviour is removed.
* CommandPalette: drop 'Open' prefix from navigation action labels
* CommandPalette: reorder Navigation actions (Agent Search, Skills, New Agent, Workspace Settings)
* KeyBindingInput: extend denylist and fix Alt+key on Mac
- Add Escape, Tab, Enter, Backspace to the eventToBinding denylist so they
can't be accidentally captured as command palette shortcuts
- Use e.code (physical key) instead of e.key when Alt is held on Mac, where
e.key gives the composed character (e.g. Alt+k → '°' instead of 'k');
strip the 'Key' prefix from e.code to produce the correct binding segment
* CommandPalette: show archive action disabled while agent metadata loads
Adds disabled?: boolean to PaletteAction. While agentData() is
undefined (fetch in-flight), Archive Agent is shown greyed out and
unclickable instead of showing the wrong action or hiding entirely.
Once the fetch resolves, the correct Archive/Unarchive action becomes
active. Keyboard Enter and pointer handlers are both guarded against
disabled items.
* Revert "Header: logo tap opens command palette"
This reverts commit 1a00853.
* Header: add Command Palette icon button between Skills and Settings
Icon-only button using the Command icon from lucide-solid, styled
identically to the Skills button (p-2, hover:bg-surface-overlay,
text-text-secondary). Title attribute shows two lines: 'Command Palette'
and the formatted shortcut (e.g. '⌘K'), using the existing
shortcutToDisplay helper so it reflects any user-configured binding.1 parent 5e33f2f commit aa0e3c7
14 files changed
Lines changed: 1063 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
604 | 605 | | |
605 | 606 | | |
606 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
607 | 611 | | |
608 | 612 | | |
609 | 613 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | 485 | | |
487 | 486 | | |
488 | 487 | | |
| |||
Lines changed: 118 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | | - | |
40 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| |||
118 | 127 | | |
119 | 128 | | |
120 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
121 | 236 | | |
Lines changed: 53 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| 164 | + | |
| 165 | + | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
| |||
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
| 177 | + | |
| 178 | + | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
| |||
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
252 | 270 | | |
253 | 271 | | |
254 | 272 | | |
| |||
262 | 280 | | |
263 | 281 | | |
264 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
265 | 311 | | |
266 | 312 | | |
267 | 313 | | |
| |||
285 | 331 | | |
286 | 332 | | |
287 | 333 | | |
| 334 | + | |
288 | 335 | | |
289 | 336 | | |
290 | 337 | | |
| |||
348 | 395 | | |
349 | 396 | | |
350 | 397 | | |
351 | | - | |
| 398 | + | |
352 | 399 | | |
353 | 400 | | |
354 | 401 | | |
355 | 402 | | |
| 403 | + | |
356 | 404 | | |
357 | 405 | | |
358 | 406 | | |
| |||
369 | 417 | | |
370 | 418 | | |
371 | 419 | | |
| 420 | + | |
372 | 421 | | |
373 | 422 | | |
374 | 423 | | |
| |||
377 | 426 | | |
378 | 427 | | |
379 | 428 | | |
380 | | - | |
| 429 | + | |
381 | 430 | | |
382 | 431 | | |
383 | 432 | | |
384 | 433 | | |
385 | 434 | | |
386 | 435 | | |
| 436 | + | |
387 | 437 | | |
388 | 438 | | |
389 | 439 | | |
| |||
0 commit comments