Run the clock on a player, instead of counting in your head #107

Closed
jheaps wants to merge 1 commits from feat/casino-holdem-clock into feat/casino-holdem-rake
Owner

The bar has had a stopwatch on the acting seat for a while — how long this player has been thinking, so the dealer knows when it's worth a nudge. What it never had is the thing a dealer actually does about it. Calling the clock is a procedure: a player asks, the dealer grants it, the player gets a set time and then a countdown said out loud, and if they still haven't acted the hand is decided for them. Running that from this tool meant counting in your head while the table argued about whether it had been thirty seconds yet.

Thirty and then ten, which is the common form and what the TDA writes down. The countdown is the part the table hears, so it's marked apart rather than being ten more seconds of the same: the readout switches to a bare number and turns red. At zero the bar states the ruling in the dealer's own words and offers it as one button.

The ruling depends on what they were facing, and getting that backwards is the part worth being careful about:

  • Facing a bet → "Time — Dee is facing $2, so the hand is dead." with Kill Dee's hand.
  • Facing nothing → "Time — Cal had nothing to call, so the hand is checked." with Check for Cal. Nobody gets folded for being slow when checking was free.

The ordinary Fold/Check/Raise stay underneath. A player who speaks up as the count ends is still acting, and whether it was in time is the dealer's call, not the tool's.

Three things about where it sits

  • The button appears only once somebody has been thinking long enough for the table to start asking — the same threshold the stopwatch already marks. An ordinary hand costs no room at all: measured at 390x844, the bar is 152px with or without it.
  • It is 44px like everything else a thumb has to find. I drew it at 36 and the audit called it at every touch viewport the moment the check ran — the rule doing its job on a control that kills a hand.
  • Once the count is over the Stop button goes, because there's nothing left to stop. At 640x360 its 94px pushed the undo control onto a second line, and the taller bar covered the two bottom seats — found by the sweep, not by eye.

Validated

  • Watched end to end in the browser at shortened intervals, both rulings: the button appears after the wait, the count runs down, the readout switches to a countdown, the ruling lands, and the hand is killed — or checked — with the undo control reading "↶ Dee's hand killed on the clock".
  • 208 audits across 13 viewports x idle / clock running / expired, mouse and thumb, plus every overlay: one failure, fixed, then 52 more to confirm — clean, no console errors.
  • 11 new tests, suite at 494, 0 failures. Both halves of the ruling were inverted on purpose (always fold; clock follows the action to the next player) to confirm the tests catch it.

One measurement worth stating

At 640x360 in the expired state the bar clears the bottom seats by 5px. Positive at every size measured, but that is the tightest margin on the board: a phone on its side with the count run out is the most crowded this bar ever gets.

The bar has had a stopwatch on the acting seat for a while — how long this player has been thinking, so the dealer knows when it's worth a nudge. What it never had is **the thing a dealer actually does about it**. Calling the clock is a procedure: a player asks, the dealer grants it, the player gets a set time and then a countdown said out loud, and if they still haven't acted the hand is decided for them. Running that from this tool meant counting in your head while the table argued about whether it had been thirty seconds yet. **Thirty and then ten**, which is the common form and what the TDA writes down. The countdown is the part the table hears, so it's marked apart rather than being ten more seconds of the same: the readout switches to a bare number and turns red. At zero the bar states the ruling in the dealer's own words and offers it as one button. **The ruling depends on what they were facing**, and getting that backwards is the part worth being careful about: - Facing a bet → *"Time — Dee is facing $2, so the hand is dead."* with **Kill Dee's hand**. - Facing nothing → *"Time — Cal had nothing to call, so the hand is checked."* with **Check for Cal**. Nobody gets folded for being slow when checking was free. The ordinary Fold/Check/Raise stay underneath. A player who speaks up as the count ends is still acting, and whether it was in time is the dealer's call, not the tool's. ### Three things about where it sits - The button appears **only once somebody has been thinking long enough for the table to start asking** — the same threshold the stopwatch already marks. An ordinary hand costs no room at all: measured at 390x844, the bar is **152px with or without it**. - It is **44px** like everything else a thumb has to find. I drew it at 36 and the audit called it at every touch viewport the moment the check ran — the rule doing its job on a control that kills a hand. - Once the count is over the **Stop button goes**, because there's nothing left to stop. At 640x360 its 94px pushed the undo control onto a second line, and the taller bar covered the two bottom seats — found by the sweep, not by eye. ### Validated - Watched end to end in the browser at shortened intervals, both rulings: the button appears after the wait, the count runs down, the readout switches to a countdown, the ruling lands, and the hand is killed — or checked — with the undo control reading *"↶ Dee's hand killed on the clock"*. - 208 audits across 13 viewports x idle / clock running / expired, mouse and thumb, plus every overlay: one failure, fixed, then 52 more to confirm — clean, no console errors. - 11 new tests, suite at **494, 0 failures**. Both halves of the ruling were inverted on purpose (always fold; clock follows the action to the next player) to confirm the tests catch it. ### One measurement worth stating At 640x360 in the expired state the bar clears the bottom seats by **5px**. Positive at every size measured, but that is the tightest margin on the board: a phone on its side with the count run out is the most crowded this bar ever gets.
jheaps added 1 commit 2026-09-02 05:40:37 -06:00
The bar has had a stopwatch on the acting seat for a while: how long this player
has been thinking, so the dealer knows when it's worth a nudge. What it never had
was the thing a dealer actually does about it. Calling the clock is a procedure —
a player asks, the dealer grants it, the player gets a set time and then a
countdown said out loud, and if they still haven't acted the hand is decided for
them. Running that from this tool meant counting in your head while the table
argued about whether it had been thirty seconds yet.

Thirty and then ten, which is the common form and what the TDA writes down. The
countdown is the part the table hears, so it is marked apart rather than being
ten more seconds of the same: the readout switches to a bare number and turns
red. At zero the bar says the ruling in the dealer's own words and offers it as
one button.

The ruling depends on what they were facing, and getting that backwards is the
part worth being careful about. Facing a bet, the hand is dead. Facing nothing,
it is checked — nobody gets folded for being slow when checking was free.

Three things about where it sits. The button appears only once somebody has been
thinking long enough for the table to start asking, which is the same threshold
the stopwatch already marks, so an ordinary hand costs no room at all: measured
at 390x844, the bar is 152px with or without it. It is 44px like everything else
a thumb has to find — it was drawn at 36 and the audit called it at every touch
viewport the moment the check ran, which is the rule doing its job on a control
that kills a hand. And once the count is over the Stop button goes, because there
is nothing left to stop: at 640x360 its 94px pushed the undo control onto a
second line and the taller bar covered the two bottom seats.

The ordinary Fold/Check/Raise stay underneath the ruling. A player who speaks up
as the count ends is still acting, and whether it was in time is the dealer's
call, not the tool's.

11 new tests, and both halves of the ruling were inverted on purpose to check
they catch it. Watched end to end in the browser at shortened intervals: the
button appears, the count runs down, the ruling lands, and the hand is killed —
or checked — with the undo control naming what happened.

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:06 -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#107