feat: expand OpenCode slash command parity #302

Merged
dries merged 11 commits from feat/slash-command-parity into main 2026-07-12 10:10:43 +02:00
Owner

Summary

  • add /details, /help, /thinking, /export, /sessions, /share, /agents, /copy, /skills, and /variants
  • reuse existing agent, reasoning, session-switcher, and transcript paths
  • keep each ticket in its own commit (#288, #289, #290, #291, #292, #294, #295, #296, #299, #300)

Testing

  • make test
  • make lint
  • 1,525 frontend tests pass

Closes #288
Closes #289
Closes #290
Closes #291
Closes #292
Closes #294
Closes #295
Closes #296
Closes #299
Closes #300

## Summary - add /details, /help, /thinking, /export, /sessions, /share, /agents, /copy, /skills, and /variants - reuse existing agent, reasoning, session-switcher, and transcript paths - keep each ticket in its own commit (#288, #289, #290, #291, #292, #294, #295, #296, #299, #300) ## Testing - make test - make lint - 1,525 frontend tests pass Closes #288 Closes #289 Closes #290 Closes #291 Closes #292 Closes #294 Closes #295 Closes #296 Closes #299 Closes #300
Add a display-only /thinking slash command that shows/hides assistant
reasoning blocks in the thread view, matching OpenCode's TUI semantics
(it does not enable/disable model reasoning). The toggle is persisted in
useUiStore (showReasoning, localStorage) and threaded through
convertMessages so reasoning parts are dropped from rendered content
when hidden. Bare /thinking flips the state; /thinking on|off sets it.

Reasoning parts already surface in the part stream (convertMessages
'reasoning' case), so no db/part extraction change was needed.
Add /sessions (aliases /resume, /continue) to BUILTIN_COMMANDS and
handle them in useSessionActions.handleCommand as a thin shim onto the
existing command palette, whose default mode is the session switcher.
No backend, no new picker.
Add a /share built-in slash command that copies this ocman instance's
own session URL (window.location.origin + /session/<id>) to the
clipboard, rather than publishing to OpenCode's cloud share service.
Using the browser origin honours the actual bind address / reverse
proxy; the toast surfaces the local-reachability caveat.

Extract the duplicated copyToClipboard helper into lib/clipboard.ts and
reuse it in ShareExportMenu, SharingSettings, and the new handler.
Add a client-side /copy command that serializes the session's
messages/parts to a Markdown transcript and writes it to the clipboard,
with a success/error toast. The transcript formatter (lib/transcript.ts)
is sink-agnostic so #291 (/export) can share it. Clipboard write uses
the async Clipboard API with an execCommand fallback for non-secure
contexts.
Skills are OpenCode slash commands with source == "skill" (from GET
/command). Add a /skills built-in that opens a picker listing those
commands; selecting one prefills /<skill> in the composer input without
sending, matching OpenCode's DialogSkill.

Carry the /command "source" field through SlashCommandEntry so the
frontend can distinguish skills from regular commands and MCP tools.
Add a /variants slash command that reuses the existing ReasoningPicker
and selectedReasoning wiring to switch the current model's reasoning
variant. Mirroring OpenCode, the command is hidden from the slash menu
when the effective model exposes no variants.
test(frontend): reconcile slash command fixtures
All checks were successful
CI / Build Desktop (macOS arm64) (pull_request) Successful in 1m47s
CI / Frontend (pull_request) Successful in 5m33s
CI / Backend (pull_request) Successful in 6m0s
CI / Coverage Ratchet (pull_request) Successful in 7m17s
CI / Build (pull_request) Successful in 4m39s
CI / Playwright E2E (pull_request) Successful in 7m58s
CI / Semantic Tag (pull_request) Has been skipped
d8f2fc4c44

Coverage ratchet: pass

Suite Baseline This PR Δ
go 72.40% 72.40% +0.00
frontend 62.39% 62.70% +0.31

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | go | 72.40% | 72.40% | +0.00 | ✅ | | frontend | 62.39% | 62.70% | +0.31 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
dries merged commit 26698d7b99 into main 2026-07-12 10:10:43 +02:00
Sign in to join this conversation.
No description provided.