feat(locallibrary): Artists tab rebuilt as two-column master/detail
Replaces the thin name+counts grid (which was built without a Tauri review) with the real structure: a two-column master/detail, 1:1 with the Svelte Artists tab. Left rail: a merged/deduped, A-Z grouped master list of compact rows (round avatar + display name + "N albums · M tracks") with a proportional alpha jump strip and in-place search. The name-merge collapses normalized-equal spellings into one canonical row (canonical = most albums, tie by most tracks) and computes accurate unique album counts from the album set's all_artists, mirroring Tauri's artistMergeResult. Diacritics are folded best-effort (no unicode-normalization dep). Right pane: the selected artist's albums, filtered IN PLACE from the loaded album set by primary/all_artists/multi-credit match (no new backend call) and rendered via the shared AlbumCollectionView; covers load through a new LocalArtistAlbumCard artwork target. Clicking an album opens the local album detail; the play action queues the album. Custom DB artist images are resolved into the rail model; rendering them (plus the capped/sequential Qobuz photo fetch) is the remaining image follow-up — the rail shows the placeholder avatar until then. cc
This commit is contained in:
5 files changed
+702
-85
No files matched your search
@@ -85,6 +85,9 @@ pub enum ArtworkTarget {
|
||||
LocalAlbumCard { index: usize, gen: u64 },
|
||||
/// A card in LocalLibraryState.folders[index] (Folders-flat grid).
|
||||
LocalFolderCard { index: usize },
|
||||
/// A card in LocalLibraryState.artists-selected-albums[index] (the
|
||||
/// Artists tab right pane — the selected artist's albums).
|
||||
LocalArtistAlbumCard { index: usize },
|
||||
/// A card in FavoritesState.artists[index].
|
||||
FavoriteArtist { index: usize },
|
||||
/// A card in FavoritesState.labels[index].
|
||||
@@ -622,6 +625,15 @@ fn apply_artwork(
|
||||
model.set_row_data(index, item);
|
||||
}
|
||||
}
|
||||
ArtworkTarget::LocalArtistAlbumCard { index } => {
|
||||
let model = window
|
||||
.global::<crate::LocalLibraryState>()
|
||||
.get_artists_selected_albums();
|
||||
if let Some(mut item) = model.row_data(index) {
|
||||
item.artwork = image;
|
||||
model.set_row_data(index, item);
|
||||
}
|
||||
}
|
||||
ArtworkTarget::FavoriteArtist { index } => {
|
||||
let model = window.global::<crate::FavoritesState>().get_artists();
|
||||
if let Some(mut item) = model.row_data(index) {
|
||||
|
||||
Reference in new issue
Block a user