story-kit: accept 145_story_persist_chat_history_to_localstorage_across_rebuilds

This commit is contained in:
Dave
2026-02-24 17:03:04 +00:00
parent aef022c74c
commit 6f7338dfdb
5 changed files with 324 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
import type { PipelineState } from "../api/client";
import { api, ChatWebSocket } from "../api/client";
import { useChatHistory } from "../hooks/useChatHistory";
import type { Message, ProviderConfig, ToolCall } from "../types";
import { AgentPanel } from "./AgentPanel";
import { ChatHeader } from "./ChatHeader";
@@ -55,7 +56,7 @@ interface ChatProps {
}
export function Chat({ projectPath, onCloseProject }: ChatProps) {
const [messages, setMessages] = useState<Message[]>([]);
const { messages, setMessages, clearMessages } = useChatHistory(projectPath);
const [input, setInput] = useState("");
const [loading, setLoading] = useState(false);
const [model, setModel] = useState("llama3.1");
@@ -458,7 +459,7 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) {
console.error("Failed to cancel chat:", e);
}
setMessages([]);
clearMessages();
setStreamingContent("");
setLoading(false);
setActivityStatus(null);