story-kit: merge 340_story_web_ui_rebuild_and_restart_button

This commit is contained in:
Dave
2026-03-20 09:08:13 +00:00
parent 0897b36cc1
commit 594114d671
4 changed files with 589 additions and 209 deletions
+5
View File
@@ -223,6 +223,7 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
} | null>(null);
const [showHelp, setShowHelp] = useState(false);
const [serverLogs, setServerLogs] = useState<LogEntry[]>([]);
const [wsConnected, setWsConnected] = useState(false);
// Ref so stale WebSocket callbacks can read the current queued messages
const queuedMessagesRef = useRef<{ id: string; text: string }[]>([]);
const queueIdCounterRef = useRef(0);
@@ -457,6 +458,9 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
onLogEntry: (timestamp, level, message) => {
setServerLogs((prev) => [...prev, { timestamp, level, message }]);
},
onConnected: () => {
setWsConnected(true);
},
});
return () => {
@@ -830,6 +834,7 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
}}
enableTools={enableTools}
onToggleTools={setEnableTools}
wsConnected={wsConnected}
/>
{/* Two-column content area */}