perf(slint): load For You progressively and in parallel

Replace the sequential ~9-round-trip load_for_you + monolithic
apply_for_you with a progressive, parallel loader. The recently-played
sections paint instantly (local, no network); the independent API calls
fan out into concurrent branches (release-watch, favorite-artists,
favorite-albums, album-suggest) and each section applies the moment its
data resolves via upgrade_in_event_loop. The loaded flag is latched only
after every branch resolves, so the ensure_for_you_loaded re-entry guard
can never strand a partially-loaded tab.

Artists to Follow keeps byte-identical dedup/cap semantics (concurrent
per-seed fetch via join_all in seed order, then sequential dedup + cap).
album-suggest runs concurrently in the common case (recent-album seed),
falling back to the first favorite album only when there is no history.
The For You skeleton now hides as soon as the first section paints.

cc
This commit is contained in:
vicrodh committed 2026-06-15 12:37:25 -06:00
1 parent 8d26b64297
commit 454a6d70af
3 files changed
+543 -312

No files matched your search

@@ -29,12 +29,18 @@ export component ForYouView inherits VerticalLayout {
callback start-radio-album(string);
callback open-mix(string);
// While the first lazy load is in flight, show the same pulsing
// skeleton Home uses (the Qobuz Mixes tiles stay — they're static).
// Progressive load: while the first lazy load is in flight, show the
// skeleton Home uses (the Qobuz Mixes tiles stay — they're static). It
// hides as soon as ANY content paints — the recently-played sections
// render first (local, instant), the rest fill in via each section's own
// `if length > 0` gate. The page-level `loading` latch only keeps the
// skeleton up while every backing section is still empty.
property <bool> show-skeleton:
ForYouState.loading
&& ForYouState.release-watch.albums.length == 0
&& ForYouState.top-artists.length == 0;
&& ForYouState.top-artists.length == 0
&& ForYouState.recent-albums.albums.length == 0
&& ForYouState.recent-tracks.length == 0;
spacing: 40px;
alignment: start;