feat(plugins): the command palette leaves the core for the command-palette plugin — preloaded modals, runCommand / places / conversations #19

Closed
gabrielvidal wants to merge 0 commits from command-palette-plugin into main
pull from: command-palette-plugin
Owner

Summary

The ⌘K command palette leaves the core for a live plugin, command-palette (ai-agent-plugins, paired PR). It is the keyboard-shortcuts plugin's second optional peer: ⌘K is bound only while the palette is on. The core keeps the data the palette lists and the commands it runs, exposed through new frame bridges. It also gains a generic preloaded modal (ui.slots[].preload), so a plugin modal opens at once. These are Gabriel's picks in form command-palette-as-a-plugin_pwa0w9: ⌘K through the keyboard plugin only, the same entries as today, conversations from the app's loaded list, preloaded, every guest, its own PR pair.

Stacked on #18 (keyboard shortcuts), which is itself stacked on #14 and #17. Merge it after #18.

Key changes

  • ui.slots[].preload: true (app.modal only): PluginWarmModals loads the frame hidden about 2.5 s after start, once the app is idle, and keeps it.
    • Opening only shows it. Each opening is an update {open, seq, init}, each closing {open: false}.
    • It closes on modal.close(), Esc outside the frame, and the scrim.
    • PluginModalHost leaves these slots to it.
  • Bridges (PluginSandboxFrame):
    • commands() rows gain available (something answers it now), keys and current (the profile on screen);
    • commands() also lists the plugin modals the keymap binds, e.g. the cheat sheet, under their slot's name;
    • runCommand(id) runs an available command (or opens such a modal) after closing the palette;
    • places() returns sections, sub-pages, every Settings page and row this person's role opens (plugin Settings pages included), and Add machine;
    • conversations() returns the loaded list in the profile on screen (business/keyboard/appIndex.ts).
  • Key layer: over a plugin modal only that modal's own command acts, so ⌘K closes the palette and ? the cheat sheet. The data-kb-layer special case is gone.
  • Removed: CommandPalette.tsx (+ test), KeyCaps.tsx, business/keyboard/lazy.tsx, the palette command and useKeyboardUi.
  • Docs: CLAUDE.md and docs/plugins.md (preload, the new bridges).

Key decisions

  • The preloaded frame gets its own fixed layer, not the app's Modal. An iframe reloads when it moves in the DOM, so a warm frame can't be re-parented into a dialog.
  • The data stays core, served on demand. Places need the role's Settings registry and the plugins' pages. Conversations are the app's already-loaded list, which is instant and needs no hub call (Gabriel's pick). Nothing is computed until a frame asks.
  • runCommand closes the palette's modal before running, on the next frame, so a focus the command takes (New conversation) stays taken.

Changelog

  • Changed: the command palette (⌘K) is now the Command palette plugin's, and it opens at once.
  • Added: the palette offers the keyboard cheat sheet again ("Keyboard shortcuts").

Test notes

  • Backend: test_plugin_keymap.py adds the preload validation (PreloadSlotTest). It passes, as do the plugin modules.
  • Frontend: tsc is clean. vitest passes except the 3 failures that also fail on main; reachability.test is flaky (it passed on rerun).
  • Live local hub (all three plugins seeded, puppeteer):
    • Ctrl+K showed the preloaded palette at once;
    • "keyb" found Keyboard (Settings › You) and Keyboard shortcuts (the cheat sheet);
    • a second Ctrl+K closed it;
    • there were no console errors.
  • Not deployed from the EVOX2. Deploy from the Homelab after #18, with the plugins repo pulled first (the palette is seed: true).

Screenshots

04-palette.png
05-palette-query.png

## Summary The ⌘K command palette leaves the core for a live plugin, **`command-palette`** (ai-agent-plugins, paired PR). It is the keyboard-shortcuts plugin's second optional peer: ⌘K is bound only while the palette is on. The core keeps the data the palette lists and the commands it runs, exposed through new frame bridges. It also gains a generic **preloaded modal** (`ui.slots[].preload`), so a plugin modal opens at once. These are Gabriel's picks in form `command-palette-as-a-plugin_pwa0w9`: ⌘K through the keyboard plugin only, the same entries as today, conversations from the app's loaded list, preloaded, every guest, its own PR pair. **Stacked on #18** (keyboard shortcuts), which is itself stacked on #14 and #17. Merge it after #18. ## Key changes - **`ui.slots[].preload: true`** (`app.modal` only): `PluginWarmModals` loads the frame hidden about 2.5 s after start, once the app is idle, and keeps it. - Opening only shows it. Each opening is an update `{open, seq, init}`, each closing `{open: false}`. - It closes on `modal.close()`, Esc outside the frame, and the scrim. - `PluginModalHost` leaves these slots to it. - **Bridges** (`PluginSandboxFrame`): - `commands()` rows gain `available` (something answers it now), `keys` and `current` (the profile on screen); - `commands()` also lists the plugin modals the keymap binds, e.g. the cheat sheet, under their slot's name; - `runCommand(id)` runs an available command (or opens such a modal) after closing the palette; - `places()` returns sections, sub-pages, every Settings page and row this person's role opens (plugin Settings pages included), and Add machine; - `conversations()` returns the loaded list in the profile on screen (`business/keyboard/appIndex.ts`). - **Key layer:** over a plugin modal only that modal's own command acts, so ⌘K closes the palette and `?` the cheat sheet. The `data-kb-layer` special case is gone. - **Removed:** `CommandPalette.tsx` (+ test), `KeyCaps.tsx`, `business/keyboard/lazy.tsx`, the `palette` command and `useKeyboardUi`. - **Docs:** `CLAUDE.md` and `docs/plugins.md` (preload, the new bridges). ## Key decisions - **The preloaded frame gets its own fixed layer, not the app's `Modal`.** An iframe reloads when it moves in the DOM, so a warm frame can't be re-parented into a dialog. - **The data stays core, served on demand.** Places need the role's Settings registry and the plugins' pages. Conversations are the app's already-loaded list, which is instant and needs no hub call (Gabriel's pick). Nothing is computed until a frame asks. - **`runCommand` closes the palette's modal before running,** on the next frame, so a focus the command takes (New conversation) stays taken. ## Changelog - Changed: the command palette (⌘K) is now the Command palette plugin's, and it opens at once. - Added: the palette offers the keyboard cheat sheet again ("Keyboard shortcuts"). ## Test notes - **Backend:** `test_plugin_keymap.py` adds the `preload` validation (`PreloadSlotTest`). It passes, as do the plugin modules. - **Frontend:** `tsc` is clean. `vitest` passes except the 3 failures that also fail on main; `reachability.test` is flaky (it passed on rerun). - **Live local hub** (all three plugins seeded, puppeteer): - Ctrl+K showed the preloaded palette at once; - "keyb" found *Keyboard* (Settings › You) and *Keyboard shortcuts* (the cheat sheet); - a second Ctrl+K closed it; - there were no console errors. - **Not deployed from the EVOX2.** Deploy from the Homelab after #18, with the plugins repo pulled first (the palette is `seed: true`). ## Screenshots ![04-palette.png](https://git.gabvdl.xyz/attachments/594f3028-c7a5-4aa5-87b7-5182f83cd9f2) ![05-palette-query.png](https://git.gabvdl.xyz/attachments/90937ef7-eec7-4a09-925f-f59c5f2d9311)
gabrielvidal self-assigned this 2026-11-27 01:18:01 +01:00
gabrielvidal added 5 commits 2026-11-27 01:18:01 +01:00
Which keys run which command is now a live plugin's (`keyboard-shortcuts`,
ai-agent-plugins): the defaults, each person's own bindings, the on/off
switch, Settings → Keyboard (a nav "settings" page) and the cheat sheet (an
app.modal slot). The core keeps what a sandboxed frame can't do: the one
keydown listener, the commands and their handlers. No plugin, no shortcuts.

- provides `app.keymap` → GET /api/plugins/keymap (plugins/keymap.py):
  the provider run as the caller, sanitized, cached; dropped on any plugin
  change and after a write of the provider (SSE `keymap` to that user).
- commands: the app's (lib/keyboard/actions.ts, no defaults any more) plus
  `composer.shortcut:<chip id>` (a named guideline chip) and
  `modal:<pluginId>:<slotId>` (a plugin's modal — the cheat sheet).
- `optionalRequires`: optional peers — no install/enable checks, their
  exports and plugin events open while they are on; the info page's
  "Works with" row. prompt-shortcuts is the keyboard plugin's.
- frame bridges `commands()` and `keyChord()`; a frame's unused keys go on
  to the app's key layer while it has the focus (g h on a plugin page).
- carryover.keyboard: each person's state.keyboard → the plugin's
  keymap.json, once.
- the core Keyboard page, CheatSheet and settings.keyboard are gone;
  /settings/keyboard redirects to the plugin's page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gabriel's form prompt-shortcuts-into-a-plugin_dkhipt: everything moves —
the owner's library, its editor and audience matrix, the guest sharing,
guests' own shortcuts and prefs, the built-in Changes chip. The core keeps
the composer's chips engine, the always-on notify line and the prompt pills.

Platform hooks (generic, reused by the keyboard-shortcuts move):
- ui.pages[].nav "settings" (+ group, after): a Settings entry routed at
  /settings/p/<id>/<page>, listed in the panel, the drawers, the search and
  the palette, right after the entry `after` names (a core id or another
  plugin page's id; else the end of its group).
- top-level "seed": true: an app plugin installed once from the seed dir at
  start, like provider-* / harness-*.
- composer.shortcuts: "position": "first", runners: [] and hidden kept, 64
  chips; a POSTed action of a provider drops its cache and publishes
  composer-shortcuts (guests too) so every composer refetches.
- frame bridges aiAgentPlugin.pickIcon (the app's glyph picker in a host
  dialog) and iconSvg(keys); a page's init.lang.

The move:
- carryover.prompt_shortcuts: the owner's promptShortcuts (audience made
  explicit, a pre-v4 blob folding the old guest list) → library.json, each
  guest's promptShortcuts + shortcutPrefs → their personal.json, once.
- settings v7 drops promptShortcuts / shortcutPrefs; settings/shortcuts.py,
  /api/me sharedShortcuts and guest-defaults promptShortcuts are gone.
- Settings → Skills & agents (/settings/setup) is its own entry;
  /settings/shortcuts forwards to the plugin's page (#skills → setup), saved
  panel and drawer layouts keep the old slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
⌘K's palette is now a live plugin's (`command-palette`, ai-agent-plugins),
the keyboard-shortcuts plugin's second optional peer (⌘K is bound only while
it is on). The core keeps the data it lists and the commands it runs:

- `ui.slots[].preload` (app.modal only): the frame loads hidden once the app
  is idle and stays loaded, so it opens at once (PluginWarmModals — its own
  fixed layer, as an iframe can't move without reloading); each opening is
  an update {open, seq, init}.
- frame bridges: commands() rows gain `available`, `keys`, `current`;
  runCommand(id) runs an available command (closing the modal first);
  places() — sections, Settings pages and rows, plugin pages, Add machine;
  conversations() — the loaded list in the profile on screen.
- over a plugin modal, its own command still acts (⌘K closes the palette).
- the core CommandPalette, KeyCaps, lazy chunk, `palette` command and the
  data-kb-layer logic are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings → Keyboard is a nav "settings" plugin page like Prompt shortcuts:
both core entries are gone, the old keys map onto the plugin pages in saved
layouts, a settings page may say desktopOnly, and the mock lists both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With prompt-shortcuts in: places() reads the plugin Settings entries too, and
commands() / runCommand() take the plugin modals the keymap binds (the
keyboard plugin's cheat sheet, labelled with its slot's name), so the palette
still offers Keyboard shortcuts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner
Merged into `main` as 31754195cf6ca81c9e1097b65269a8c79c56a78d by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/01a21a60-f657-7368-89c8-21d61ac8f575.
gabrielvidal closed this pull request 2026-11-27 01:40:40 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#19