From 17a0ebe68bba3735fb674f1eaecb377645c68fb9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 8 Sep 2026 16:38:08 +0200 Subject: [PATCH] fix: new-chat confirm uses the site dialog; remove assistant intro paragraph --- public/components/assistant.html | 1 - public/js/clinicalAssistant.js | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/components/assistant.html b/public/components/assistant.html index b3a2a6c..c20dbc5 100644 --- a/public/components/assistant.html +++ b/public/components/assistant.html @@ -1,7 +1,6 @@

AI Clinical Assistant

-

Ask focused clinical questions over indexed Nextcloud books/resources, or ask for a teaching image directly in the chat box.

diff --git a/public/js/clinicalAssistant.js b/public/js/clinicalAssistant.js index 48f2af7..8db3435 100644 --- a/public/js/clinicalAssistant.js +++ b/public/js/clinicalAssistant.js @@ -656,7 +656,20 @@ import { function clearConversation(event) { if (assistantBusy && !activeAssistantRequest) return; - if (event && messages.length && !window.confirm('Start a new chat? Save or download this conversation first if you want to keep it.')) return; + if (event && messages.length) { + // Use the site's standard inline dialog instead of the native confirm(). + if (typeof showConfirm === 'function') { + showConfirm('Start a new chat? Save or download this conversation first if you want to keep it.', function() { + performClearConversation(); + }); + return; + } + if (!window.confirm('Start a new chat? Save or download this conversation first if you want to keep it.')) return; + } + performClearConversation(); + } + + function performClearConversation() { if (activeAssistantRequest) cancelAssistantSearch(); messages = []; attachments = [];