Skip to content

feat(desktop): slash commands in the composer - #219

Merged
oratis merged 1 commit into
mainfrom
feat/desktop-slash-palette
Aug 3, 2026
Merged

feat(desktop): slash commands in the composer#219
oratis merged 1 commit into
mainfrom
feat/desktop-slash-palette

Conversation

@oratis

@oratis oratis commented Aug 3, 2026

Copy link
Copy Markdown
Owner

The desktop had zero slash commands. PlusMenu's "Slash command" item inserted a literal / with the description "palette lands in v0.2" — we are at 0.2.0. Anything typed with a leading slash was sent to the model as prose. Finding C in docs/THREE_WAY_REVIEW.md.

What changes

Typing / opens a filtered palette above the composer — ↑↓ to move, Tab or Enter to complete, Esc to dismiss, click to pick. A complete command runs locally instead of starting a turn.

Scope, and why it is not all 38

The CLI's commands run against a SessionContext full of node:fs, a provider and a session manager — none of which exist in a WebView. Stubbing them would recreate exactly the problem this PR fixes, so the catalogue is only what the renderer can genuinely serve:

  • client-side: /help /clear /model /mode /effort /cost /context
  • over an existing protocol method: /diff (workspace/diff)
  • routing to screens the app already has: /settings /permissions /mcp /plugins /skills /about

/help ends by saying host-side commands (/init, /compact, /rewind, /export, /todos) are CLI-only — rather than listing them as if they work. Carrying them properly needs a protocol method to execute a command host-side; that is the follow-up, not a stub here.

Effort and AgentMode move out of Repl.tsx and next to the commands that validate them, so the palette and the composer dropdowns cannot drift apart.

One bug found by looking

Multi-line command output rendered as a wrapped paragraph: the system-message renderer centres text at 11.5px with no whitespace preservation — fine for "Resumed session", wrong for a help table. Multi-line system messages now render as a left-aligned monospace block. The unit tests were green through this; the screenshot was not.

Verification

Driven through the preview-app.html fixture in a real browser: palette opens and filters, /help renders aligned, /mode plan flips the header pill to plan mode and the composer dropdown to ◐ Plan mode, and /diff against the fixture (which does not declare the workspaceDiff capability) surfaces Could not read the working tree: The app-server does not support workspace diff — the honest failure path.

21 unit tests over the pure parse/filter/format layer, plus a new Playwright case in the CI journey covering palette filtering, arrow-key completion, local execution, unknown commands, and Escape. playwright test → 5 passed. pnpm typecheck · lint · format:check clean; desktop 83 · core 710/16 skipped · cli 175 · server 41 · protocol 24 · vscode 12 · lsp 13 · scripts 21.

🤖 Generated with Claude Code

The desktop had none. The PlusMenu's "Slash command" item inserted a literal
"/" and said "palette lands in v0.2" — we are at 0.2.0. Anything typed with a
leading slash went to the model as prose. Finding C in docs/THREE_WAY_REVIEW.md.

Typing "/" now opens a filtered palette above the composer: ↑↓ to move, Tab or
Enter to complete, Esc to dismiss, click to pick. A complete command runs
locally instead of starting a turn.

The catalogue is deliberately short. The CLI's 38 commands run against a
SessionContext full of node:fs, a provider and a session manager, none of
which exist in a WebView, so this ships only what the renderer can genuinely
serve: /help /clear /model /mode /effort /cost /context, /diff over the
existing workspace/diff protocol method, and the six screens the app already
has (/settings /permissions /mcp /plugins /skills /about). /help says plainly
that host-side commands are CLI-only rather than listing them as if they work.

Effort and AgentMode move next to the commands that validate them, so the
palette and the composer dropdowns cannot drift apart.

Multi-line system output (/help, /diff, /cost) now renders as a left-aligned
monospace block. The existing renderer centred system messages at 11.5px with
no whitespace preservation, which turned the help table into a paragraph —
caught by looking at it, not by the tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oratis
oratis merged commit 93767c7 into main Aug 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant