From 9b3c242333b56e96639bbff5b9f3cd524d7db42c Mon Sep 17 00:00:00 2001 From: Hikari Date: Sat, 7 Feb 2026 14:24:50 -0800 Subject: [PATCH] feat: add "Clear All Sessions" button to Session History Panel Adds a "Clear All Sessions" button to the Session History Panel that allows users to delete all saved sessions at once to manage disk usage. Features: - Red "Clear All" button with trash icon next to Import button - Automatically disabled when there are no sessions to clear - Confirmation dialog with warning styling shows exact session count - Warning icon and "This action cannot be undone" message - Keyboard support (Escape to cancel) - Uses existing clearAllSessions() backend command Benefits: - Gives users control over disk usage - Prevents unbounded growth of session files - Safety confirmation prevents accidental deletions - Improves performance for users with many sessions Closes: #130 --- src/lib/components/SessionHistoryPanel.svelte | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/lib/components/SessionHistoryPanel.svelte b/src/lib/components/SessionHistoryPanel.svelte index 61a69f6..e674cac 100644 --- a/src/lib/components/SessionHistoryPanel.svelte +++ b/src/lib/components/SessionHistoryPanel.svelte @@ -15,6 +15,7 @@ let showDeleteConfirm = $state(null); let showExportMenu = $state(null); let isImporting = $state(false); + let showClearAllConfirm = $state(false); const sessions = $derived(sessionsStore.sessions); const isLoading = $derived(sessionsStore.isLoading); @@ -121,6 +122,11 @@ } } + async function handleClearAll(): Promise { + await sessionsStore.clearAllSessions(); + showClearAllConfirm = false; + } + function toggleExportMenu(sessionId: string): void { if (showExportMenu === sessionId) { showExportMenu = null; @@ -186,6 +192,22 @@ {isImporting ? "Importing..." : "Import"} + {/if} + + + + + + +{/if} +