feat(gallery,tags): clear active filters
CI / lint (push) Successful in 3s
CI / backend-lint-and-test (push) Successful in 13s
CI / frontend-build (push) Successful in 38s
CI / intimp (push) Successful in 3m52s
CI / intapi (push) Successful in 8m5s
CI / intcore (push) Successful in 8m36s

Two gaps where a filter couldn't be removed:

- Gallery: a tag_id filter (from clicking a tag) had no indicator or clear
  control — only post_id did (PostInfoHeader). Add an "Tag: <name> ✕" chip
  that clears the filter by dropping tag_id from the URL. New lightweight
  GET /api/tags/<id> resolves the name; the store fetches it on filter set.
- Tags view: the kind chip-group used mandatory="false" — a STRING ("false"
  is truthy in JS), which made the group mandatory so the active kind chip
  couldn't be deselected. Fixed to :mandatory="false" so the filter clears.

Tests: GET /tags/<id> shape + 404; gallery store resolves filterTagName.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 23:26:04 -04:00
parent e678d1dfdf
commit 4f9464d215
6 changed files with 77 additions and 3 deletions
+13
View File
@@ -11,6 +11,19 @@ async def _mk(client, name, kind, fandom_id=None):
return (await r.get_json())["id"]
@pytest.mark.asyncio
async def test_get_tag_returns_shape_and_404(client):
tid = await _mk(client, "Lookup", "general")
resp = await client.get(f"/api/tags/{tid}")
assert resp.status_code == 200
body = await resp.get_json()
assert body["id"] == tid
assert body["name"] == "Lookup"
assert body["kind"] == "general"
resp = await client.get("/api/tags/99999999")
assert resp.status_code == 404
@pytest.mark.asyncio
async def test_patch_sets_and_clears_character_fandom(client):
fandom = await _mk(client, "Bleach", "fandom")