fix(webapp): rules search results say the level too ("creature 2") (#731) #856

Merged
claude-bot merged 4 commits from fix/rule-card-level-label into main 2026-09-26 22:01:15 +00:00
Collaborator

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.js kindOf() gained the level in a567348a, 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.line from search.py _rules(), which built the line from kind alone, even though the reference search already returns level.

The fix is a new helper, _rule_kind_text(kind, level), which gives "creature 2" (0 and −1 included, matching kindOf) 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_search and test_reference_search pass (45), and ruff is clean. The frontend is unchanged.

🤖 Generated with Claude Code

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.js` `kindOf()` gained the level in `a567348a`, 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.line` from `search.py` `_rules()`, which built the line from `kind` alone, even though the reference search already returns `level`. The fix is a new helper, `_rule_kind_text(kind, level)`, which gives "creature 2" (0 and −1 included, matching `kindOf`) 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_search` and `test_reference_search` pass (45), and ruff is clean. The frontend is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kindOf() already put a rule's level on the shelf card's own kind label
(a567348a, "creature 2"), but Find's and the app-bar search's rules
results are built server-side in search.py's _rules(), a separate path
that composed the line from kind alone. Add _rule_kind_text(), the same
"kind level" shape, so a hit reads the same word as the card it opens
into.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fix(webapp): correct the issue reference on the level fix
All checks were successful
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m0s
CI / Backend lint (ruff) (pull_request) Successful in 31s
CI / Bot tests and audit (pull_request) Successful in 2m1s
CI / Feedback site tests (pull_request) Successful in 47s
CI / Bot/backend version sync (pull_request) Successful in 28s
CI / Docker image build (pull_request) Successful in 18s
CI / Does this change touch the recording path? (pull_request) Successful in 18s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Frontend tests, audit, and build (pull_request) Successful in 19m41s
CI / Backend migration, tests, and audit (pull_request) Successful in 40m2s
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Successful in 18m45s
85a2bde9e5
Cited #852 by mistake (the base branch's last merged PR, unrelated) —
this is lane 5's rule-card work, #731.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into fix/rule-card-level-label
All checks were successful
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 52s
CI / Bot tests and audit (pull_request) Successful in 2m1s
CI / Backend lint (ruff) (pull_request) Successful in 36s
CI / Feedback site tests (pull_request) Successful in 44s
CI / Bot/backend version sync (pull_request) Successful in 26s
CI / Docker image build (pull_request) Successful in 20s
CI / Does this change touch the recording path? (pull_request) Successful in 23s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Backend migration, tests, and audit (pull_request) Successful in 13m50s
CI / Frontend tests, audit, and build (pull_request) Successful in 45m26s
CI / End-to-end journeys (desktop, phone, keyboard-only) (pull_request) Successful in 17m48s
87a8a668a3
# Conflicts:
#	CHANGELOG.md
Sign in to join this conversation.
No description provided.