Skip to content

feat: slash commands in the composer, starting with /clear - #63

Merged
bencode merged 2 commits into
mainfrom
feat/slash-commands
Oct 1, 2026
Merged

bencode merged 2 commits into
mainfrom
feat/slash-commands

Conversation

@bencode

@bencode bencode commented Oct 1, 2026

Copy link
Copy Markdown
Owner

What

Typing / in the chat input opens a command menu above it. The first command is /clear, which starts a new conversation the same way the + button does.

Key (menu open) Action
↑ / ↓ Move the selection
Enter / click Run the command
Tab Complete to /name without running it
Escape Close the menu (before Escape stops a reply)

A /word that matches nothing, or whose menu was closed, is sent as an ordinary message.

Why the command never enters the draft

Each change to the draft is saved right away and moves the conversation to the top of history. If /clear went through the draft, an empty conversation would be saved by its first / and left as an empty entry in history, and an existing conversation would move to the top. Instead, the composer keeps the typed command itself. use-conversation.ts is unchanged, and startNew still skips creating a conversation when the current one is empty.

Extension point

SlashCommand = { name, description, run }; the list is defined in conversation-panel.tsx.

Verification

  • New integration test: after a reply, /cl + Enter opens an empty conversation, the old conversation's draft stays empty, and only one conversation is stored.
  • biome check ., web typecheck, and all web tests pass (331).
  • Checked by hand in the dev app: the menu shows, Tab completes, Escape closes, and Enter clears without saving an empty conversation.

Typing / opens a command menu above the input. A typed command stays in
the composer and never reaches the saved draft, so /clear does not leave
the command in the old conversation or save an empty one.
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