Stop the think-clock claiming things it can't know #85

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-honest-tank-clock into fix/casino-holdem-export-the-notes
Owner

The clock beside the acting player told two lies, in opposite directions. Stacked on #84.

Refresh mid-hand and it restarts at 0:00

The clock lives in memory, so a reload wipes it, and the bar then says the player has just started thinking when they might have been in the tank for two minutes. It's the one number in the bar whose whole job is to tell a dealer when to nudge somebody, and a refresh reset it to "no need".

It can't know that time — the action moved before this session existed — so it doesn't guess. It shows a dash until the action next moves, and says why on hover:

The action was already on this seat when the page loaded, so there's nothing to time from yet. The clock starts when the action next moves.

The moment the action moves it's measuring something it saw, and counts from zero again.

Past an hour it read "65:03"

A table left open on a hand really does get there — the state survives a refresh by design — and sixty-five minutes written as though it were minutes and seconds is a number the eye gets wrong. It reads 1:05:03 now.

Validation

Checked in the browser rather than reasoned about: dealt in this session it counts 0:00 then 0:02; refreshed mid-hand it shows the dash and keeps showing it rather than drifting up from an invented zero; one action later it's back to a real 0:00; and with the clock wound forward it reads 1:05:04 with the slow-tank styling still applied. Audit and contrast clean, no console errors.

5 tests (283 total) on the formatting, including that minutes are padded once there are hours and not before, and that a day reads 25:00:00 rather than wrapping.

Also checked, already correct

A backgrounded tab doesn't lose time — four minutes away reads 4:01 on return, because the clock is a timestamp difference rather than a count of ticks — and the timer disappears entirely once the hand is over.

The clock beside the acting player told two lies, in opposite directions. Stacked on #84. ## Refresh mid-hand and it restarts at 0:00 The clock lives in memory, so a reload wipes it, and the bar then says the player has **just started thinking** when they might have been in the tank for two minutes. It's the one number in the bar whose whole job is to tell a dealer when to nudge somebody, and a refresh reset it to "no need". It can't know that time — the action moved before this session existed — so it doesn't guess. It shows a dash until the action next moves, and says why on hover: > The action was already on this seat when the page loaded, so there's nothing to time from yet. The clock starts when the action next moves. The moment the action moves it's measuring something it saw, and counts from zero again. ## Past an hour it read "65:03" A table left open on a hand really does get there — the state survives a refresh by design — and sixty-five minutes written as though it were minutes and seconds is a number the eye gets wrong. It reads **1:05:03** now. ## Validation Checked in the browser rather than reasoned about: dealt in this session it counts 0:00 then 0:02; refreshed mid-hand it shows the dash and **keeps** showing it rather than drifting up from an invented zero; one action later it's back to a real 0:00; and with the clock wound forward it reads 1:05:04 with the slow-tank styling still applied. Audit and contrast clean, no console errors. **5 tests (283 total)** on the formatting, including that minutes are padded once there are hours and not before, and that a day reads `25:00:00` rather than wrapping. ## Also checked, already correct A backgrounded tab doesn't lose time — four minutes away reads 4:01 on return, because the clock is a timestamp difference rather than a count of ticks — and the timer disappears entirely once the hand is over.
jheaps added 1 commit 2026-09-01 20:07:06 -06:00
The clock beside the acting player told two lies, in opposite directions.

Refresh mid-hand and it restarts at 0:00. The clock lives in memory, so a reload wipes
it, and the bar then says the player has just started thinking when they might have
been in the tank for two minutes. It is the one number in the bar whose whole job is to
tell a dealer when to nudge somebody, and a refresh reset it to "no need".

It cannot know that time -- the action moved before this session existed -- so it does
not guess. It shows a dash until the action next moves, and says why if you hover:

  "The action was already on this seat when the page loaded, so there's nothing to
   time from yet. The clock starts when the action next moves."

The moment the action moves it is measuring something it saw, and it counts from zero
again.

And past an hour it read "65:03". A table left open on a hand really does get there --
the state survives a refresh by design -- and sixty-five minutes written as though it
were minutes and seconds is a number the eye gets wrong. It reads 1:05:03 now.

Checked in the browser rather than reasoned about: dealt in this session it counts 0:00
then 0:02; refreshed mid-hand it shows the dash and keeps showing it rather than
drifting up from an invented zero; one action later it is back to a real 0:00; and with
the clock wound forward it reads 1:05:04 with the slow-tank styling still applied.

5 tests (283 total) on the formatting, including that minutes are padded once there are
hours and not before, and that a day reads 25:00:00 rather than wrapping.

Also checked and correct already: a backgrounded tab does not lose time -- four minutes
away reads 4:01 on return, because the clock is a timestamp difference rather than a
count of ticks -- and the timer disappears entirely once the hand is over.

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:57:58 -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#85