From ad0ae8cb0e0b67b2e448ec02f41f206993d0ffa4 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Wed, 6 May 2026 08:17:13 -0600 Subject: [PATCH] feat(routing): add offline-manager view branch and exclude from last_view persistence Wires the new OfflineCacheManagerView into +page.svelte's view switch with onBack returning to settings, onGoToAlbum delegating to handleAlbumClick, and onGoToFavorites returning to the user's last favorites tab. Adds 'offline-manager' to the ViewType union so the new branch type-checks. Excludes 'offline-manager' from last_view persistence by routing it through getSessionFallbackView('offline-manager') -> 'settings' (its entry point), guarding against Phantom CSS Error Cause 3 on rehydration when the cache DB is not yet ready at first paint. cc --- src/lib/stores/navigationStore.ts | 3 ++- src/routes/+page.svelte | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/stores/navigationStore.ts b/src/lib/stores/navigationStore.ts index 764ecb91c..88ef75d23 100644 --- a/src/lib/stores/navigationStore.ts +++ b/src/lib/stores/navigationStore.ts @@ -45,7 +45,8 @@ export type ViewType = | 'mixtapes' | 'collections' | 'mixtape-detail' - | 'discography-builder'; + | 'discography-builder' + | 'offline-manager'; export type FavoritesTab = 'tracks' | 'albums' | 'artists' | 'labels' | 'playlists'; // History entry: view + optional item identifier for granular back/forward diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 3eb41ce85..a1ba7e4e8 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -193,6 +193,7 @@ import CollectionsView from '$lib/components/views/CollectionsView.svelte'; import MixtapeCollectionDetailView from '$lib/components/views/MixtapeCollectionDetailView.svelte'; import DiscographyBuilderView from '$lib/components/views/DiscographyBuilderView.svelte'; + import OfflineCacheManagerView from '$lib/components/views/OfflineCacheManagerView.svelte'; import { collectionsStore, createCollection, @@ -723,6 +724,11 @@ return 'library'; case 'purchase-album': return 'purchases'; + // Offline cache manager is intentionally NOT persisted as last_view to + // avoid Phantom CSS Error Cause 3 on rehydration when the cache DB is + // not yet ready at first paint. Fall back to settings (its entry point). + case 'offline-manager': + return 'settings'; default: return 'home'; } @@ -6587,6 +6593,12 @@

No artist selected.

{/if} + {:else if activeView === 'offline-manager'} + navigateTo('settings')} + onGoToAlbum={(albumId) => handleAlbumClick(albumId)} + onGoToFavorites={() => navigateToFavorites()} + /> {:else}