From d9769d1c12c13b27b171897af7f751a418b19074 Mon Sep 17 00:00:00 2001 From: ANIRUDDHA ADAK Date: Sun, 6 Sep 2026 08:43:43 +0530 Subject: [PATCH] fix(ai-panels): clear restored history transcript on New chat (fixes #195) (#209) * fix(ai-panels): clear restored history transcript on New chat (fixes #195) * ci: retrigger checks after prosemirror teardown flake --------- Co-authored-by: Aniruddha Adak Co-authored-by: merrick-2002 --- apps/docs/src/renderer/ai/AiPanel.tsx | 5 +- .../tests/ai-new-chat-clears-history.test.ts | 117 ++++++++++++++++++ apps/slides/src/renderer/ai/AiPanel.tsx | 9 +- 3 files changed, 125 insertions(+), 6 deletions(-) create mode 100644 apps/docs/tests/ai-new-chat-clears-history.test.ts diff --git a/apps/docs/src/renderer/ai/AiPanel.tsx b/apps/docs/src/renderer/ai/AiPanel.tsx index 72c794e..896df13 100644 --- a/apps/docs/src/renderer/ai/AiPanel.tsx +++ b/apps/docs/src/renderer/ai/AiPanel.tsx @@ -874,6 +874,9 @@ export function AiPanel({ loopRef.current?.reset() setBusy(false) setChat([]) + // Restored history is painted above the live turn: without this the + // previous conversation survives "New chat" on screen (#195). + setHistoricChat([]) sentAttachmentsRef.current = [] inputRef.current?.focus() } @@ -1033,7 +1036,7 @@ export function AiPanel({ {t('aiPanelTitle')}
- {chat.length > 0 && ( + {(chat.length > 0 || historicChat.length > 0) && (