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:
9 files changed
+556
-113
No files matched your search
@@ -12,6 +12,7 @@ import { HomeState, HomeActions, GenreFilterState, NavState, ContentView } from
|
||||
import { Carousel } from "Carousel.slint";
|
||||
import { SlimCarousel } from "SlimCarousel.slint";
|
||||
import { HomeSkeleton } from "HomeSkeleton.slint";
|
||||
import { ForYouView } from "ForYouView.slint";
|
||||
import { GenreFilterPopup } from "GenreFilterPopup.slint";
|
||||
import { QbzIcon } from "../primitives/QbzIcon.slint";
|
||||
import { NavButtons } from "../shell/NavButtons.slint";
|
||||
@@ -141,6 +142,7 @@ component GearButton inherits Rectangle {
|
||||
|
||||
export component HomeView inherits Rectangle {
|
||||
callback album-clicked(string);
|
||||
callback open-artist(string);
|
||||
callback media-action(string, string, string);
|
||||
|
||||
background: Theme.surface-main;
|
||||
@@ -246,7 +248,9 @@ export component HomeView inherits Rectangle {
|
||||
spacing: 40px;
|
||||
alignment: start;
|
||||
|
||||
if HomeState.loading && HomeState.sections.length == 0: HomeSkeleton { }
|
||||
if HomeState.active-tab != "forYou"
|
||||
&& HomeState.loading
|
||||
&& HomeState.sections.length == 0: HomeSkeleton { }
|
||||
|
||||
for section in HomeState.sections: Carousel {
|
||||
section: section;
|
||||
@@ -258,6 +262,23 @@ export component HomeView inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// For You renders its own ordered, heterogeneous
|
||||
// sections from ForYouState.
|
||||
if HomeState.active-tab == "forYou": ForYouView {
|
||||
open-album(id) => {
|
||||
root.album-clicked(id);
|
||||
}
|
||||
open-artist(id) => {
|
||||
root.open-artist(id);
|
||||
}
|
||||
media-action(kind, id, action) => {
|
||||
root.media-action(kind, id, action);
|
||||
}
|
||||
play-track(id) => {
|
||||
root.media-action("track", id, "play");
|
||||
}
|
||||
}
|
||||
|
||||
// The Recently Played + Popular sections below belong
|
||||
// to the Home tab only; Editor's Picks / For You show
|
||||
// just their own cached section set above.
|
||||
|
||||
Reference in new issue
Block a user