Artist detail page + sorted-album panel + nav cleanup
Stacked on PR #41. Final PR in the Library redesign: gives every artist a real shareable URL, makes sorted-album clicks open a read-only side panel, and removes the legacy /artists route now that Library subsumes it.
What changes
-
/artist/[key](NEW, SSR) — header with artist name + total album / unsorted / sorted counts + total size + quality summary, then Unsorted and Sorted sections rendered as the same eight-column quality table the Library list view uses. Albums whose score lands in the red band (below the user'syellowMinthreshold) get a subtle red row tint so upgrade candidates pop visually.- Loader uses the existing
getArtistDetail(already returning per-album quality fields after PR 1) and bins both sides into green / yellow / red / gray counts against the configured thresholds. - 404s when the artist key has neither pending nor sorted albums.
- Loader uses the existing
-
SortedAlbumPanel(NEW) — slide-over geometry mirroringAlbumOrganizePanel, but stripped to read-only essentials:- Hero: cover placeholder, name, artist, date, file count, size, quality badge, codec / bitrate / sample-rate breakdown, folder path.
- Tracklist: filename, codec, bitrate, size per track. No SortForm, no recommendations, no audio playback — those belong on the unsorted side.
- Pulls album + files via a small new
/api/sorted-albums/[id]endpoint.
-
Library + Artist click handlers dispatch on
item.sourceand open the appropriate panel. Sorted clicks were intentional no-ops in PR 3; they now get the panel. -
Nav cleanup — drops the 'Artists' nav link (Library + Type: Artists subsumes it).
/artistsbecomes a 308 redirect to/?type=artists. The oldartists/+page.svelte, plusAlbumList.svelteandSortedAlbumCard.svelte(no remaining callers after the rewrite) are deleted.
What's intentionally not here
- Sorted-side audio playback. The
/api/audio/[fileId]endpoint is keyed onalbum_files.id, which collides withsorted_album_files.id. Disambiguating it is a non-trivial follow-up that isn't required for the read-only browse use case. - Sorted-album cover art.
sorted_albumsdoesn't track analbumArtPath; the panel shows the placeholder. A future scanner pass could pull acover.jpgfrom the folder, but it's out of scope here. - Track titles for sorted files.
sorted_album_filesonly persiststagDiscNumber/tagTrackNumber; the panel falls back to filenames. Adding tag fields to that table is a small one-day follow-up if it matters.
Verification
-
pnpm run buildpasses. - Visit
/artist/<some-artist-key>. Header shows correct counts and quality summary. Both sections render with the eight-column table; below-threshold albums tint red. - Click an unsorted album → existing sort panel opens (regression check).
- Click a sorted album → SortedAlbumPanel opens with hero + tracklist; ESC / backdrop close it.
- Visit
/artists→ redirects to/?type=artists. - Nav shows: Library, Random, Batch (Settings on the right). 'Artists' is gone.
- Click an artist card or row from
/?type=artists→ navigates to/artist/[key]. - Try a bogus key like
/artist/does-not-exist→ 404.
Risk
Deletions are limited to components/routes with no remaining callers (verified via grep). The nav change is one line. The new artist page is SSR and additive. The new sorted-panel API is read-only. Lowest risk PR in the stack.