Take a hand back, which the rulings sheet has been asking for all along #109

Closed
jheaps wants to merge 1 commits from feat/casino-holdem-misdeal into feat/casino-holdem-cash-out
Owner

This tool has told dealers to redeal on a misdeal since the rulings sheet was written — first card to the wrong seat, a seat entitled to a hand dealt out, one of the first two cards exposed — and it had no way to do it. The only control that ended a live hand was Next Hand, which says out loud that it takes the money off the table without paying anybody. That's the right answer for an abandoned pot and the wrong one for a misdeal, where the blinds and the calls belong to the people who put them in.

Undo covers the first second of it: "↶ dealing the hand" is one tap. But the action history lives in memory, so a dealer three calls in — or one who has refreshed the page mid-hand — has nothing. And surviving a refresh mid-hand is exactly what this tool has spent rounds guaranteeing everywhere else.

Misdeal now sits in the header while a hand is out, and goes away when it isn't: before the deal there's nothing to take back, and afterwards it would be offering to unwind a hand that has already been paid. It says what it will do to the money —

"$25 goes back to the players who put it in, cards are cleared, and the same button deals again."

— and adds a note once two or more players have acted, because most rooms let a deal stand at that point. It doesn't refuse: which conditions make a misdeal is the dealer's call, and the sheet is right there.

What comes back is everything, including chips already swept into hand totals on an earlier street — my first version returned only the current street's and would have quietly kept a flop's betting. What stays is the button, the blinds, the straddle and anyone posting in: a misdeal is the same hand dealt again, not the next one, so the hand number doesn't move and nothing is logged.

Validated

  • Through the UI: deal 5/10, a call and a raise to $25 in the middle across three players → Misdeal → every stack is exactly $200 again, pot $0, betting closed, hand number still 1, button unmoved, bank balanced. Dealing again posts the same blinds on the same players with action in the same seat.
  • The button's own behaviour: hidden before the deal, shown during the hand, hidden again after taking it back.
  • 156 audits across 13 viewports, mouse and thumb, with the button live and a rake, a cash-out and hand history on the books: clean, no console errors. The landscape header still fits on one row at 46px with the sixth button on it.
  • 13 new tests, suite at 526, 0 failures. The sweep-return and the straddle were broken on purpose to confirm the tests fail.
This tool has told dealers to redeal on a misdeal since the rulings sheet was written — first card to the wrong seat, a seat entitled to a hand dealt out, one of the first two cards exposed — and **it had no way to do it**. The only control that ended a live hand was Next Hand, which says out loud that it takes the money off the table without paying anybody. That's the right answer for an abandoned pot and the wrong one for a misdeal, where the blinds and the calls belong to the people who put them in. Undo covers the first second of it: *"↶ dealing the hand"* is one tap. But the action history lives in memory, so a dealer three calls in — or one who has refreshed the page mid-hand — has nothing. And surviving a refresh mid-hand is exactly what this tool has spent rounds guaranteeing everywhere else. **Misdeal** now sits in the header while a hand is out, and goes away when it isn't: before the deal there's nothing to take back, and afterwards it would be offering to unwind a hand that has already been paid. It says what it will do to the money — > *"$25 goes back to the players who put it in, cards are cleared, and the same button deals again."* — and adds a note once two or more players have acted, because most rooms let a deal stand at that point. It doesn't refuse: which conditions make a misdeal is the dealer's call, and the sheet is right there. **What comes back is everything**, including chips already swept into hand totals on an earlier street — my first version returned only the current street's and would have quietly kept a flop's betting. **What stays** is the button, the blinds, the straddle and anyone posting in: a misdeal is the same hand dealt again, not the next one, so the hand number doesn't move and nothing is logged. ### Validated - Through the UI: deal 5/10, a call and a raise to $25 in the middle across three players → **Misdeal** → every stack is exactly $200 again, pot $0, betting closed, hand number still 1, button unmoved, bank balanced. Dealing again posts the same blinds on the same players with action in the same seat. - The button's own behaviour: hidden before the deal, shown during the hand, hidden again after taking it back. - **156 audits** across 13 viewports, mouse and thumb, with the button live and a rake, a cash-out and hand history on the books: clean, no console errors. The landscape header still fits on **one row at 46px** with the sixth button on it. - 13 new tests, suite at **526, 0 failures**. The sweep-return and the straddle were broken on purpose to confirm the tests fail.
jheaps added 1 commit 2026-09-02 08:23:57 -06:00
This tool has told dealers to redeal on a misdeal since the rulings sheet was
written — first card to the wrong seat, a seat entitled to a hand dealt out, one
of the first two cards exposed — and it had no way to do it. The only control
that ended a live hand was Next Hand, which says out loud that it takes the money
off the table without paying anybody. That is the right answer for an abandoned
pot and the wrong one for a misdeal, where the blinds and the calls belong to the
people who put them in.

Undo covers the first second of it: "↶ dealing the hand" is one tap. But the
action history lives in memory, so a dealer who is three calls in, or who has
refreshed the page mid-hand, has nothing — and a refresh mid-hand is exactly the
situation this tool has spent rounds making survivable everywhere else.

Misdeal appears in the header while a hand is out and goes away when it isn't:
before the deal there is nothing to take back, and afterwards it would be
offering to unwind a hand that has already been paid. It says what it will do to
the money — "$25 goes back to the players who put it in, cards are cleared, and
the same button deals again" — and adds a note when two or more players have
already acted, because most rooms let a deal stand at that point. It doesn't
refuse: which conditions make a misdeal is the dealer's call and the sheet is
right there.

What comes back is everything, including chips already swept into hand totals on
an earlier street — the first version returned only the current street's and
would have quietly kept a flop's betting. What stays is the button, the blinds,
the straddle and anyone posting in: a misdeal is the same hand dealt again, not
the next one, so the hand number doesn't move and nothing is logged.

13 new tests, with the sweep and the straddle broken on purpose to confirm they
catch it. Measured through the UI: pot $25 with three players in, take it back,
every stack is exactly $200 again, the bank still balances, and dealing again
posts the same blinds on the same players from the same button. 156 audits with
the button live, including a landscape header that stays one row at 46px.

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:07 -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#109