Make the pot button offer a pot-sized raise #94

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-pot-sized-raise into fix/casino-holdem-chips-to-count-out
Owner

The raise pad worked its quick amounts out as "the current bet plus the pot as it stands". That leaves out the raiser's own call, which is in the pot before the raise is measured off it, so every amount came out short.

Measured pre-flop at 1/2, four-handed:

Min ½ pot Pot
offered $4 $4 $5
correct $4 $4.50 $7

A pot raise there is: call the $2, which makes the pot $5, then raise $5. The half-pot was so short it clamped up to the minimum and sat next to the Min button showing the same $4 twice — which is how it went unnoticed, since it looked like a table where those two happened to coincide.

"Pot" is not a suggestion. It's a definite number players say out loud, and a dealer tapping the button that claims to be it should be recording what was actually said.

What changed

The rule moves into Betting.potRaiseTo, next to the other rules and testable on its own, rather than living as arithmetic inside a DOM renderer:

raise to = the current bet + (pot + what they owe) × fraction

Facing no bet it comes out as a plain pot-sized bet, because both the bet and the amount owed are zero. Facing a bet it comes out as three times the bet plus the dead money, which is the shape a player checks it against.

Verification

10 new tests in tests/holdem/potRaise.test.js: pre-flop from each of the three positions (the small blind owes less so their pot raise is smaller; the big blind owes nothing so it's just the pot), post-flop facing a bet checked against both the long form and 3×bet + dead money, facing no bet, a non-existent seat, that no fraction ever lands below a call, and that cent-sized blinds don't drift. Suite at 380 tests, 0 failures.

Playwright MCP on a phone viewport: pre-flop the pad now reads Min $4 · ½ pot $4.50 · Pot $7 · All-in $500; tapping Pot sets the draft to 7 and confirming lands Dee committed $7 with the pot at $10. On the flop facing a $10 bet into a $38 pot it reads Min $20 · ½ pot $34 · Pot $58, all three checked by hand. Contrast and layout audit clean, no console errors.

Correction to #93. In that PR I said the standings' wide five-column layout has never rendered at any viewport. That was wrong, and I've fixed the description there. Measured across 390–3440px: it fires at 768px, where the sidebar becomes a full-width panel and the container reaches 41rem. It's unreachable only on desktop, where the sidebar is pinned at 320px.

Stacked on fix/casino-holdem-chips-to-count-out.

🤖 Generated with Claude Code

https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb

The raise pad worked its quick amounts out as *"the current bet plus the pot as it stands"*. That leaves out the raiser's own call, which is in the pot before the raise is measured off it, so every amount came out short. Measured pre-flop at 1/2, four-handed: | | Min | ½ pot | Pot | |---|---|---|---| | offered | $4 | **$4** | **$5** | | correct | $4 | **$4.50** | **$7** | A pot raise there is: call the $2, which makes the pot $5, then raise $5. The half-pot was so short it clamped up to the minimum and sat next to the Min button showing **the same $4 twice** — which is how it went unnoticed, since it looked like a table where those two happened to coincide. "Pot" is not a suggestion. It's a definite number players say out loud, and a dealer tapping the button that claims to be it should be recording what was actually said. **What changed** The rule moves into `Betting.potRaiseTo`, next to the other rules and testable on its own, rather than living as arithmetic inside a DOM renderer: raise to = the current bet + (pot + what they owe) × fraction Facing no bet it comes out as a plain pot-sized bet, because both the bet and the amount owed are zero. Facing a bet it comes out as three times the bet plus the dead money, which is the shape a player checks it against. **Verification** 10 new tests in `tests/holdem/potRaise.test.js`: pre-flop from each of the three positions (the small blind owes less so their pot raise is smaller; the big blind owes nothing so it's just the pot), post-flop facing a bet checked against both the long form and `3×bet + dead money`, facing no bet, a non-existent seat, that no fraction ever lands below a call, and that cent-sized blinds don't drift. Suite at 380 tests, 0 failures. Playwright MCP on a phone viewport: pre-flop the pad now reads `Min $4 · ½ pot $4.50 · Pot $7 · All-in $500`; tapping Pot sets the draft to 7 and confirming lands Dee committed $7 with the pot at $10. On the flop facing a $10 bet into a $38 pot it reads `Min $20 · ½ pot $34 · Pot $58`, all three checked by hand. Contrast and layout audit clean, no console errors. **Correction to #93.** In that PR I said the standings' wide five-column layout has never rendered at any viewport. That was wrong, and I've fixed the description there. Measured across 390–3440px: it fires at 768px, where the sidebar becomes a full-width panel and the container reaches 41rem. It's unreachable only on desktop, where the sidebar is pinned at 320px. Stacked on `fix/casino-holdem-chips-to-count-out`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps added 1 commit 2026-09-01 23:52:08 -06:00
The raise pad worked its quick amounts out as "the current bet plus the pot as it
stands". That leaves out the raiser's own call, which is in the pot before the raise
is measured off it, so every amount came out short. Measured pre-flop at 1/2:

    offered:  Min $4    ½ pot $4    Pot $5
    correct:  Min $4    ½ pot $4.50  Pot $7

A pot raise there is: call the $2, which makes the pot $5, then raise $5. And the
half-pot was so short it clamped up to the minimum and sat next to the Min button
showing the same $4 twice, which is how it went unnoticed — it looked like a table
where those two happened to coincide.

"Pot" is not a suggestion. It is a definite number players say out loud, and a dealer
tapping the button that claims to be it should be recording what was actually said.

The rule moves into Betting.potRaiseTo, next to the other rules and testable on its
own, rather than living as arithmetic inside a DOM renderer:

    raise to = the current bet + (pot + what they owe) × fraction

Facing no bet it comes out as a plain pot-sized bet, because both the bet and the
amount owed are zero. Facing a bet it comes out as three times the bet plus the dead
money, which is the shape a player checks it against.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-02 09:58:01 -06:00

Pull request closed

Please reopen this pull request to perform a merge.
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#94