Chat: slash commands + card UI primitives#73
Merged
Merged
Conversation
Adds two cooperating primitives to the shared <ChatSurface>: - Card UI: small JS shape rendered as a colored-border panel above the message list. Supports title, light-markdown body, and optional action buttons. Cards stack newest-on-top with per-card dismiss. - Slash commands: composable registry under blocks/chat-shared/commands/. Detection happens before the message reaches useAgentChat, so offline commands never round-trip to the LLM. Bundled: /help, /clear, /reset, /status, /tools. Both the chat block and the floating admin-bar panel pick this up for free because they both mount ChatSurface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new chat primitives that work together:
Card UI — a small JS primitive for rich inline responses. Cards have a kind, title, markdown body, and an optional row of action buttons. Slash-command responses render as cards in a small stack above the message list. Each card has a dismiss button.
Slash commands — composable primitive, mostly offline. Detection runs before the message hits the LLM. Bundled commands:
/help— list all commands/clear— clear the active conversation/reset— clear conversation + restore the Discover panel/status— site / plugin / agent context/tools— tool inspection (placeholder when no endpoint exists)Both surfaces (the chat block and the floating admin-bar panel) get this behaviour for free because they mount the same
<ChatSurface>.Why
Slash commands give users a fast, predictable way to manage the conversation without LLM round-trips. Cards give the chat surface a way to return structured UI (status panels, action buttons) instead of raw markdown — the foundation for future surfaces like the in-chat setup wizard.
Test plan
/help— a card appears listing the bundled commands./clear— the conversation resets; a success card confirms./asdf(unknown command) — a warning card with the help text appears.🤖 Generated with Claude Code