From 9b3431db6bbb6308f5c55239c4e0ee82fa9269e1 Mon Sep 17 00:00:00 2001 From: byrongamatos Date: Sun, 5 Jul 2026 12:54:18 +0200 Subject: [PATCH] fix(v3 library): repaint persistent no-match badge after metadata tile-clear MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _clearMetaTiles removed every .v3-meta-tile node — including the new persistent 'No match' resting badge, which derives from _unmatched rather than _metaTile. A metadata rescan's tile-clear therefore dropped the badge until the next scroll re-rendered the card. Repaint it from _unmatched. Co-Authored-By: Claude Opus 4.8 (1M context) --- static/v3/songs.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/v3/songs.js b/static/v3/songs.js index 06c5ec9..188053f 100644 --- a/static/v3/songs.js +++ b/static/v3/songs.js @@ -3867,6 +3867,18 @@ function _clearMetaTiles() { Object.keys(_metaTile).forEach((fn) => { delete _metaTile[fn]; }); document.querySelectorAll('.v3-meta-tile').forEach((el) => el.remove()); + // The persistent "No match" badge derives from _unmatched (not _metaTile), + // yet shares the .v3-meta-tile class — so the blanket remove above strips it. + // Repaint the resting indicator on any rendered card so a metadata rescan's + // tile-clear doesn't silently drop it until the next scroll/re-render. + _unmatched.forEach((fn) => { + const sel = (window.CSS && CSS.escape) ? CSS.escape(fn) : fn; + document.querySelectorAll('[data-fn="' + sel + '"] [data-v3-play]').forEach((play) => { + if (play.querySelector('.v3-meta-tile')) return; + const html = enrichBadge(fn); + if (html) play.insertAdjacentHTML('beforeend', html); + }); + }); }