diff --git a/v2/src/lib/components/Workspace/SettingsTab.svelte b/v2/src/lib/components/Workspace/SettingsTab.svelte index b68ac85..2e4e570 100644 --- a/v2/src/lib/components/Workspace/SettingsTab.svelte +++ b/v2/src/lib/components/Workspace/SettingsTab.svelte @@ -14,8 +14,8 @@ } from '../../stores/workspace.svelte'; import { deriveIdentifier } from '../../types/groups'; import { getSetting, setSetting } from '../../adapters/settings-bridge'; - import { getCurrentFlavor, setFlavor } from '../../stores/theme.svelte'; - import type { CatppuccinFlavor } from '../../styles/themes'; + import { getCurrentTheme, setTheme } from '../../stores/theme.svelte'; + import { THEME_LIST, type ThemeId } from '../../styles/themes'; let activeGroupId = $derived(getActiveGroupId()); let activeGroup = $derived(getActiveGroup()); @@ -29,8 +29,17 @@ // Global settings let defaultShell = $state(''); let defaultCwd = $state(''); - let themeFlavor = $state(getCurrentFlavor()); - const flavors: CatppuccinFlavor[] = ['latte', 'frappe', 'macchiato', 'mocha']; + let selectedTheme = $state(getCurrentTheme()); + + // Group themes by category for + const themeGroups = $derived(() => { + const map = new Map(); + for (const t of THEME_LIST) { + if (!map.has(t.group)) map.set(t.group, []); + map.get(t.group)!.push(t); + } + return [...map.entries()]; + }); onMount(async () => { const [shell, cwd] = await Promise.all([ @@ -39,7 +48,7 @@ ]); defaultShell = shell ?? ''; defaultCwd = cwd ?? ''; - themeFlavor = getCurrentFlavor(); + selectedTheme = getCurrentTheme(); }); async function saveGlobalSetting(key: string, value: string) { @@ -50,9 +59,9 @@ } } - async function handleThemeChange(flavor: CatppuccinFlavor) { - themeFlavor = flavor; - await setFlavor(flavor); + async function handleThemeChange(themeId: ThemeId) { + selectedTheme = themeId; + await setTheme(themeId); } // New project form @@ -92,14 +101,18 @@

Global

- +
@@ -154,14 +167,14 @@ {#each activeGroup.projects as project}
-