fix(qt): "Not interested" actually removes the artist from Recommendations

The write existed — `dismissArtist` persisted to the reco-dismissal store
and toasted — but nothing READ it: `reco_dismiss_qt::ids_snapshot()` had no
consumer outside its own module, so the artist came back on the next
rebuild. The card's comment promising it would "leave the rails on the next
publish" was false, because nothing filtered on publish either.

The dismissal ids now join the exclusion set fed to `compose_artist_rails`,
so the composition choke point can backfill the freed slot from the pool
instead of leaving a hole, and `apply_dismissal` drops the card from the
cached rails on the CLICK — no optimistic flip in QML.

Scope is deliberate and recorded on the card: RECOMMENDATIONS only. The
same card is mounted by Search, Label, Artist Scene, Home and the Library
grid; dismissing from one of those persists and takes effect in
Recommendations, but the card you clicked stays where it is. Hiding an
artist app-wide is the blacklist — a different store and a different row.

cc
This commit is contained in:
vicrodh committed 2026-08-16 18:54:28 -06:00
1 parent 41c1b50d61
commit 60bf5b8365
3 files changed
+76 -14

No files matched your search

+19 -6
View File
@@ -56,12 +56,25 @@ Rectangle {
property string followKind: "artist"
// --- "Not interested" (the reco-scoped dismissal) --------------------
// LIVE since QbzBlacklist landed: `dismissArtist(id, name, imageUrl)`
// writes the reco-dismissal store (NOT the artist blacklist). Kept as a
// property, not inlined, so a host whose `item.id` is not a Qobuz artist
// id can turn it off. Live BACKFILL is out of scope — the card leaves the
// rails on the next publish, not on the click (src/recommendations_qt.rs
// documents the retained-overflow drop).
// `dismissArtist(id, name, imageUrl)` writes the reco-dismissal store (NOT
// the artist blacklist). Kept as a property, not inlined, so a host whose
// `item.id` is not a Qobuz artist id can turn it off.
//
// The card now LEAVES THE RAIL ON THE CLICK: `blacklist_qt::dismiss_artist`
// calls `recommendations_qt::apply_dismissal`, which drops it from the
// cached rails and republishes. What this comment used to promise — "the
// card leaves the rails on the next publish" — never happened, because
// nothing read the dismissal store on publish either; the artist came
// straight back. The ids are part of the reco exclusion set now.
//
// OWNER RULING (2026-08-16): the live drop is for the RECOMMENDATIONS
// rails and nothing else. "This is not a blacklist or a general hide,
// only for recommendations." This card is also mounted by Search, Label,
// Artist Scene, Home and the Library grid; dismissing from one of those
// persists and takes effect in Recommendations, but the card you clicked
// stays where it is — deliberately. Do NOT "finish" this by making the
// artist vanish from Search or Library; hiding an artist app-wide is the
// BLACKLIST, a different store and a different row.
//
// `hasFollowSeam` is GONE, and the header comment it carried ("There is
// NO artist-follow invokable on the Qt bridge") was simply wrong:
+6
View File
@@ -670,6 +670,8 @@ pub fn dismiss_artist(artist_id: String, artist_name: String, image_url: String)
};
if !artist_name.is_empty() {
crate::reco_dismiss_qt::dismiss(id, &artist_name, &image_url);
// Leave the rails NOW, not on the next rebuild.
crate::recommendations_qt::apply_dismissal(&artist_id);
republish_all();
// INFO, like the reference (`main.rs:12996-13002`).
crate::toast_qt::info(qbz_i18n::t_args(
@@ -696,6 +698,10 @@ pub fn dismiss_artist(artist_id: String, artist_name: String, image_url: String)
};
let image = if image.is_empty() { image_url } else { image };
crate::reco_dismiss_qt::dismiss(id, &name, &image);
// Same live drop as the named arm. This branch is the one a search or
// pinned-rail card takes (no display name on the card), and it lands
// one network round-trip later — the card must still go.
crate::recommendations_qt::apply_dismissal(&id.to_string());
republish_all();
// Unresolvable name falls back to the generic line, exactly as the
// reference's non-reco branch does (`main.rs:13026-13033`).
+51 -8
View File
@@ -33,13 +33,16 @@
//! republishes the whole document. Rows that have not resolved yet are absent
//! rather than empty, which is what the view needs anyway.
//!
//! ## POC-NOTEs vs the Slint controller
//! - "Not interested" (reco dismissals) has no seam in this port, so the
//! retained per-rail overflow that Slint keeps for live backfill is dropped;
//! `compose_artist_rails` is still the composition choke point (exclusions +
//! cross-rail dedup + display cap), fed with the followed-artist id set.
//! - The blacklist and reco-dismissal stores are not opened by this port, so
//! the exclusion set is the followed-artist ids only.
//! ## Deltas vs the Slint controller
//! - "Not interested" IS wired: the dismissal ids join the exclusion set fed
//! to `compose_artist_rails` (the composition choke point — exclusions +
//! cross-rail dedup + display cap), and [`apply_dismissal`] drops the card
//! from the cached rails on the click. What is NOT ported is Slint's
//! retained per-rail overflow, so the freed slot backfills on the next
//! refresh rather than instantly.
//! - The artist BLACKLIST store is still not consulted here (the reco
//! dismissal store is a different one); the exclusion set is followed
//! artists + dismissals.
//! - `LocalHistory.known_artist_ids` comes from the user's followed artists
//! (the port has no local `reco` play-vector store); it seeds the "Deep cuts
//! from artists you know" row exactly as the reference does with its larger
@@ -311,6 +314,39 @@ pub(crate) fn apply_pin_change(kind: &str, id: &str, pinned: bool) {
});
}
/// "Not interested": drop the artist from the cached rails RIGHT NOW.
///
/// The exclusion set above keeps a dismissed artist out of every future
/// rebuild; this is what makes the card leave the rail on the CLICK instead of
/// on the next one. The card's own comment used to say the rail would shed it
/// "on the next publish" — it never did, because nothing filtered on publish
/// either.
///
/// No backfill from a retained overflow (the reference keeps one per rail):
/// this port drops the overflow at composition, so the rail simply gets one
/// card shorter until the next refresh re-composes it from the pool. A hole is
/// not offered — the card is REMOVED, not blanked.
///
/// Un-dismissing (Settings > Blacklist > Recommendations) does not restore the
/// card live: there is nothing cached to restore it from. It comes back with
/// the next reco refresh, which is also what the reference does.
pub(crate) fn apply_dismissal(artist_id: &str) {
if !LOADED.load(Ordering::SeqCst) {
return;
}
mutate(|rows| {
for list in [
&mut rows.rec_artists_common,
&mut rows.rec_artists_recent,
&mut rows.top_artists,
] {
list.retain(|card| card.id != artist_id);
}
});
// `false`: no cover download pass — nothing new appeared, a card left.
publish_snapshot(false);
}
/// Favourite twin of [`apply_pin_change`] for this tab's cache.
///
/// The reco document is published again on every tab re-entry, cover landing
@@ -451,7 +487,14 @@ async fn run(force: bool) {
None
};
let followed = followed_artist_ids().await;
// The exclusion set is followed artists PLUS the reco dismissals. The
// dismissals half was missing: "Not interested" wrote the store, toasted,
// and NOTHING ever read `reco_dismiss_qt::ids_snapshot()` — the artist came
// back on the very next rebuild (owner, 2026-08-16). It is the exclusion
// set, not a post-filter, so the composition choke point can backfill the
// freed slot from the pool instead of leaving a hole.
let mut followed = followed_artist_ids().await;
followed.extend(crate::reco_dismiss_qt::ids_snapshot());
let catalog = crate::external_reco_qt::CoreRecoCatalog {
runtime: crate::app(),
};