Skip to content

Artist detail page + sorted-album panel + nav cleanup

jedmund requested to merge jedmund/artist-detail-page into jedmund/library-page

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's yellowMin threshold) 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.
  • SortedAlbumPanel (NEW) — slide-over geometry mirroring AlbumOrganizePanel, 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.source and 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). /artists becomes a 308 redirect to /?type=artists. The old artists/+page.svelte, plus AlbumList.svelte and SortedAlbumCard.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 on album_files.id, which collides with sorted_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_albums doesn't track an albumArtPath; the panel shows the placeholder. A future scanner pass could pull a cover.jpg from the folder, but it's out of scope here.
  • Track titles for sorted files. sorted_album_files only persists tagDiscNumber / 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 build passes.
  • 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.

Merge request reports

Loading