feat(qbz-qt): phase 13 — correct card families in Library + Discover tabs

Library audit: the phase-7 conversion never actually mounted the shared
AlbumCard — ALL kinds used the invented feed card. Now per-kind 1:1:
LibTrackCard (discover/TrackCard replica with wired next/later/queue
enqueue), shared AlbumCard for albums, LibArtistCard (ArtistGridCard
circle), LibPlaylistCard (collage, follow-aware), LibLabelCard
(gradient + contain-fit logo), list rows rewritten to the real
FavoritesView inline row, Tracks tab on a TrackRow replica. Discover:
Editor's Picks and For You tabs rendered from the same discover-index
fetch, prefs-ordered per DiscoverPrefsStore (incl. mostStreamed#album
variant, Qobuz Mixes gradient tiles, Pinned in the user's own position);
Recommendations tab gated on the user's pref with an explicit engine
placeholder. No refetch on tab switches.

km
This commit is contained in:
vicrodh committed 2026-07-27 22:35:21 -06:00
1 parent 71d41b927c
commit cc71337293
15 files changed
+1310 -245

No files matched your search

+18
View File
@@ -102,6 +102,10 @@ pub mod qbz_bridge {
// sections travel as ONE JSON document; QML JSON.parse()s it into
// the exact same {id, title, kind, items:[{...}]} object graph.
#[qproperty(QString, home_sections_json)]
// Editor's Picks / For You tab section lists (phase 13; same
// HomeSection shape, ordered by each tab's discover prefs).
#[qproperty(QString, editor_sections_json)]
#[qproperty(QString, for_you_sections_json)]
// --- Library view --------------------------------------------------
#[qproperty(bool, library_loading)]
@@ -289,6 +293,10 @@ pub mod qbz_bridge {
/// Track-row click (Library): play the track as a 1-element queue.
#[qinvokable]
fn play_track(self: Pin<&mut QbzBridge>, track_id: QString);
/// Library track context menus: Play next ("next") / Play later
/// ("later") / Add to queue ("queue") on a single feed track.
#[qinvokable]
fn enqueue_track(self: Pin<&mut QbzBridge>, track_id: QString, mode: QString);
/// Library retry button / manual refresh.
#[qinvokable]
@@ -439,6 +447,8 @@ pub struct QbzBridgeRust {
home_loading: bool,
home_error: QString,
home_sections_json: QString,
editor_sections_json: QString,
for_you_sections_json: QString,
library_loading: bool,
library_error: QString,
library_json: QString,
@@ -502,6 +512,8 @@ impl Default for QbzBridgeRust {
home_loading: false,
home_error: QString::default(),
home_sections_json: QString::from("[]"),
editor_sections_json: QString::from("[]"),
for_you_sections_json: QString::from("[]"),
library_loading: false,
library_error: QString::default(),
library_json: QString::from("[]"),
@@ -704,6 +716,12 @@ impl qbz_bridge::QbzBridge {
}
}
pub fn enqueue_track(self: Pin<&mut Self>, track_id: QString, mode: QString) {
if let Ok(id) = track_id.to_string().parse::<u64>() {
crate::enqueue_track(id, mode.to_string());
}
}
pub fn reload_library(self: Pin<&mut Self>) {
crate::reload_library();
}