Skip to main content

F022 — Card Display

FieldValue
IDF022
Phase3 — UI
JiraHEDGE-135
StatusTS ✅ fixed · JS ⬜ · UMA ⬜

Business Rule

At the hole stage, all hole cards for all hands must be face-up and visible to the player. Community cards (flop/turn/river) are dealt face-down and revealed progressively as each betting stage is reached.

JavaScript Reference

JS Source: HedgeEmJavaScriptClient/odobo/src/js/control.js The JS state machine deals all 13 cards (2 per hand × up to 4 hands + 5 community) via a sequence of CC_DEAL_CARDx states, all of which are CC_AUTO_ADVANCE. Each call to DealCard() reveals the card immediately. All hole cards are face-up before the first betting window (CC_ALLOW_BETS_1) is reached.
// control.js — CC_DEAL_CARD1 … CC_DEAL_CARD13 (auto-advance, no player input)
// DealCard() renders each card face-up as it is dealt.
// After CC_DEAL_CARD13 → CC_ALLOW_BETS_1 (hole betting window opens).
Community cards are initially rendered face-down and flipped when their stage is reached.

TypeScript Implementation

File: standalone_reference_client/src/scenes/GameScene.ts

Bug fixed (HEDGE-135)

The original face-up logic was:
const faceUp = hand === 0 || dealStatus >= 1;
This only revealed hole cards for hand 0. Hands 1, 2, and 3 were face-down at hole stage. Fix applied:
// All hole cards face-up once dealt — JS CC_DEAL_CARDx reveals all hands before CC_ALLOW_BETS_1.
// HEDGE-135.
const faceUp = true;
Community cards (hand === -1) are handled separately: face-up when dealStatus >= the stage that reveals them (flop=1, turn=2, river=3).

Acceptance Criteria

#CriterionJSTSUMA
AC1All hole cards face-up at hole stage for all hands
AC2Community cards face-down at hole stage
AC3Flop cards revealed when flop stage reached
AC4Turn card revealed when turn stage reached
AC5River card revealed when river stage reached
AC6cardData.length === 13 at page load (no player interaction)

Version Parity

VersionStatusNotes
JS (reference)⬜ Not auditedAuto-reveals via CC_DEAL_CARDx — assumed correct
TS✅ FixedHEDGE-135 — was only revealing hand 0
UMA⬜ Not auditedPhase 5

Test Coverage

TestLocation
All hole cards face-up at hole stagetests/features/F022-card-display.spec.ts
Smoke — game renders at hole stagestandalone_reference_client/tests/e2e/smoke.spec.ts