From 34be0aa32301ece3f10087d978efa4db87bfb005 Mon Sep 17 00:00:00 2001 From: vicrodh Date: Mon, 9 Mar 2026 22:50:41 -0600 Subject: [PATCH] feat: add Home/Editor's Picks/For You tab navigation to HomeView Add tab button group inline with greeting header. Existing home content shows only on Home tab. Editor's Picks and For You tabs have placeholders. i18n keys added to all 4 locales. --- src/lib/components/views/HomeView.svelte | 150 ++++++++++++++++++++--- src/lib/i18n/locales/de.json | 4 +- src/lib/i18n/locales/en.json | 4 +- src/lib/i18n/locales/es.json | 4 +- src/lib/i18n/locales/fr.json | 4 +- 5 files changed, 144 insertions(+), 22 deletions(-) diff --git a/src/lib/components/views/HomeView.svelte b/src/lib/components/views/HomeView.svelte index d70edfef6..7cf8313b8 100644 --- a/src/lib/components/views/HomeView.svelte +++ b/src/lib/components/views/HomeView.svelte @@ -2,7 +2,7 @@ import { onMount, tick } from 'svelte'; import { invoke } from '@tauri-apps/api/core'; import { resolveArtistImage } from '$lib/stores/customArtistImageStore'; - import { Music, User, Loader2, ArrowRight } from 'lucide-svelte'; + import { Music, User, Loader2, ArrowRight, Home } from 'lucide-svelte'; import { cachedSrc } from '$lib/actions/cachedImage'; import { type OfflineCacheStatus } from '$lib/stores/offlineCacheState'; import { @@ -191,6 +191,10 @@ let homeSettings = $state(getSettings()); let isSettingsModalOpen = $state(false); + // Tab state + type HomeTab = 'home' | 'editorPicks' | 'forYou'; + let activeTab = $state('home'); + // Computed greeting with i18n support — never call $t() inside $derived() function getGreetingText(): string { const info = getGreetingInfo(userName); @@ -868,28 +872,54 @@
- +
- {#if homeSettings.greeting.enabled} -

{getGreetingText()}

- {:else} -
- {/if} +
+ {#if homeSettings.greeting.enabled} +

{getGreetingText()}

+ {/if} +
+ + + +
+
- - + {#if activeTab === 'home'} + + + {/if}
+ {#if activeTab === 'home'} {#if error}
@@ -1508,6 +1538,21 @@

{$t('home.startListeningDescription')}

{/if} + {:else if activeTab === 'editorPicks'} + +
+ +

{$t('home.editorPicks')}

+

Coming soon

+
+ {:else if activeTab === 'forYou'} + +
+ +

{$t('home.forYou')}

+

Coming soon

+
+ {/if}