Replace the browser confirm boxes with undo and in-page dialogs #17

Merged
jheaps merged 1 commits from feature/casino-holdem-undo-toasts into feature/casino-holdem-mobile-table 2026-08-31 18:31:41 -06:00
Owner

Polish pass on friction during a live game. No new capabilities.

Three system confirm() dialogs sat in the middle of dealing. The worst was on Next Hand — the most-pressed button in a session, asking "are you sure?" every single time, stealing focus and, on a phone, taking over the screen.

Next Hand now just happens. A toast says where the button landed ("Next hand — button on seat 2. Cards and chip counts cleared.") with an Undo beside it for the few seconds anyone would notice a misclick.

The same undo covers the pot wizard, which is the more valuable case: paying the wrong player is a real mistake, and rolling it back restores the hand history entry and the session standings along with the seats. The snapshot is in-memory only — an undo is for the mistake you just made, not one from last night.

The two genuinely destructive actions keep a confirmation, but as an in-page dialog that matches the table instead of the browsers own. Escape or the backdrop cancels, Enter confirms, and on a phone the buttons go full width with Cancel nearest the thumb.

Validated with Playwright at 1280px and 390px. The undo assertions compare serialised state rather than eyeballing: after Next Hand → Undo, the restored state is byte-for-byte identical to before (button position, hole cards, chip amounts, fold flags). After paying a pot → Undo, the hand number, the history entry and all six standings rows roll back to exactly their prior state. For the dialogs: Cancel, Escape and backdrop-click each leave the table untouched (6 named seats preserved), Enter and the confirm button each go through, and both toasts appear. Checked the toast and dialog visually at phone width. No native confirm/alert calls remain in the casino JS. No console errors.

Based on feature/casino-holdem-mobile-table (PR #16) — merge order is #14, #15, #16, then this.

Polish pass on friction during a live game. No new capabilities. Three system `confirm()` dialogs sat in the middle of dealing. The worst was on **Next Hand** — the most-pressed button in a session, asking "are you sure?" every single time, stealing focus and, on a phone, taking over the screen. **Next Hand now just happens.** A toast says where the button landed ("Next hand — button on seat 2. Cards and chip counts cleared.") with an Undo beside it for the few seconds anyone would notice a misclick. **The same undo covers the pot wizard**, which is the more valuable case: paying the wrong player is a real mistake, and rolling it back restores the hand history entry and the session standings along with the seats. The snapshot is in-memory only — an undo is for the mistake you just made, not one from last night. **The two genuinely destructive actions keep a confirmation**, but as an in-page dialog that matches the table instead of the browsers own. Escape or the backdrop cancels, Enter confirms, and on a phone the buttons go full width with Cancel nearest the thumb. **Validated with Playwright** at 1280px and 390px. The undo assertions compare serialised state rather than eyeballing: after Next Hand → Undo, the restored state is byte-for-byte identical to before (button position, hole cards, chip amounts, fold flags). After paying a pot → Undo, the hand number, the history entry and all six standings rows roll back to exactly their prior state. For the dialogs: Cancel, Escape and backdrop-click each leave the table untouched (6 named seats preserved), Enter and the confirm button each go through, and both toasts appear. Checked the toast and dialog visually at phone width. No native confirm/alert calls remain in the casino JS. No console errors. Based on `feature/casino-holdem-mobile-table` (PR #16) — merge order is #14, #15, #16, then this.
jheaps added 1 commit 2026-08-31 18:23:08 -06:00
Three system confirm() dialogs sat in the middle of dealing. The worst was on
Next Hand — the most-pressed button in a session, asking "are you sure?" every
single time, stealing focus and, on a phone, taking over the screen.

Next Hand now just happens, and a toast says where the button landed with an
Undo beside it for the few seconds anyone would notice a misclick. The same
undo covers the pot wizard, which is the more valuable case: paying the wrong
player is a real mistake, and rolling it back restores the hand history entry
and the session standings along with the seats. The snapshot is in-memory only
— an undo is for the mistake you just made, not one from last night.

The two genuinely destructive actions keep a confirmation, but as an in-page
dialog that matches the table instead of the browser's own: Escape or the
backdrop cancels, Enter confirms, and on a phone the buttons go full width with
Cancel nearest the thumb.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps merged commit 3866bdb335 into feature/casino-holdem-mobile-table 2026-08-31 18:31:41 -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#17