import * as React from "react"; const { useEffect, useRef } = React; interface SlashCommand { name: string; description: string; } const SLASH_COMMANDS: SlashCommand[] = [ { name: "/help", description: "Show this list of available slash commands.", }, { name: "/status", description: "Show pipeline status and agent availability. `/status ` shows a story triage dump.", }, { name: "/assign ", description: "Pre-assign a model to a story (e.g. `/assign 42 opus`).", }, { name: "/start ", description: "Start a coder on a story. Optionally specify a model: `/start opus`.", }, { name: "/show ", description: "Display the full text of a work item.", }, { name: "/move ", description: "Move a work item to a pipeline stage (backlog, current, qa, merge, done).", }, { name: "/delete ", description: "Remove a work item from the pipeline and stop any running agent.", }, { name: "/cost", description: "Show token spend: 24h total, top stories, breakdown by agent type, and all-time total.", }, { name: "/git", description: "Show git status: branch, uncommitted changes, and ahead/behind remote.", }, { name: "/overview ", description: "Show the implementation summary for a merged story.", }, { name: "/rebuild", description: "Rebuild the server binary and restart.", }, { name: "/reset", description: "Clear the current Claude Code session and start fresh (messages and session ID are cleared locally).", }, { name: "/btw ", description: "Ask a side question using the current conversation as context. The question and answer are not added to the conversation history.", }, ]; interface HelpOverlayProps { onDismiss: () => void; } /** * Dismissible overlay that lists all available slash commands. * Dismiss with Escape, Enter, or Space. */ export function HelpOverlay({ onDismiss }: HelpOverlayProps) { const dismissRef = useRef(onDismiss); dismissRef.current = onDismiss; useEffect(() => { const handler = (e: KeyboardEvent) => { if (e.key === "Escape" || e.key === "Enter" || e.key === " ") { e.preventDefault(); dismissRef.current(); } }; window.addEventListener("keydown", handler); return () => window.removeEventListener("keydown", handler); }, []); return ( // biome-ignore lint/a11y/noStaticElementInteractions: backdrop dismiss is supplementary; keyboard handled via window keydown // biome-ignore lint/a11y/useKeyWithClickEvents: keyboard dismiss handled via window keydown listener
{/* biome-ignore lint/a11y/useKeyWithClickEvents: stop-propagation only; no real interaction */} {/* biome-ignore lint/a11y/noStaticElementInteractions: stop-propagation only; no real interaction */}
e.stopPropagation()} style={{ background: "#2f2f2f", border: "1px solid #444", borderRadius: "12px", padding: "24px", maxWidth: "560px", width: "90vw", display: "flex", flexDirection: "column", gap: "16px", boxShadow: "0 8px 32px rgba(0,0,0,0.5)", }} > {/* Header */}
Slash Commands
{/* Command list */}
{SLASH_COMMANDS.map((cmd) => (
{cmd.name} {cmd.description}
))}
{/* Footer hint */}
Press Escape, Enter, or Space to dismiss
); }