feat(album): multi-disc "Disc N" headers with per-disc context menu

Album and local-album track lists render a "Disc N" header above the
first track of each disc when the album spans more than one disc
(media_number-driven; single-disc albums render flat), matching Tauri.
Each header carries a context menu (new — Tauri has none) with Play all /
Shuffle / Add to queue / Play next scoped to that disc's tracks only; the
whole-album header buttons are unchanged.

The menu lives in a DiscHeaderMenu wrapper because Slint rejects a
PopupWindow placed directly under a for/if delegate — wrapping it makes
the popup a non-root child (same pattern as TrackRow + TrackContextMenu).
Every TrackItem constructor gains disc-header-number: 0; artist
top-tracks (a flat cross-album list) default the disc to 1.

cc
This commit is contained in:
vicrodh committed 2026-06-15 19:19:21 -06:00
1 parent 2e337f6039
commit 30bd959bf7
16 files changed
+506 -40

No files matched your search

+8
View File
@@ -776,6 +776,8 @@ fn top_track_to_item(t: &TopTrack) -> TrackItem {
cache_progress: 0.0,
source: "qobuz".into(),
unlocking: false,
// Disc grouping is album-detail only; flat lists carry none.
disc_header_number: 0,
}
}
@@ -793,6 +795,12 @@ fn playlist_to_item(p: &PlaylistSlim) -> SearchPlaylistItem {
cover2: slint::Image::default(),
cover3: slint::Image::default(),
cover4: slint::Image::default(),
// Label-landing playlist cards carry no category subtag, and a
// transparent dominant-colour is the sentinel for "no letterbox":
// the collage keeps the legacy cover-fit (the contain + dominant-
// colour treatment is Discover-only).
category: "".into(),
dominant_color: slint::Color::from_argb_u8(0, 0, 0, 0),
}
}