From 9c83567430368b6e6fe587c15e917f8a587416d8 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 22 May 2026 19:02:26 -0400 Subject: [PATCH] feat(launcher): add Clear Cache and Reload Launcher buttons to controls bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fills in two new buttons added to menu_launcher_controls.svelte: - Clear Cache: removes 'ae_events_loc' from localStorage and deletes the ae_events_db IndexedDB database, then reloads — clears stale launch state without touching downloaded file cache or user prefs (theme/font size). - Reload Launcher: calls native.window_control({ action: 'reload' }) in Electron, falls back to window.location.reload() in browser mode. Also fixes a stray 'lucide-svelte' import (merged Recycle into '@lucide/svelte') and separates cache_status from reset_apps_status so button labels stay correct when multiple actions fire. Co-Authored-By: Claude Sonnet 4.6 --- .../(launcher)/menu_launcher_controls.svelte | 210 +++++++++++------- 1 file changed, 130 insertions(+), 80 deletions(-) diff --git a/src/routes/events/[event_id]/(launcher)/menu_launcher_controls.svelte b/src/routes/events/[event_id]/(launcher)/menu_launcher_controls.svelte index d068f590..adbcfdfe 100644 --- a/src/routes/events/[event_id]/(launcher)/menu_launcher_controls.svelte +++ b/src/routes/events/[event_id]/(launcher)/menu_launcher_controls.svelte @@ -23,7 +23,7 @@ * mode or navigating the config menu. This button is intentionally prominent. */ -import { Moon, Sun, Eye, EyeOff, Columns2, Copy, XCircle } from '@lucide/svelte'; +import { Moon, Sun, Eye, EyeOff, Columns2, Copy, XCircle, Trash, Recycle } from '@lucide/svelte'; import { ae_loc } from '$lib/stores/ae_stores'; import { events_loc } from '$lib/stores/ae_events_stores'; @@ -69,6 +69,7 @@ const DEFAULT_KILL_LIST = [ ]; let reset_apps_status = $state(''); +let cache_status = $state(''); async function handle_reset_apps() { const native_device = ($ae_loc as any).native_device ?? null; @@ -79,77 +80,100 @@ async function handle_reset_apps() { reset_apps_status = 'Done'; setTimeout(() => (reset_apps_status = ''), 3000); } + +async function handle_cache_cleanup() { + cache_status = 'Clearing...'; + try { + localStorage.removeItem('ae_events_loc'); + indexedDB.deleteDatabase('ae_events_db'); + cache_status = 'Done — reloading...'; + setTimeout(() => window.location.reload(), 800); + } catch { + cache_status = 'Error'; + setTimeout(() => (cache_status = ''), 3000); + } +} + +function handle_reload_launcher() { + if ($ae_loc.is_native) { + native.window_control({ action: 'reload' }); + } else { + window.location.reload(); + } +} -
- - {#if $ae_loc.edit_mode} - -
- +
- -
+ +
+ + {#if $ae_loc.edit_mode} + + {/if} +
+ +
+ Tooltip describes the CURRENT state and what pressing will do, so operators know + which way they are switching before they tap. --> - {/if} +
+ +
- - + {#if $ae_loc.edit_mode} + + {/if} -
+ + + + + +
+ +