diff --git a/src/components/Chat.tsx b/src/components/Chat.tsx index eb01566..c0c670a 100644 --- a/src/components/Chat.tsx +++ b/src/components/Chat.tsx @@ -164,15 +164,24 @@ export function Chat({ projectPath, onCloseProject }: ChatProps) { }; const clearSession = () => { + // Store current state in case we need to debug + console.log("clearSession called, messages count:", messages.length); + const confirmed = window.confirm( "Are you sure? This will clear all messages and reset the conversation context.", ); - if (confirmed) { + + console.log("User confirmed:", confirmed); + + if (confirmed === true) { + console.log("Clearing session..."); setMessages([]); setStreamingContent(""); setLoading(false); // TODO: Add backend call to clear context when implemented // invoke("clear_session").catch(console.error); + } else { + console.log("User cancelled, keeping messages"); } };