alexandClaude Sonnet 5 e9fe96b900 fix: harden DiceRoll's numDice fallback against falsy-zero
Played a full game through end-to-end via Playwright (theme select, all
5 interaction types: dice/choice/color/dice/memory, game-end recap) to
find real bugs rather than guessing. The game itself held up well —
history recap correctly shows/hides dice per entry, scores and the
victory/mixed/defeat text all matched expectations, no console errors
or failed requests during a clean run.

One real latent bug found by reading the code: `numDice={dice?.length ||
2}` falls back to 2 for ANY falsy length, including a legitimate 0 (an
empty dice array, which is what choice/color/memory scenes send). It's
currently dead in practice — both call sites already guard with
`!!item.dice?.length` before rendering DiceRoll at all — but that's a
fragile invariant to rely on silently. Switched to `??` so a real empty
array is preserved instead of being coerced to a fake 2-dice default.

(The one transient issue seen mid-playthrough -- four /api/tts 503s --
turned out to be a backend restart happening concurrently with the test,
not reproducible: 5 concurrent + several sequential /api/tts calls
afterward all succeeded cleanly.)

71/71 tests passing.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-09 14:54:28 +00:00
S
Description
No description provided
3.6 MiB
Languages
Python 49.5%
JavaScript 37.9%
CSS 10.8%
HTML 1.7%
Shell 0.1%