feat(slint): recently-played store and Discover Home section

Close the Recently Played Tracks tech debt: a JSON-backed play-history
store at the shared QBZ data path, surfaced as a slim-card section on
Discover Home (it hides while empty).

- recently.rs: load() reads the store newest-first; record() prepends a
  track, dedupes by id and caps the list — the playback session calls
  record() when a track starts
- home.rs threads a `recent` list into HomeData; HomeView renders a
  "Recently Played" GridSection; artwork pipeline gains an
  ArtworkTarget::Recent

The data path is complete end to end; only record() awaits the
playback session.

cc
This commit is contained in:
vicrodh committed 2026-05-18 18:47:24 -06:00
1 parent 49cd8f6a87
commit d132636caa
8 files changed
+181 -21

No files matched your search

+10
View File
@@ -35,6 +35,8 @@ pub enum ArtworkTarget {
Section { section_idx: usize, album_idx: usize },
/// A card in `HomeState.popular[idx]`.
Popular { idx: usize },
/// A card in `HomeState.recent[idx]`.
Recent { idx: usize },
}
/// An artwork download job: which card, and the image URL.
@@ -188,5 +190,13 @@ fn apply_artwork(
item.artwork = image;
popular.set_row_data(idx, item);
}
ArtworkTarget::Recent { idx } => {
let recent = home.get_recent();
let Some(mut item) = recent.row_data(idx) else {
return;
};
item.artwork = image;
recent.set_row_data(idx, item);
}
}
}