feat(home): auto-refresh recently-played rails + a row refresh button

Home's recently-played albums/tracks only populated on a full home load, so
tracks played mid-session never appeared until restart. Re-read the LOCAL
store into the rails when a track is recorded while Home is visible, and on
Home re-mount if it went dirty — event-driven, no polling, cheap (small JSON
read + cached artwork). Also add a manual refresh button in each recently-
played row header next to the page chevrons (moved off the top toolbar, where
it crowded the discovery tab bar).

cc
This commit is contained in:
vicrodh committed 2026-07-13 13:11:43 -06:00
1 parent 8df8c18ab0
commit a174e06119
7 files changed
+232 -27

No files matched your search

+8
View File
@@ -204,6 +204,14 @@ export global HomeActions {
// "View all" on the Recently Played Albums rail -> the full-page listing
// (RecentAlbumsView), fed from the local play-history store.
callback open-recent-albums();
// Fired by HomeView's init on every (re)mount. Rust re-reads the LOCAL
// recently-played store into the two rails IF a play was recorded while
// Home was off-screen (dirty-flag gated in Rust — a no-op otherwise, so
// mounting Home stays free).
callback home-mounted();
// Manual refresh (the toolbar button next to the nav cluster):
// unconditionally re-read the local recently-played rails.
callback refresh-recent();
}
// RecentAlbumsView — the full "Recently Played Albums" page opened from the