Seat a player when the dealer names one, and stop hiding the bar on a full table #91

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-seating-a-table into fix/casino-holdem-showdown-order
Owner

The first thing anybody does with this tool is seat the table, and it didn't work.

Measured on a fresh table: click a seat, type a name, repeat six times. Result — six names on the felt, six seats still not in the hand, and no action bar at all. No "Post blinds & deal", no explanation, nothing to press. Six people at the table and a blank screen with no way forward.

Three things were wrong, and each hid the next.

  1. Naming a chair and dealing that chair in were separate acts. Putting a name on an empty chair is somebody sitting down, so it now deals them in. Only a chair that was empty — no name and nobody in it. Renaming someone who is sitting out is a correction, not an arrival, and dealing them back in over a typo would be the tool overruling the dealer.

  2. The action bar hid itself whenever no seat was live. That rule was written for an empty felt and caught a named one too. A table with names on it is not an empty table; it's a table the dealer needs to be told something about.

  3. The seat editor never redrew the bar. It refreshes narrowly on purpose — a full render on every keystroke would take the name field out from under the dealer mid-word — but the bar answers "is there a table here at all", and seating somebody is exactly what changes that answer. This one is older than the others: even ticking In hand by hand left the bar hidden until something else happened to redraw. Verified the fix keeps focus and the caret where they were, typing a character at a time.

For the states that can still reach a benched table — everyone sat out, or a save from before naming seated people — the prompt names them and offers "Deal in all 6" rather than a hunt through six seat editors.

Verification

12 new tests in tests/holdem/seatingTheTable.test.js: the bar's empty-vs-named distinction (including whitespace not being a player), naming an empty chair versus renaming a sat-out one versus a chair already in a hand mid-fold, and the deal-everybody-in path not sweeping up unnamed chairs. ActionBar is now loaded by the test harness so its visibility rule can be tested directly. Suite at 362 tests, 0 failures.

Playwright MCP end to end from a cleared localStorage: typed six names one character at a time — bar appears at the first name reading "1 player · Only one player is dealt in — a hand needs two", focus and caret stay in the name field throughout, and at six it reads "6 players · Ben posts $1, Cal posts $2 · Post blinds & deal". Dealing then posts $1/$2 with action to Dee. Renaming a sat-out player left them sat out. The benched-table recovery checked at 390/768/1280 — 44px tap on touch, undoable, no overflow, no sideways scroll, contrast and layout audit clean, no console errors.

Stacked on fix/casino-holdem-showdown-order.

🤖 Generated with Claude Code

https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb

The first thing anybody does with this tool is seat the table, and it didn't work. Measured on a fresh table: click a seat, type a name, repeat six times. Result — six names on the felt, **six seats still not in the hand, and no action bar at all**. No "Post blinds & deal", no explanation, nothing to press. Six people at the table and a blank screen with no way forward. **Three things were wrong, and each hid the next.** 1. **Naming a chair and dealing that chair in were separate acts.** Putting a name on an empty chair is somebody sitting down, so it now deals them in. Only a chair that was *empty* — no name and nobody in it. Renaming someone who is sitting out is a correction, not an arrival, and dealing them back in over a typo would be the tool overruling the dealer. 2. **The action bar hid itself whenever no seat was live.** That rule was written for an empty felt and caught a named one too. A table with names on it is not an empty table; it's a table the dealer needs to be told something about. 3. **The seat editor never redrew the bar.** It refreshes narrowly on purpose — a full render on every keystroke would take the name field out from under the dealer mid-word — but the bar answers "is there a table here at all", and seating somebody is exactly what changes that answer. This one is older than the others: even ticking *In hand* by hand left the bar hidden until something else happened to redraw. Verified the fix keeps focus and the caret where they were, typing a character at a time. For the states that can still reach a benched table — everyone sat out, or a save from before naming seated people — the prompt names them and offers **"Deal in all 6"** rather than a hunt through six seat editors. **Verification** 12 new tests in `tests/holdem/seatingTheTable.test.js`: the bar's empty-vs-named distinction (including whitespace not being a player), naming an empty chair versus renaming a sat-out one versus a chair already in a hand mid-fold, and the deal-everybody-in path not sweeping up unnamed chairs. `ActionBar` is now loaded by the test harness so its visibility rule can be tested directly. Suite at 362 tests, 0 failures. Playwright MCP end to end from a cleared localStorage: typed six names one character at a time — bar appears at the first name reading *"1 player · Only one player is dealt in — a hand needs two"*, focus and caret stay in the name field throughout, and at six it reads *"6 players · Ben posts $1, Cal posts $2 · Post blinds & deal"*. Dealing then posts $1/$2 with action to Dee. Renaming a sat-out player left them sat out. The benched-table recovery checked at 390/768/1280 — 44px tap on touch, undoable, no overflow, no sideways scroll, contrast and layout audit clean, no console errors. Stacked on `fix/casino-holdem-showdown-order`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps added 1 commit 2026-09-01 23:09:11 -06:00
The first thing anybody does with this tool is seat the table, and it didn't work.
Measured on a fresh table: click a seat, type a name, repeat six times — six names on
the felt, six seats still not in the hand, and no action bar at all. No "post blinds
and deal", no explanation, nothing to press. Six people at the table and a blank
screen with no way forward.

Three things were wrong and each hid the next.

Naming a chair and dealing that chair in were separate acts. Putting a name on an
empty chair is somebody sitting down, so it now deals them in. Only a chair that was
empty — no name and nobody in it: renaming someone who is sitting out is a correction,
not an arrival, and dealing them back in over a typo would be the tool overruling the
dealer.

The action bar hid itself whenever no seat was live, which was written for an empty
felt and caught a named one too. A table with names on it is not an empty table; it's
a table the dealer needs to be told something about.

And the seat editor never redrew the bar. It refreshes narrowly on purpose — a full
render on every keystroke would take the name field out from under the dealer
mid-word — but the bar answers "is there a table here at all", and seating somebody is
exactly what changes that answer. Even ticking "In hand" by hand left the bar hidden
until something else happened to redraw. Verified the fix keeps focus and the caret
where they were, typing a character at a time.

For the states that can still reach it — a table where everyone was sat out, a save
from before naming seated people — the prompt names them and offers "Deal in all 6"
rather than a hunt through six seat editors.

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:00 -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#91