feat(slint): dedicated For You view with artist sections

Replaces the ad-hoc For You (a single album set crammed into
HomeState.sections) with a dedicated, ordered ForYouView/ForYouState
so the tab can mix album, track, and artist carousels — closer to
Tauri's For You. Lazy-loaded once on first open.

Sections (all reuse existing cards, no new card components):
  - Release Watch (album Carousel) — get_release_watch.
  - Recently Played Tracks (SlimCarousel) — local play-history.
  - Recently Played Albums (album Carousel) — local play-history.
  - Your Top Artists (ArtistCarousel) — the user's favorite artists
    via get_favorites.
  - Artists to Follow (ArtistCarousel) — similar artists seeded from
    a few favorites via get_similar_artists, excluding ones already
    followed (Follow chip shown).

Plumbing:
  - crate::foryou controller (load/apply/artwork). Five ForYou
    artwork targets feed the dedicated models.
  - select_tab("forYou") clears HomeState.sections (the home-content
    `for` renders nothing) and the For You content comes from
    ForYouView; HomeView routes the For You tab to ForYouView and
    gains an open-artist callback (wired through AppShell).
  - ensure_for_you_loaded lazy-loads on tab open (pill, header
    dropdown, and back/forward history).
  - home.rs no longer builds a For You section set (removed the
    redundant release-watch/favorites fetch on every home load).

Still to come (next increments): Qobuz Mixes row, Radio Stations
(old card design), Spotlight hero, and the reco-DB sections (More
from library, Rediscover) — those need backend the MVP lacks or the
mix detail views.

cc
This commit is contained in:
vicrodh committed 2026-05-21 00:33:11 -06:00
1 parent 066890a7dd
commit 85ecf79a2d
9 files changed
+556 -113

No files matched your search

+45
View File
@@ -66,6 +66,16 @@ pub enum ArtworkTarget {
FavoriteArtist { index: usize },
/// A card in FavoritesState.playlists[index].
FavoritePlaylist { index: usize },
/// A card in ForYouState.release-watch.albums[index].
ForYouReleaseWatch { index: usize },
/// A card in ForYouState.recent-albums.albums[index].
ForYouRecentAlbum { index: usize },
/// A row in ForYouState.recent-tracks[index].
ForYouRecentTrack { index: usize },
/// A tile in ForYouState.top-artists[index].
ForYouTopArtist { index: usize },
/// A tile in ForYouState.artists-to-follow[index].
ForYouToFollow { index: usize },
}
/// An artwork download job: which card, and the image URL.
@@ -403,5 +413,40 @@ fn apply_artwork(
model.set_row_data(index, item);
}
}
ArtworkTarget::ForYouReleaseWatch { index } => {
let model = window.global::<crate::ForYouState>().get_release_watch().albums;
if let Some(mut item) = model.row_data(index) {
item.artwork = image;
model.set_row_data(index, item);
}
}
ArtworkTarget::ForYouRecentAlbum { index } => {
let model = window.global::<crate::ForYouState>().get_recent_albums().albums;
if let Some(mut item) = model.row_data(index) {
item.artwork = image;
model.set_row_data(index, item);
}
}
ArtworkTarget::ForYouRecentTrack { index } => {
let model = window.global::<crate::ForYouState>().get_recent_tracks();
if let Some(mut item) = model.row_data(index) {
item.artwork = image;
model.set_row_data(index, item);
}
}
ArtworkTarget::ForYouTopArtist { index } => {
let model = window.global::<crate::ForYouState>().get_top_artists();
if let Some(mut item) = model.row_data(index) {
item.artwork = image;
model.set_row_data(index, item);
}
}
ArtworkTarget::ForYouToFollow { index } => {
let model = window.global::<crate::ForYouState>().get_artists_to_follow();
if let Some(mut item) = model.row_data(index) {
item.artwork = image;
model.set_row_data(index, item);
}
}
}
}