docs(plan): inventory spell filters implementation plan; spec: reuse existing slots UI

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-14 23:32:53 +02:00
parent aa3139b586
commit bd9c1ba556
2 changed files with 445 additions and 14 deletions

View file

@ -23,9 +23,11 @@ back only rings carrying BOTH cantrips.
- **AND semantics** for multiple checked cantrips (matches legacy intent):
an item must carry every checked cantrip.
- **Multi-select checkboxes** for jewelry type (Ring, Bracelet, Necklace,
Trinket), shown only when the equipment-type selector is on Jewelry.
None checked = all jewelry.
- **Jewelry type: reuse the existing Equipment Slots card.** During planning
we found `inventory.html` already has Ring / Bracelet / Neck / Trinket
checkboxes (`#all-slots`) that `inventory.js` sends as `slot_names`, which
the Go backend fully supports. No new UI — verify the existing checkboxes
compose correctly with the new spell filters.
- **Also wire `spell_contains`** (the dead free-text box) and `has_spell`
(exact-name variant referenced by the agent tools) in the same pass — same
mechanism, nearly free.
@ -65,18 +67,14 @@ filters, sorting, pagination, and the count query:
Spell IDs originate from our own enum map, not user input, but are still
bound via the existing `argBuilder` positional params for consistency.
## Frontend design (`static/inventory.html` + `static/inventory.js`)
## Frontend design
- New "Jewelry Type" filter card with checkboxes **Ring, Bracelet, Necklace,
Trinket**, shown only when equipment type = Jewelry (same show/hide pattern
as the weapon-type selector).
- `inventory.js` maps checked boxes to `slot_names` CSV using the backend's
slot vocabulary: Ring→`Ring`, Bracelet→`Bracelet`, Necklace→`Neck`,
Trinket→`Trinket`. None checked → param omitted.
- The cantrip grid and spell text box already send the correct params — no
JS changes needed for those.
- The existing `slotNameClause` per-type OR approaches (including the
Trinket clause's `%bracelet%` exclusion) are reused untouched.
**No frontend changes.** The cantrip grid, spell text box, and Equipment
Slots checkboxes (Ring / Bracelet / Neck / Trinket) already send the correct
params (`legendary_cantrips`, `spell_contains`, `slot_names`); the existing
`slotNameClause` per-type OR approaches (including the Trinket clause's
`%bracelet%` exclusion) are reused untouched. Live verification must confirm
jewelry-type + cantrip searches compose end-to-end.
## Testing