feat(v3 library): persistent "no match" badge + Unmatched quick filter (#781)

* feat(v3 library): persistent "no match" badge + Unmatched quick filter

The Refresh-Metadata batch (#764) shows a transient per-tile "no match" only
while a pass runs, so the unmatched pile goes quiet at rest. Two additions make
it visible + reachable:

- Persistent per-card "No match" badge: query_page now marks each row
  `unmatched` (a cheap failed-set membership like favs/estd), and enrichBadge
  paints a subtle resting marker for those cards — tracked in a `_unmatched` set
  so a batch tile clearing falls back to it instead of wiping it. A live batch
  tile still wins while a pass runs.
- "Unmatched" toolbar toggle (local-only): one click applies the same filter as
  the drawer's Match → Unmatched (match_state='failed'), so the no-match pile is
  a click away right after a batch. Re-queries + reflects active state.

Test: query_page flags a failed row + the match=unmatched filter returns it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(v3 library): repaint persistent no-match badge after metadata tile-clear

_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) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: byrongamatos <xasiklas@gmail.com>
This commit is contained in:
ChrisBeWithYou
2026-07-05 21:00:30 +02:00
committed by GitHub
co-authored by Claude Opus 4.8 byrongamatos
parent 92dc321fdf
commit 3e036e3db6
3 changed files with 86 additions and 10 deletions
+13
View File
@@ -614,3 +614,16 @@ def test_artist_filter_is_case_insensitive(client, seeded):
data = _get(client, artist="a band")
assert data["total"] == 1
assert data["songs"][0]["filename"] == "a.archive"
def test_unmatched_flag_and_quick_filter(server_mod, client):
# A per-card "no match" badge needs the row to carry the enrichment state.
_put(server_mod, filename="a.archive", title="Matched", artist="A")
_put(server_mod, filename="b.archive", title="Missed", artist="B")
server_mod.meta_db.apply_enrichment_match("b.archive", "h", "failed") # no-match
rows = {s["filename"]: s for s in server_mod.meta_db.query_page()[0]}
assert rows["b.archive"]["unmatched"] is True
assert rows["a.archive"]["unmatched"] is False
# The "Unmatched" quick-filter (match=unmatched) returns only the failed song.
fns = [s["filename"] for s in client.get("/api/library?match=unmatched").json()["songs"]]
assert fns == ["b.archive"]