fix: harden session restore/persist to prevent ghost CSS errors

When last_view pointed to a view with incomplete context (e.g.
album without selectedAlbum data), the Svelte CSS extraction
pipeline would corrupt and produce PostCSS "Unknown word" errors
that survived cache cleans and npm ci.

- Add isSessionRestoreSafeView() whitelist for context-free views
- Add getSessionFallbackView() for graceful degradation
- Centralize persist logic in getPersistedSessionViewState()
- Only persist views that have valid context data
- Add purchase-album to restore path
- Add dev:reset-last-view script to reset session.db
- Fix AlbumCreditsModal.svelte event handler typing
This commit is contained in:
vicrodh committed 2026-03-11 17:02:29 -06:00
1 parent 0b870e6ddb
commit 9d6c2f7eba
4 files changed
+194 -43

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
"dev:ultra-restore": "bash ./scripts/dev-ultra-restore.sh",
"dev:ultra-reset": "bash ./scripts/dev-ultra-restore.sh --no-start",
"dev:ultra-full-reset": "bash ./scripts/dev-ultra-restore.sh --full --no-start",
"dev:reset-last-view": "bash ./scripts/dev-reset-last-view.sh",
"dev:tauri": "./scripts/dev-with-env.sh",
"build": "vite build",
"preview": "vite preview",