Skip to content

Improve Gym Deck & Seeded RNG scene: full deck grid + browser tests (CG-0MPLT8ADR0099WF3)#588

Merged
SorraTheOrc merged 5 commits into
mainfrom
feature/CG-0MPLT8ADR0099WF3-gym-deck-grid-scene-tests
May 26, 2026
Merged

Improve Gym Deck & Seeded RNG scene: full deck grid + browser tests (CG-0MPLT8ADR0099WF3)#588
SorraTheOrc merged 5 commits into
mainfrom
feature/CG-0MPLT8ADR0099WF3-gym-deck-grid-scene-tests

Conversation

@SorraTheOrc

Copy link
Copy Markdown
Member

Goal

Reimplement the GymDeckRngScene to display all 52 cards face-up in a compact grid with deterministic seeded RNG shuffle, and add scene-level browser tests to validate visual behavior.

Changes

Bug fix (critical)

  • Fixed deck initialization: was never populated before in , resulting in zero cards displayed on scene load. Added before the initial render.

New browser tests (tests/gym/GymDeckRngScene.browser.test.ts) — 6 tests

Test AC Covered
52 card sprites rendered on scene load AC 1, 6
Removed controls (Draw/Flip/Deal/Reset) absent AC 2
Seed controls present, event log absent AC 4, 5
Shuffle clears and redraws all 52 cards AC 3
Seed adjustment modifies displayed seed AC 4
Same seed reproduces identical arrangement AC 3, 9

How to test

Browser tests

npx vitest run --project browser tests/gym/GymDeckRngScene.browser.test.ts

Full suite

npx vitest run --project unit --project browser

Review focus

  • Confirm the deck initialization bug fix is correct
  • Verify browser tests meaningfully validate AC 9 (scene-level visual behavior)
  • Full test suite: 2726 tests pass, 5 skipped, 0 failures

Closes: CG-0MPLT8ADR0099WF3

Map added 5 commits May 26, 2026 00:12
…ard deck face-up in compact grid

- Replace single-card draw/flip/deal/reset UI with full-deck grid display
- All 52 cards rendered face-up in 8-column grid on scene load
- Keep seed adjustment controls and shuffle button; remove Draw/Flip/Deal/Reset buttons
- Remove event log; replace with simple status display
- Cards positioned using SLL cardDisplay zone anchors
- Cards scaled to 0.7x to fit 8-column grid within viewport
- Update GymRegistry description to reflect new scene behavior
- Update tests: remove Draw/Flip/Deal-specific tests, add full-deck and shuffle determinism tests
…s for AC 9

- Fixed critical bug: this.deck was never populated before renderFullDeckGrid()
  was called in create(), resulting in 0 cards displayed on scene load.
- Added this.deck = createStandardDeck() before renderFullDeckGrid() in create().
- Added GymDeckRngScene.browser.test.ts with 6 browser tests:
  - 52 card sprites rendered on load (AC 1, 6)
  - Removed controls absence (AC 2)
  - Seed controls present, event log absent (AC 4, 5)
  - Shuffle clears and redraws 52 cards (AC 3)
  - Seed adjustment controls modify seed value (AC 4)
  - Same seed determinism reproduces identical arrangement (AC 3, 9)
- All 2726 tests pass (2625 unit + 101 browser), 5 skipped
…n by 100px

- Cards were too small at scale 0.7 (~33x46px) and too close to the header
  area (top row at y≈122 barely below controls at y≈83).
- Increased cardScale from 0.7 to 0.85 giving ~41x55px cards with clearer
  face-up textures.
- Shifted grid center Y from 270 to 370 (SLL anchor + 100) so the top row
  clears the header/controls area comfortably.
- All 2726 tests continue to pass.
…huffle uses random seed

- Initial deck rendering now shuffles with the default seed (42) instead of
  displaying cards in unshuffled standard order.
- Shuffle button generates a random seed (0-99999) and updates the seed display
  so the user can reproduce the arrangement.
- +/- and Reset Seed buttons now automatically re-shuffle and re-render the deck
  with the adjusted seed value.
- Updated help text to reflect new behavior.
- Updated browser determinism test to use +/- auto-shuffle instead of Shuffle
  (which is now random).
- All 2726 tests pass.
@SorraTheOrc SorraTheOrc merged commit 0c21156 into main May 26, 2026
1 check passed
@SorraTheOrc SorraTheOrc deleted the feature/CG-0MPLT8ADR0099WF3-gym-deck-grid-scene-tests branch June 1, 2026 19:52
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