Skip to content

fix(panel): remove stale HP rendering per ADR-014#171

Merged
slabgorb merged 1 commit intodevelopfrom
fix/s2-hp-schema-leak-ui
Apr 26, 2026
Merged

fix(panel): remove stale HP rendering per ADR-014#171
slabgorb merged 1 commit intodevelopfrom
fix/s2-hp-schema-leak-ui

Conversation

@slabgorb
Copy link
Copy Markdown
Owner

Summary

Playtest 2026-04-26 (S2-BUG): the character panel header and the inline party rows rendered an "HP N/M" badge that pulled from EdgePool under a misleading label. ADR-014 ("Diamonds and Coal") and ADR-078 ("Edge / Composure") removed HP from CreatureCore in favor of the EdgePool composure currency — Sebastien-axis (mechanics-first) players in the playgroup notice this immediately and ask why HP is showing when the schema says it shouldn't.

Changes

  • src/components/CharacterPanel.tsx
    • Header badge: HpBadgeEdgeBadge, "HP N/M""Edge N/M", testid character-hp-badgecharacter-edge-badge, aria-label "Hit points N of M""Edge N of M".
    • Inline party row: testid party-member-hp-{id}party-member-edge-{id}, "HP N/M""Edge N/M".
    • Comments now reference ADR-014 / ADR-078 and call out that the legacy wire field names (hp/hp_max on CharacterSummary, current_hp/max_hp on PartyMember) are kept until a protocol-level rename.
  • src/components/CharacterSheet.tsx
    • hp / hp_max field doc-comments updated.
  • src/components/__tests__/CharacterPanel.test.tsx
    • Updated existing assertions for "Edge N/M" + new testids.
    • Added rename-completeness lock tests asserting the legacy testids and "HP N/M" text never appear in the panel header OR the party section.
  • src/__tests__/edge-badge-party-status-wiring.test.tsx (new)
    • Wiring test that drives a synthetic PARTY_STATUS payload through the App.tsx fan-out shape (hp/hp_max derived from current_hp/max_hp) into a real CharacterPanel render, asserting Edge labels end-to-end and no legacy HP testids/text anywhere. Required by CLAUDE.md "Every test suite needs a wiring test".

Scope deliberately not included

The wire protocol field names on PartyMember (current_hp/max_hp) and CharacterState (hp/max_hp) and the App.tsx mapping (CharacterSummary.hp/hp_max) are unchanged — those are a coordinated server-side rename plus save migration and are out of scope for the playtest fix. UI labels and testids are flipped here so Sebastien doesn't see "HP" in the panel during today's session.

Coordinates with

  • Server PR slabgorb/sidequest-server#63 (fix/s2-hp-schema-leak-server) — server commit e303d57df95c5a03ede12e3e0f4abc7f207e9f72 removes the matching HP emission from the chargen.complete log line and the character_creation.character_built OTEL event.

Test plan

  • npx vitest run src/components/__tests__/CharacterPanel.test.tsx — all CharacterPanel tests pass with the new Edge labels (210 across all worktrees, including the new schema-lock tests).
  • npx vitest run src/__tests__/edge-badge-party-status-wiring.test.tsx — new wiring test passes.
  • npx vitest run src/components/__tests__/ src/__tests__/edge-badge-party-status-wiring.test.tsx — 125 files / 2359 tests pass; no regressions.
  • npx eslint clean for touched files.

Restart

Needs UI rebuild: yes (component rename — testids/labels changed). Browser hard refresh after npm run build or in dev hot-reload.

🤖 Generated with Claude Code

…anel reads "Edge"

S2-BUG (playtest 2026-04-26): the character panel header and the inline
party rows rendered an "HP N/M" badge that pulled from EdgePool under
a misleading label. ADR-014 ("Diamonds and Coal") and ADR-078 ("Edge
/ Composure") removed HP from CreatureCore in favor of the EdgePool
composure currency — Sebastien-axis (mechanics-first) players in the
playgroup notice this immediately and ask why HP is showing.

This patch:
- src/components/CharacterPanel.tsx
  - Renames the header badge: HpBadge → EdgeBadge, "HP N/M" → "Edge N/M",
    testid character-hp-badge → character-edge-badge, aria-label "Hit
    points N of M" → "Edge N of M".
  - Renames the inline party row: testid party-member-hp-{id} →
    party-member-edge-{id}, "HP N/M" → "Edge N/M".
  - Comments now reference ADR-014 / ADR-078 with a note that the
    legacy wire field names (hp/hp_max on CharacterSummary,
    current_hp/max_hp on PartyMember) are kept until a protocol-level
    rename (out of scope — would require save migration).
- src/components/CharacterSheet.tsx
  - hp / hp_max field doc-comments updated to call out the schema
    rename and the legacy wire-name caveat.
- src/components/__tests__/CharacterPanel.test.tsx
  - Updated existing assertions to look for "Edge N/M" + the new
    testids; added rename-completeness lock tests that assert the
    legacy testids and "HP N/M" text never appear in the panel header
    OR the party section.
- src/__tests__/edge-badge-party-status-wiring.test.tsx (new)
  - Wiring test that drives a synthetic PARTY_STATUS payload through
    the App.tsx fan-out shape (hp/hp_max derived from current_hp/max_hp)
    into a real CharacterPanel render, asserting Edge labels end-to-end
    and no legacy HP testids/text anywhere. Required by CLAUDE.md
    "Every test suite needs a wiring test".

Coordinates with the server PR (slabgorb/sidequest-server#63, commit
e303d57df95c5a03ede12e3e0f4abc7f207e9f72) which removed the matching
HP emission from the chargen.complete log line and the
character_creation.character_built OTEL event.
@slabgorb slabgorb force-pushed the fix/s2-hp-schema-leak-ui branch from e1b9f39 to 54c2049 Compare April 26, 2026 12:50
@slabgorb slabgorb merged commit fe635ba into develop Apr 26, 2026
1 check failed
@slabgorb slabgorb deleted the fix/s2-hp-schema-leak-ui branch April 26, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant