fix(webapp): rules search results say the level too ("creature 2") (#731) #856
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/rule-card-level-label"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This comes from the owner's answer to lane 5's Find departures: accept them, and add the level everywhere.
The cards were already done.
cardKinds.jskindOf()gained the level ina567348a, and every card surface uses that helper: the table cards, the stage, the preview, the GM's phone view, the sweep, and Find's shelf rows.The one place still missing it was rules search results, both Find's "In the rules" and the app bar's search. Both read
SearchItem.linefromsearch.py_rules(), which built the line fromkindalone, even though the reference search already returnslevel.The fix is a new helper,
_rule_kind_text(kind, level), which gives "creature 2" (0 and −1 included, matchingkindOf) or the bare kind when there's no level.Tests: a new
test_a_rule_with_a_level_shows_it_in_the_line.test_campaign_searchandtest_reference_searchpass (45), and ruff is clean. The frontend is unchanged.🤖 Generated with Claude Code