Put the settings out of reach once a match is under way

Every control in the settings sheet calls resetClocks(), so opening it
mid-match could throw away two live clocks. The gear now only appears on an
untouched match: before the first tap, or after a two-tap reset.

"Untouched" is derived rather than tracked — phase, turn, moves, score and
both reserves matching matchTime() — so it cannot fall out of sync the way a
stored flag could. The phase alone would be wrong: a score change runs
newGame(), which returns to IDLE waiting for the next game's first tap while
the match is still very much on. The reserve check also catches a clock
corrected through the score sheet.

The button uses visibility rather than [hidden], so its slot stays put and
the rest of the bar doesn't jump the instant the clock starts; verified
pixel-for-pixel that reset, play/pause, score and sound do not move.
visibility:hidden also drops it from the tab order and the accessibility
tree. The rule is enforced in the click handler as well, because a
programmatic click still reaches a visibility:hidden button — CSS is the
affordance, the guard is the rule.

The trade, deliberately: a mistake in the time or delay now costs a reset and
a restarted match. Correcting a clock mid-match is the score sheet's job.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 15:57:37 +02:00
co-authored by Claude Opus 5
parent b438630796
commit 81826589d8
3 changed files with 33 additions and 2 deletions
+7
View File
@@ -60,6 +60,13 @@ except installation and the service worker.
it paused — everything in there resets the clocks anyway — while the score
sheet picks the turn back up when you close it, so glancing at the score
doesn't cost you a tap on play.
- **Settings are only reachable before a match starts.** Every control in that
sheet resets both clocks, so the gear disappears the moment the first tap
starts the clock and comes back after a reset. Its space in the bar is kept
empty, so nothing else shifts. That means a mistake in the time or delay can
only be fixed by resetting and starting the match again — deliberately, since
the alternative is wiping two live clocks by accident. Correcting a clock
mid-match is what the score sheet is for.
Backgammon clocks pause between games, and after a cocked die the delay is
normally restarted — use pause and reset for those.