feat(slint/discover): favoriteAlbums row in For You

Add the missing For You "Favorite Albums" carousel (Tauri's
favoriteAlbums), the user's favorited albums capped at 18 in favorite
order, self-hiding when empty. Reuses the album fav-fetch already done in
albums_branch — no new endpoint.

- state.slint: ForYouState.favorite-albums: DiscoverSection.
- foryou.rs: build_favorite_albums (cap 18, unfiltered) + apply_favorite_albums
  (mirrors apply_rediscover); wired into albums_branch right after fav_albums
  resolves, painting in the same layer as rediscover/radio.
- artwork.rs: ForYouFavoriteAlbum { index } variant + apply arm.
- ForYouView.slint: mount the Carousel after Your Top Artists, before More
  From Your Library, gated on favorite-albums.albums.length > 0.

Titled "Favorite Albums" (not Tauri's literal "More From Your Library")
to avoid the label collision with similarAlbums.

cc
This commit is contained in:
vicrodh committed 2026-06-15 12:56:33 -06:00
1 parent 6d06a8aa83
commit 613a3f009b
4 files changed
+40

No files matched your search

@@ -134,6 +134,17 @@ export component ForYouView inherits VerticalLayout {
}
}
// 6. Favorite Albums.
if ForYouState.favorite-albums.albums.length > 0: Carousel {
section: ForYouState.favorite-albums;
album-clicked(id) => {
root.open-album(id);
}
media-action(kind, id, action) => {
root.media-action(kind, id, action);
}
}
// 5. More From Your Library.
if ForYouState.more-from-library.albums.length > 0: Carousel {
section: ForYouState.more-from-library;
+2
View File
@@ -159,6 +159,8 @@ export global ForYouState {
in property <DiscoverSection> release-watch;
in property <[RadioStationItem]> radio-stations: [];
in property <DiscoverSection> recent-albums;
// Favorite Albums — the user's favorited albums (For You #6).
in property <DiscoverSection> favorite-albums;
in property <[SlimItem]> recent-tracks: [];
in property <[SlimItem]> top-artists: [];
in property <[SlimItem]> artists-to-follow: [];