From d4be3f845da70e4159b10d965d4a8b05ba8c6b21 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Wed, 4 Nov 2026 13:50:05 +0100 Subject: [PATCH] feat(themes): confirm uninstalls and restore tab padding Add a confirmation dialog before removing an installed theme, warning that local edits are deleted. Apply content padding to the absolute tab panels so the workshop and library views stay inset from the frame. --- src/screens/Launch.svelte | 90 ++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/src/screens/Launch.svelte b/src/screens/Launch.svelte index 7918ff8..a3500bb 100644 --- a/src/screens/Launch.svelte +++ b/src/screens/Launch.svelte @@ -313,6 +313,8 @@ }; let restoreCandidate = $state<{ theme: Theme; backup: ThemeBackup } | undefined>(undefined); let restoringTheme = $state(false); + let uninstallCandidate = $state(undefined); + let uninstallingTheme = $state(false); let installedReportOpen = $state(false); let installedReportTarget = $state(null); let installedReportLoading = $state(false); @@ -528,6 +530,9 @@ }; const uninstallInstalledTheme = async (theme: Theme) => { + if (uninstallingTheme) return false; + uninstallingTheme = true; + try { const deleteResult = await deleteTheme(theme); if (deleteResult) { @@ -535,18 +540,36 @@ title: 'Theme uninstalled', description: `"${theme.name}" was removed from your library.`, }); - } else { - sileo.error({ - title: 'Could not uninstall theme', - description: 'The theme files could not be removed.', - }); + return true; } + + sileo.error({ + title: 'Could not uninstall theme', + description: 'The theme files could not be removed.', + }); + return false; } catch (err) { console.error(err); sileo.error({ title: 'Could not uninstall theme', description: err instanceof Error ? err.message : String(err), }); + return false; + } finally { + uninstallingTheme = false; + } + }; + + const requestThemeUninstall = (theme: Theme) => { + if (theme.status !== 'installed' || theme.name === 'Default' || uninstallingTheme) return; + uninstallCandidate = theme; + }; + + const confirmThemeUninstall = async () => { + const theme = uninstallCandidate; + if (!theme) return; + if (await uninstallInstalledTheme(theme)) { + uninstallCandidate = undefined; } }; @@ -2404,6 +2427,51 @@ + + +
+ + Uninstall theme? +
+
+ Remove {uninstallCandidate?.name} from your library? This + deletes the local theme files and any unpublished changes. If the theme is published to the Workshop, + that copy is not affected. +
+
+ + +
+
+
+ -
+
{#if activeThemesTab === 'workshop'}
@@ -4249,7 +4317,7 @@
{:else}
@@ -4590,11 +4658,13 @@ {/if} {#if canUninstallTheme} - + {#if canEditTheme || canRestoreTheme || canUpdateTheme || canReportTheme} + + {/if} void uninstallInstalledTheme(theme)} + onclick={() => requestThemeUninstall(theme)} > {#if theme.status === 'deleting'}