From dde8c7510bee0363196318865f4422b36a2dc4c7 Mon Sep 17 00:00:00 2001
From: KeelrLeek <156356974+KeelrLeek@users.noreply.github.com>
Date: Sat, 1 Aug 2026 07:43:50 -0500
Subject: [PATCH] albums: one page for every record, and streamed history rows
that actually open
Three things were wrong with opening an album, and only one of them was the
one that got reported.
The reported half: clicking a local record in the sidebar's history went to
the old in-library album view. Local albums carry no catalog identity of any
kind -- `albums.mbid` is null and is not even in the DTO -- so there was
nothing to route with. openAlbumByName already existed for exactly this
(the now-playing links use it, and it requires BOTH artist and title to match
normalized, which is the namesake guard); it now reports whether it resolved
and caches settled answers, so a second click is instant.
The unreported half, and the reason "half of them are not working": every
STREAMED row was dead. catalog_album_id is TEXT in SQLite, so it arrives as a
string, and `catalog_album` takes a u64 -- the invoke was rejected outright
with "invalid type: string ... expected u64". Terrestrials, OK Human and 9 all
failed silently on click. The id is coerced in checkedAlbumPayload now, where
both other string sources (page seeds) pass through too.
And the part that made the first half unfixable: a record no catalog carries
had nowhere to go. Panda Bear's "A ? of WHEN" is not on Deezer, so no amount
of resolving would ever open it. Local albums now render on the SAME page,
composed from the library's own data -- its tracks, durations, bitrates and
the cover already on disk -- under a namespaced `lib:` id that can never
collide with a Deezer one. Playback stays local: Play and any row queue the
files you already have rather than sending a record you own back through the
resolver. Save is not offered (it is already saved), previews are absent
(there is nothing to preview), and the attribution footer credits your
library rather than claiming Deezer + MusicBrainz.
With that, the old view has no callers and is deleted: the album-page block,
its CSS, and the members that only it used. Nothing anywhere routes to it.
Verified live: all six history rows open the new page, a Home card opens it,
Play queues 14 local FLACs without streaming, and the back arrow returns.
---
src/App.svelte | 8 +-
src/components/AlbumCard.svelte | 7 +-
src/components/GlassBar.svelte | 8 +-
src/components/Sidebar.svelte | 16 +-
src/lib/api.js | 17 +-
src/lib/state.svelte.js | 154 ++++++++++++++-
src/views/CatalogAlbum.svelte | 61 +++++-
src/views/CatalogSearch.svelte | 8 +
src/views/Library.svelte | 338 +-------------------------------
9 files changed, 252 insertions(+), 365 deletions(-)
diff --git a/src/App.svelte b/src/App.svelte
index d08ac28..f9c5d80 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -53,7 +53,7 @@
cancels the pane's top padding so a page's artwork can run underneath it,
and the page restores that inset for its own content. Without it the page
renders 24px too high; with it but not listed here, 24px too low. */
- const BAR_VIEWS = new Set(["catalogArtist", "catalogAlbum"]);
+ const BAR_VIEWS = new Set(["catalogArtist", "catalogAlbum", "catalog"]);
initEvents();
autoConnect();
@@ -180,6 +180,12 @@
it: the glass bar bleeds up over it, cancels it for what follows, and
each page under the bar restores it as its own padding-top. */
--pane-pad: 24px;
+ /* The glass bar's height, declared HERE rather than on the bar so pages
+ can clear it. A page with a hero (artist, album) wants its artwork to
+ run underneath the bar and only takes --pane-pad back; a page with no
+ artwork behind the bar (search) has to start below it, or its first
+ heading sits under the frost at rest. */
+ --bar-h: 46px;
border-radius: var(--radius);
overflow-y: auto;
overflow-anchor: none;
diff --git a/src/components/AlbumCard.svelte b/src/components/AlbumCard.svelte
index fcc47a8..ad1e8b3 100644
--- a/src/components/AlbumCard.svelte
+++ b/src/components/AlbumCard.svelte
@@ -1,5 +1,5 @@
diff --git a/src/components/GlassBar.svelte b/src/components/GlassBar.svelte
index 0c07947..8397224 100644
--- a/src/components/GlassBar.svelte
+++ b/src/components/GlassBar.svelte
@@ -125,8 +125,12 @@