A pre-filled amount is a suggestion, so reaching for the box replaces it #71

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-amount-fields-select into fix/casino-holdem-touch-targets-by-pointer
Owner

Every amount box in this tool opens pre-filled: the raise pad offers the minimum, Add chips offers a buy-in, the seat editor offers the stack a player already has. A dealer taps one because they want a different number — and a tap puts the caret after the suggestion rather than over it. Stacked on #70.

Driven on an emulated phone:

raise pad shows 4      tap, type "60"    -> 460
add chips shows 200    tap, type "50"    -> 20050
seat stack shows 200   tap, type "175"   -> 200175

The raise pad is the most time-critical control in the tool, and 460 is a number the dealer never said. The all-in warning happens to catch that one against a $200 stack; against a deeper stack it's simply accepted, and the pot is wrong from then on.

Number boxes now select what's in them when they take focus, so the first digit typed replaces the suggestion.

Field Before After
Raise pad (4) + "60" 460 60
Add chips (200) + "50" 20050 50
Seat stack (200) + "175" 200175 175
A name (Cal) + "X" CalX CalX

That last row is the point of the rule. Only number boxes: type=number, or the type=text / inputmode=decimal pair the raise pad uses to get a keypad without spinner arrows. A name or a note is a thing you edit, and selecting all of it on focus would be the same mistake pointing the other way.

Delegated from the document rather than wired per field — the raise pad, the add-chips sheet and the seat editor all rebuild their inputs on every render, and a box added later shouldn't have to remember to ask for this. The select is deferred a tick: doing it inside the focus handler loses the race with the browser placing its own caret, and the selection collapses again the moment the tap completes.

Validation

10 tests (224 total) on the predicate, including the ones that must stay false — name, note, colour swatch, checkbox, select, and an input with no type stated.

Driven through Playwright on an emulated touch phone for all four fields above, and on desktop with a mouse: typing 60 into the raise pad and confirming lands currentBet 60, the acting seat committed 60, and the undo control reads "Dee's raise to $60". The sidebar's big-blind field replaces cleanly and the state follows. Layout audit and contrast clean at six sizes; no console errors.

Every amount box in this tool opens pre-filled: the raise pad offers the minimum, Add chips offers a buy-in, the seat editor offers the stack a player already has. A dealer taps one because they want a *different* number — and a tap puts the caret **after** the suggestion rather than over it. Stacked on #70. Driven on an emulated phone: ``` raise pad shows 4 tap, type "60" -> 460 add chips shows 200 tap, type "50" -> 20050 seat stack shows 200 tap, type "175" -> 200175 ``` The raise pad is the most time-critical control in the tool, and **460 is a number the dealer never said**. The all-in warning happens to catch that one against a $200 stack; against a deeper stack it's simply accepted, and the pot is wrong from then on. Number boxes now select what's in them when they take focus, so the first digit typed replaces the suggestion. | Field | Before | After | | --- | --- | --- | | Raise pad (4) + "60" | 460 | **60** | | Add chips (200) + "50" | 20050 | **50** | | Seat stack (200) + "175" | 200175 | **175** | | A name (Cal) + "X" | CalX | **CalX** | That last row is the point of the rule. Only number boxes: `type=number`, or the `type=text` / `inputmode=decimal` pair the raise pad uses to get a keypad without spinner arrows. A name or a note is a thing you *edit*, and selecting all of it on focus would be the same mistake pointing the other way. Delegated from the document rather than wired per field — the raise pad, the add-chips sheet and the seat editor all rebuild their inputs on every render, and a box added later shouldn't have to remember to ask for this. The select is deferred a tick: doing it inside the focus handler loses the race with the browser placing its own caret, and the selection collapses again the moment the tap completes. ## Validation **10 tests (224 total)** on the predicate, including the ones that must stay false — name, note, colour swatch, checkbox, select, and an input with no type stated. Driven through Playwright on an emulated touch phone for all four fields above, and on desktop with a mouse: typing 60 into the raise pad and confirming lands `currentBet 60`, the acting seat committed 60, and the undo control reads "Dee's raise to $60". The sidebar's big-blind field replaces cleanly and the state follows. Layout audit and contrast clean at six sizes; no console errors.
jheaps added 1 commit 2026-09-01 14:40:32 -06:00
Every amount box in this tool opens pre-filled: the raise pad offers the minimum, Add
chips offers a buy-in, the seat editor offers the stack a player already has. A dealer
taps one because they want a different number -- and a tap puts the caret after the
suggestion rather than over it.

Driven on an emulated phone:

  raise pad shows 4      tap, type "60"    -> 460
  add chips shows 200    tap, type "50"    -> 20050
  seat stack shows 200   tap, type "175"   -> 200175

The raise pad is the most time-critical control in the tool, and 460 is a number the
dealer never said. The all-in warning happens to catch that one against a $200 stack;
against a deeper stack it is simply accepted, and the pot is wrong from then on.

Number boxes now select what is in them when they take focus, so the first digit
typed replaces the suggestion.

  raise pad     4 -> "60"
  add chips   200 -> "50"
  seat stack  200 -> "175"
  a name      Cal -> "CalX"

That last line is the point of the rule. Only number boxes: type=number, or the
type=text/inputmode=decimal pair the raise pad uses to get a keypad without spinner
arrows. A name or a note is a thing you edit, and selecting all of it on focus would
be the same mistake pointing the other way.

Delegated from the document rather than wired per field. The raise pad, the add-chips
sheet and the seat editor all rebuild their inputs on every render, and a box added
later should not have to remember to ask for this.

The select is deferred a tick. Doing it inside the focus handler loses the race with
the browser placing its own caret, and the selection collapses again the moment the
tap completes.

10 tests (224 total) on the predicate, including the ones that must stay false --
name, note, colour swatch, checkbox, select, and an input with no type stated.

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:51 -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#71