Skip to content

Redesign record-game flow (stepped entry) — behavioral#96

Open
b006n97 wants to merge 1 commit into
pr-7-gamesfrom
pr-8-record-game
Open

Redesign record-game flow (stepped entry) — behavioral#96
b006n97 wants to merge 1 commit into
pr-7-gamesfrom
pr-8-record-game

Conversation

@b006n97

@b006n97 b006n97 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Rework game entry (CreateGame, Game, and the legacy jp/hk game screens) onto a stepped UI with clearer per-round requirements, and consolidate create routing:

  • StepSection / RoundRequirements / TransactionTypeSelector (replacing TransactionTypeButtonList) / PlayerScoreCard drive the new entry flow; Footer, PlayerButtonRow, PointsInput, DropdownInput, TableDisplay restyled.
  • App.tsx: /games/create/{jp,hk}[/casual] collapse to a single query-param /games/create page; legacy URLs redirect carrying variant/type.

BEHAVIORAL CHANGES (intentional, confirmed):

  • constants.ts default hand: JP_UNDEFINED_HAND {han:-2,fu:10} -> {han:1,fu:30}; HK_UNDEFINED_HAND (-1) renamed/retuned to HK_DEFAULT_HAND (3). Entry now starts from a valid minimum hand instead of a sentinel.
  • assignRoundAction centralizes role-exclusivity (a player can't be winner and loser at once) across every assignment path.
  • getUnmet{Japanese,HongKong}RoundRequirements add soft, non-throwing validation so the UI can gate Submit; the throwing validators remain the submit-time safety net.

TESTING GAP: assignRoundAction / isValidHand / getUnmet*RoundRequirements are pure and unit-testable, but the frontend has no test runner configured. Cover via a follow-up (add vitest to frontend) or manual QA of deal-in / self-draw / pao / nagashi / deck-out entry in both variants before release.

Rework game entry (CreateGame, Game, and the legacy jp/hk game screens) onto a
stepped UI with clearer per-round requirements, and consolidate create routing:
- StepSection / RoundRequirements / TransactionTypeSelector (replacing
  TransactionTypeButtonList) / PlayerScoreCard drive the new entry flow;
  Footer, PlayerButtonRow, PointsInput, DropdownInput, TableDisplay restyled.
- App.tsx: /games/create/{jp,hk}[/casual] collapse to a single query-param
  /games/create page; legacy URLs redirect carrying variant/type.

BEHAVIORAL CHANGES (intentional, confirmed):
- constants.ts default hand: JP_UNDEFINED_HAND {han:-2,fu:10} -> {han:1,fu:30};
  HK_UNDEFINED_HAND (-1) renamed/retuned to HK_DEFAULT_HAND (3). Entry now
  starts from a valid minimum hand instead of a sentinel.
- assignRoundAction centralizes role-exclusivity (a player can't be winner and
  loser at once) across every assignment path.
- getUnmet{Japanese,HongKong}RoundRequirements add soft, non-throwing
  validation so the UI can gate Submit; the throwing validators remain the
  submit-time safety net.

TESTING GAP: assignRoundAction / isValidHand / getUnmet*RoundRequirements are
pure and unit-testable, but the frontend has no test runner configured. Cover
via a follow-up (add vitest to frontend) or manual QA of deal-in / self-draw /
pao / nagashi / deck-out entry in both variants before release.
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