feat(gallery,tags): clear active filters
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user