Live betting: tap the action instead of typing totals #21

Merged
jheaps merged 1 commits from feature/casino-holdem-live-betting into master 2026-08-31 19:19:16 -06:00
Owner

First slice of the speed-of-dealing work. Branched from master rather than stacking.

Until now a dealer kept the money in their head and typed each players total into a form. This adds the running hand: blinds post themselves, every seat has a stack, and one tap per decision moves the action on.

The action bar sits at the bottom of the screen where a thumb already is, and shows only what is true right now — Fold, then Check or Call with the amount owed, then Bet or Raise. Calling for more than a player has left says "Call all-in" rather than quoting a number they cannot cover. Raising offers min / ½ pot / pot / all-in before it offers a keypad, because a dealer calling "raise to sixty" wants a button. When everyone has answered, the bar becomes Deal Flop → Turn → River → Showdown, which hands off to the pot wizard that already existed. Winnings go straight back in front of the winner, so the next hands stacks are already right.

It hooks into what was already there. A streets chips sweep into each seats amountOverride — the same field the pot badge, pot wizard, session standings and CSV export all read. Nothing downstream changed, and a dealer who prefers the old typed workflow still has it.

Validation (Playwright)

The engine is pure and was tested as such before any UI was touched:

  • Chip conservation over 300 randomised hands (2–8 players, uneven stacks, random fold/check/call/raise/all-in): stacks + pot always equalled the starting chips exactly, no negative stacks, every hand terminated.
  • Targeted cases: a raise correctly reopens the action for players who had already called (min-raise recomputed); a short stack raising beyond its means is capped all-in; folding around ends the hand; winnings credit the right seat.
  • A full hand played through the real buttons at 390×844: blinds 1/2 posted, pot 3 → 5 → 6 preflop with stacks decrementing correctly, a flop bet of 10 and raise to 30 (pot 66), checked through turn and river, showdown offering only the two live players, $66 paid to the winner (168 → 234), next hand auto-dealt with blinds re-posted — and chips conserved across the whole hand, 1200 before and after.
  • Legacy tables migrate: a table saved before these fields existed loads with them filled in, and its base-pot workflow still computes.

Three bugs found and fixed during validation, two of them mine: the pot badge ignored chips still in front of players mid-street; resolving a pot mid-street under-counted the pot (now swept first); and the action bars 100vw centring caused horizontal overflow that dragged two seats off-screen — the root cause turned out to be a CSS Grid min-width:auto overflow in the sidebar, fixed properly rather than papered over.

Still to come

This covers betting rounds, automatic money tracking, and fast fold/call/raise. Card selection instead of typing, and double-tap / long-press gestures, are the next rounds.

First slice of the speed-of-dealing work. Branched from `master` rather than stacking. Until now a dealer kept the money in their head and typed each players total into a form. This adds the running hand: **blinds post themselves**, every seat has a **stack**, and **one tap per decision** moves the action on. **The action bar** sits at the bottom of the screen where a thumb already is, and shows only what is true right now — Fold, then Check or Call *with the amount owed*, then Bet or Raise. Calling for more than a player has left says "Call all-in" rather than quoting a number they cannot cover. Raising offers **min / ½ pot / pot / all-in** before it offers a keypad, because a dealer calling "raise to sixty" wants a button. When everyone has answered, the bar becomes Deal Flop → Turn → River → Showdown, which hands off to the pot wizard that already existed. Winnings go straight back in front of the winner, so the next hands stacks are already right. **It hooks into what was already there.** A streets chips sweep into each seats `amountOverride` — the same field the pot badge, pot wizard, session standings and CSV export all read. Nothing downstream changed, and a dealer who prefers the old typed workflow still has it. ## Validation (Playwright) The engine is pure and was tested as such before any UI was touched: - **Chip conservation over 300 randomised hands** (2–8 players, uneven stacks, random fold/check/call/raise/all-in): stacks + pot always equalled the starting chips exactly, no negative stacks, every hand terminated. - Targeted cases: a raise correctly **reopens the action** for players who had already called (min-raise recomputed); a short stack raising beyond its means is **capped all-in**; folding around ends the hand; winnings credit the right seat. - **A full hand played through the real buttons** at 390×844: blinds 1/2 posted, pot 3 → 5 → 6 preflop with stacks decrementing correctly, a flop bet of 10 and raise to 30 (pot 66), checked through turn and river, showdown offering only the two live players, $66 paid to the winner (168 → 234), next hand auto-dealt with blinds re-posted — and **chips conserved across the whole hand, 1200 before and after**. - **Legacy tables migrate**: a table saved before these fields existed loads with them filled in, and its base-pot workflow still computes. Three bugs found and fixed during validation, two of them mine: the pot badge ignored chips still in front of players mid-street; resolving a pot mid-street under-counted the pot (now swept first); and the action bars `100vw` centring caused horizontal overflow that dragged two seats off-screen — the root cause turned out to be a CSS Grid `min-width:auto` overflow in the sidebar, fixed properly rather than papered over. ## Still to come This covers betting rounds, automatic money tracking, and fast fold/call/raise. **Card selection instead of typing**, and **double-tap / long-press gestures**, are the next rounds.
jheaps added 1 commit 2026-08-31 19:01:31 -06:00
Until now a dealer kept the money in their head and typed each player's total
into a form. This adds the running hand: blinds post themselves, every seat has
a stack, and one tap per decision moves the action on.

The bar sits at the bottom of the screen where a thumb already is, and shows
only what's true right now — Fold, then Check or Call with the amount owed, then
Bet or Raise. Calling more than a player has left says "Call all-in" rather than
quoting a number they can't cover. Raising offers min, half pot, pot and all-in
before it offers a keypad, because a dealer calling "raise to sixty" wants a
button. When everyone has answered, the bar becomes Deal Flop, then Turn, River,
and finally Showdown, which hands off to the pot wizard that already existed.
Winnings go straight back in front of the winner, so the next hand's stacks are
already right.

The money hooks into what was already there rather than running beside it: a
street's chips sweep into each seat's amountOverride, the same field the pot
badge, the pot wizard, the session standings and the CSV export all read. So
nothing downstream changed, and a dealer who prefers the old typed workflow
still has it.

Tables saved before this exist without any of these fields, so load() fills
them in rather than making someone reset a table mid-session.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps merged commit 01a1728971 into master 2026-08-31 19:19:16 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jheaps/JoshHeaps.Net#21