story-kit: merge 241_story_help_slash_command
This commit is contained in:
@@ -10,6 +10,7 @@ import { AgentPanel } from "./AgentPanel";
|
||||
import { ChatHeader } from "./ChatHeader";
|
||||
import type { ChatInputHandle } from "./ChatInput";
|
||||
import { ChatInput } from "./ChatInput";
|
||||
import { HelpOverlay } from "./HelpOverlay";
|
||||
import { LozengeFlyProvider } from "./LozengeFlyContext";
|
||||
import { MessageItem } from "./MessageItem";
|
||||
import { SideQuestionOverlay } from "./SideQuestionOverlay";
|
||||
@@ -203,6 +204,7 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
response: string;
|
||||
loading: boolean;
|
||||
} | null>(null);
|
||||
const [showHelp, setShowHelp] = useState(false);
|
||||
// Ref so stale WebSocket callbacks can read the current queued messages
|
||||
const queuedMessagesRef = useRef<{ id: string; text: string }[]>([]);
|
||||
const queueIdCounterRef = useRef(0);
|
||||
@@ -475,6 +477,12 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
const sendMessage = async (messageText: string) => {
|
||||
if (!messageText.trim()) return;
|
||||
|
||||
// /help — show available slash commands overlay
|
||||
if (/^\/help\s*$/i.test(messageText)) {
|
||||
setShowHelp(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// /btw <question> — answered from context without disrupting main chat
|
||||
const btwMatch = messageText.match(/^\/btw\s+(.+)/s);
|
||||
if (btwMatch) {
|
||||
@@ -1193,6 +1201,8 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{showHelp && <HelpOverlay onDismiss={() => setShowHelp(false)} />}
|
||||
|
||||
{sideQuestion && (
|
||||
<SideQuestionOverlay
|
||||
question={sideQuestion.question}
|
||||
|
||||
Reference in New Issue
Block a user