From: Thomas Jarosch Date: Mon, 15 Dec 2025 10:29:29 +0000 (+0100) Subject: webui: add "delete all conversations" button to import/export tab (#17444) X-Git-Tag: upstream/0.0.7446~38 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=e73d548659db9297c23a77359776481690b82741;p=pkg%2Fggml%2Fsources%2Fllama.cpp webui: add "delete all conversations" button to import/export tab (#17444) * webui: add "delete all conversations" button to import/export tab - Add 'Delete all conversations' functionality with confirmation dialog - Add Trash icon and destructive styling for clear visual indication - Redirects to "?new_chat=true#/" by using conversationsStore.deleteAll() * chore: update webui build output --- diff --git a/tools/server/public/index.html.gz b/tools/server/public/index.html.gz index 3fd631b7..1834d1d9 100644 Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte index 7edce48b..1c8b4110 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte @@ -1,9 +1,11 @@
@@ -229,6 +264,25 @@
{/if} + +
+

Delete All Conversations

+ +

+ Permanently delete all conversations and their messages. This action cannot be undone. + Consider exporting your conversations first if you want to keep a backup. +

+ + +
@@ -249,3 +303,15 @@ onCancel={() => (showImportDialog = false)} onConfirm={handleImportConfirm} /> + + diff --git a/tools/server/webui/src/lib/stores/conversations.svelte.ts b/tools/server/webui/src/lib/stores/conversations.svelte.ts index f7665619..3300eb31 100644 --- a/tools/server/webui/src/lib/stores/conversations.svelte.ts +++ b/tools/server/webui/src/lib/stores/conversations.svelte.ts @@ -385,8 +385,7 @@ class ConversationsStore { this.conversations = this.conversations.filter((c) => c.id !== convId); if (this.activeConversation?.id === convId) { - this.activeConversation = null; - this.activeMessages = []; + this.clearActiveConversation(); await goto(`?new_chat=true#/`); } } catch (error) { @@ -394,6 +393,29 @@ class ConversationsStore { } } + /** + * Deletes all conversations and their messages + */ + async deleteAll(): Promise { + try { + const allConversations = await DatabaseService.getAllConversations(); + + for (const conv of allConversations) { + await DatabaseService.deleteConversation(conv.id); + } + + this.clearActiveConversation(); + this.conversations = []; + + toast.success('All conversations deleted'); + + await goto(`?new_chat=true#/`); + } catch (error) { + console.error('Failed to delete all conversations:', error); + toast.error('Failed to delete conversations'); + } + } + // ───────────────────────────────────────────────────────────────────────────── // Import/Export // ─────────────────────────────────────────────────────────────────────────────