Skip to content

fix(ui): clear dice TARGET + result widget after narrator resolves the roll#157

Merged
slabgorb merged 1 commit intodevelopfrom
fix/combat-dice-result-clear-after-resolve
Apr 24, 2026
Merged

fix(ui): clear dice TARGET + result widget after narrator resolves the roll#157
slabgorb merged 1 commit intodevelopfrom
fix/combat-dice-result-clear-after-resolve

Conversation

@slabgorb
Copy link
Copy Markdown
Owner

Summary

  • After a combat roll resolved, the TARGET banner (TARGET 18 · need 17 on d20) and result badge (Rolled 4 vs 18 Fail) stayed pinned to the screen through the narrator's next turn. When the next action buttons became clickable, players read the stale DC as the target for the next click — medium-priority UI ambiguity surfaced in playtest-pingpong 2026-04-24.
  • Fix: clear diceRequest + diceResult inside the NARRATION_END branch in App.tsx. That is the same turn-boundary signal that already re-enables input and clears a resolved confrontation — no new protocol message, no component rewrite. InlineDiceTray / DiceOverlay are prop-driven, so both the banner and the result readout return to a neutral state (and the 3D die idles) until the next DICE_REQUEST triggers another throw.
  • Added a wiring test in src/__tests__/dice-overlay-wiring-34-5.test.ts that pins setDiceRequest(null) + setDiceResult(null) inside the NARRATION_END branch, plus a regression guard on the overlay prop surface so the clear actually reaches the UI.

Test plan

  • npx vitest run src/__tests__/dice-overlay-wiring-34-5.test.ts — both new tests pass.
  • Full npx vitest run: 45 failed / 1112 passed. Baseline on develop was 46 failed / 1109 passed — no new regressions from this change (the ~45 pre-existing failures are in unrelated suites: Three.js Canvas asset loading, legacy confrontation-wiring refactor drift, etc.).
  • Manual: enter Wasteland Brawl, pick a beat, let the roll resolve, wait for the narrator's next NARRATION_END — confirm the TARGET banner + "Rolled N vs M — Fail" badge disappear and the d20 sits idle until the next beat is clicked.

🤖 Generated with Claude Code

…e roll

After a combat roll resolved, the InlineDiceTray's TARGET banner and
"Rolled N vs M — Fail" badge stayed pinned through the next narration
cycle. When the next action buttons became clickable, the previous
roll's numbers were still on screen — players read the stale DC as
the target for their next click.

App.tsx now clears diceRequest and diceResult inside the NARRATION_END
branch (the same turn-boundary signal that re-enables input and clears
a resolved confrontation). The InlineDiceTray and DiceOverlay are
prop-driven, so both widgets return to a neutral resting state without
further changes — the 3D die stays idle until a new DICE_REQUEST
triggers the next throw.

Added a wiring test in dice-overlay-wiring-34-5.test.ts that asserts
both setters are invoked inside the NARRATION_END branch, plus a
regression guard that the overlay props still read from the cleared
state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@slabgorb slabgorb merged commit cf8d38a into develop Apr 24, 2026
1 check failed
@slabgorb slabgorb deleted the fix/combat-dice-result-clear-after-resolve branch April 24, 2026 09:33
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