fix(slint): immersive Coverflow z-order + ghost (left/right repeaters, no per-element z)

Slint 1.16 has no per-element z-index (paint order = model/child order), so a
single Repeater painted the right (upcoming) side near->far = far covers on top
(disordered), and it also drew a ghost center card under the dedicated one.

- Split the fan into a LEFT Repeater (forward coverflow-tracks: paints
  far-left->near-left, near on top) and a RIGHT Repeater over a new reversed
  model coverflow-tracks-rev (walks far-upcoming->near-upcoming, near on top).
  Both compute offset from the original flat index so geometry matches and the
  ±0.5 hand-off during a slide is seamless. Center band owned solely by the
  dedicated top card -> no ghost.
- coverflow-tracks-rev is built only under the same id-sequence-hash rebuild
  gate (no churn on advance) by cloning+reversing the forward QueueItems, so a
  track's element holds the SAME decoded image on both lists: no source
  reassignment on advance (no spike), and the animated `scroll` slide is intact.
- 3 past + center + 3 upcoming, mirror POSITIONS (scale/dim by |offset| only;
  no reflection). Nav mapping (play-history / play-coverflow-upcoming) preserved.

cc
This commit is contained in:
vicrodh committed 2026-06-14 03:04:33 -06:00
1 parent d00ec1fa71
commit 421e84c571
3 files changed
+103 -24

No files matched your search

+26 -1
View File
@@ -443,7 +443,18 @@ impl QueueController {
.iter()
.map(|r| to_item_reuse(r, &prior_all))
.collect();
// The reversed model: same QueueItems (so a track's element holds
// the SAME decoded handle on both sides — no extra decode), just
// in reverse order. The RIGHT Repeater iterates THIS so it paints
// far-upcoming -> near-upcoming, putting the nearer cover on top.
// Rebuilt under the SAME seq gate as the forward model, so a pure
// advance never touches it either.
let mut cf_items_rev = cf_items.clone();
cf_items_rev.reverse();
qs.set_coverflow_tracks(slint::ModelRc::new(slint::VecModel::from(cf_items)));
qs.set_coverflow_tracks_rev(slint::ModelRc::new(slint::VecModel::from(
cf_items_rev,
)));
qs.set_coverflow_seq_hash(coverflow_seq_hash as i32);
log::debug!(
"[coverflow-perf] rebuild seq={coverflow_seq_hash} len={} idx={coverflow_index}",
@@ -1075,12 +1086,26 @@ fn apply_queue_art(win: &AppWindow, target: ArtTarget, img: slint::Image) {
ArtTarget::CoverflowFlat(idx) => {
let items = qs.get_coverflow_tracks();
if let Some(mut item) = items.row_data(idx) {
item.artwork = img;
item.artwork = img.clone();
// set_row_data on a SINGLE flat row — does NOT replace the
// VecModel, so the Repeater is not rebuilt and the other covers'
// sources are untouched. Only this one cell's image changes.
items.set_row_data(idx, item);
}
// Mirror the decode onto the reversed model used by the RIGHT
// Repeater. The reversed model is the forward list reversed, so the
// same track sits at `len-1-idx`. Updating a single row here (not
// replacing the VecModel) keeps that Repeater stable too — no rebuild,
// no churn — it just fills in the same cover the forward side got.
let rev = qs.get_coverflow_tracks_rev();
let rev_len = rev.row_count();
if rev_len > 0 && idx < rev_len {
let rev_idx = rev_len - 1 - idx;
if let Some(mut item) = rev.row_data(rev_idx) {
item.artwork = img;
rev.set_row_data(rev_idx, item);
}
}
}
}
}