From d56ed9d7868cbfc0b25807b0a5ddf41ff4f8f9c3 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Wed, 4 Nov 2026 09:54:58 +0100 Subject: [PATCH] feat(themes): polish theme editor, updates, and card motion - Lazy-load the theme editor, workshop, diagnostics, logs, and presence editor. - Check installed themes for newer workshop versions and support updates with backup/restore. - Preserve accordion state for the current editor session and add section icons. - Animate installed and workshop cards on insertion, and fix the duplicate presence idle action. --- src/lib/communityThemes.ts | 5 +- .../theme/CommunityWorkshopView.svelte | 24 +- .../components/theme/ThemeEditorWindow.svelte | 24 +- .../theme/ThemeElementInspector.svelte | 42 +- .../theme/ThemeFilterControls.svelte | 2 + .../theme/ThemeGroupInspector.svelte | 7 +- .../components/theme/ThemeLinkedLogic.svelte | 8 +- src/lib/components/theme/ThemeSection.svelte | 18 +- .../theme/ThemeTextStyleControls.svelte | 3 +- .../theme/ThemeTransformControls.svelte | 1 + .../theme/ThemeVariableDefaults.svelte | 9 +- src/lib/discordPresenceConfig.ts | 4 +- src/lib/themeEditorUiState.ts | 8 + src/lib/themes.ts | 5 +- src/routes/+layout.svelte | 16 +- src/screens/Launch.svelte | 978 +++++++++++------- 16 files changed, 720 insertions(+), 434 deletions(-) create mode 100644 src/lib/themeEditorUiState.ts diff --git a/src/lib/communityThemes.ts b/src/lib/communityThemes.ts index 2169c9f..074498e 100644 --- a/src/lib/communityThemes.ts +++ b/src/lib/communityThemes.ts @@ -951,11 +951,12 @@ export async function reviewCommunityTheme( */ export async function downloadAndInstallCommunityTheme( theme: CommunityTheme, - onProgress?: (status: string, percentage: number) => void + onProgress?: (status: string, percentage: number) => void, + options?: { folderName?: string } ): Promise<{ success: boolean; folderName: string }> { const { onProgress: reportProgress = () => {} } = { onProgress }; const baseThemesDir = await themesDirectory(); - const folderName = theme.id; + const folderName = options?.folderName?.trim() || theme.id; const targetFolder = await path.join(baseThemesDir, folderName); reportProgress('Downloading theme package...', 10); diff --git a/src/lib/components/theme/CommunityWorkshopView.svelte b/src/lib/components/theme/CommunityWorkshopView.svelte index 08a3d15..c6a6b41 100644 --- a/src/lib/components/theme/CommunityWorkshopView.svelte +++ b/src/lib/components/theme/CommunityWorkshopView.svelte @@ -51,6 +51,7 @@ import { normalizeThemeTags } from '$lib/themeV2'; import { reloadThemes, updateInstalledThemeTags, type Theme } from '$lib/themes'; import { currentUser } from '$lib/userAuthentication'; + import { reduceAnimations } from '$lib/userSettings'; import WorkshopTooltip from './WorkshopTooltip.svelte'; import { Archive, @@ -87,6 +88,7 @@ import { sileo } from 'sileo'; import { onDestroy, onMount } from 'svelte'; import { SvelteMap, SvelteSet } from 'svelte/reactivity'; + import { fade } from 'svelte/transition'; let { onApplyTheme, @@ -2051,7 +2053,7 @@ {:else}
- {#each themes as theme (theme.id)} + {#each themes as theme, index (theme.id)} {@const localTheme = localThemeMap.get(theme.id.toLowerCase()) || localThemeMap.get(theme.name.toLowerCase())} @@ -2077,6 +2079,9 @@ class="group flex flex-col overflow-hidden rounded-xl border bg-theme-900/30 {isActive ? 'border-primary/60 ring-1 ring-primary/20' : 'border-theme-800/60'} transition-all duration-300 hover:-translate-y-0.5 hover:border-white/20 hover:bg-theme-900/50 hover:shadow-xl hover:shadow-black/30" + class:workshop-card-enter={!$reduceAnimations} + style="animation-delay: {Math.min(index * 24, 144)}ms" + out:fade={{ duration: $reduceAnimations ? 0 : 140 }} >
+ + diff --git a/src/lib/components/theme/ThemeEditorWindow.svelte b/src/lib/components/theme/ThemeEditorWindow.svelte index 482d123..089c0e9 100644 --- a/src/lib/components/theme/ThemeEditorWindow.svelte +++ b/src/lib/components/theme/ThemeEditorWindow.svelte @@ -110,6 +110,8 @@ import { formatBytes, openURL } from '$lib/utils'; import { AlertTriangle, + AlignCenter, + AlignHorizontalSpaceAround, Boxes, Check, CheckCircle2, @@ -128,12 +130,14 @@ Download, Eye, EyeOff, + FileText, Film, Gauge, Globe, GripVertical, Hand, Image as ImageIcon, + Info, Keyboard, Layers, LayoutGrid, @@ -5075,7 +5079,12 @@
{:else}
- +
- +
@@ -5419,7 +5432,7 @@
- +
{#each backgroundTypes as option (option.value)}
- +
@@ -402,7 +406,11 @@ /> {#if element.type === 'text' || element.type === 'data'} - + {#if element.type === 'data'}
@@ -695,7 +703,7 @@ Object.assign(element, patch)} /> {:else if element.type === 'svelte'} - +
@@ -721,7 +729,7 @@
{:else if element.type === 'image' || element.type === 'video'} - +

Asset

{element.src}

@@ -829,7 +837,7 @@ {/if} {:else if element.type === 'lottie'} - +

Animation

{element.src}

@@ -885,7 +893,7 @@

{:else if element.type === 'shape'} - +
{:else if element.type === 'icon'} - +
@@ -1185,7 +1193,7 @@
{:else if element.type === 'repeater'} - +
{:else if element.type === 'gauge'} - +
@@ -1423,7 +1431,7 @@
{:else if element.type === 'ticker'} - +