Let a phone move a player to another seat #72

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-move-seat-on-touch into fix/casino-holdem-amount-fields-select
Owner

The hint under the table has said this on every screen since the gestures went in:

Tap a seat to edit · double-tap to fold · press and hold for quick actions · drag to swap seats.

Three of those work on a phone. The fourth never has. Swapping seats is HTML5 drag-and-drop — draggable="true", dragstart, drop — and a touch screen doesn't generate drag events at all. So the one clause written in the same breath as "tap" and "press and hold" was the one thing a thumb could never do. Stacked on #71.

I found it by dragging seat 1 onto seat 4 with real touch pointer events and watching nothing happen: no swap, no menu, no error.

Moving a seat is in the long-press menu now

Which is the route a thumb already takes for everything else. "Move to…" replaces the action list with the other chairs, by number and name, and picking one makes the move:

Move Ben to...
Their chips, cards and bet go with them. The button and the blinds stay on the chair.
  Seat 1 — Ann     Seat 3 — Cal     Seat 4 — Dee     Seat 5 — empty  ...

That subtitle is the rule, and it's the one a card room uses: the whole seat travels, while everything naming a position stays put. Somebody who sits down in the big blind's chair is the big blind.

Driven through on an emulated phone: Ben — small blind, $109 behind with $1 posted — moves to seat 5 with both numbers; seat 2 goes empty; the button stays on seat 1; the toast reads "Ben moved to seat 5" and undo puts it all back. Reopening the menu on another seat shows actions again rather than the chair list it closed on.

The hint tells the truth per device now — dragging is only mentioned where a mouse exists. Dragging still works there, checked.

Validation

8 tests (232 total): the whole seat moves, the bet moves with it, chips are conserved, the button and the blinds stay on their chairs, swapping twice is a no-op, and a chair that isn't there is refused rather than swallowed. Picker rows all clear 44px on touch; no console errors.

One audit fix rides along

The "one dealer button" check counted the empty slot that a hovered seat deliberately fades in, so it reported two buttons whenever a mouse happened to rest on the table — which is most of the time a mouse exists. It ignores the hovered seat now, and still catches the real fault: with the pre-#62 behaviour put back it reports six, or five while hovering.

The hint under the table has said this on every screen since the gestures went in: > Tap a seat to edit · double-tap to fold · press and hold for quick actions · **drag to swap seats**. Three of those work on a phone. **The fourth never has.** Swapping seats is HTML5 drag-and-drop — `draggable="true"`, `dragstart`, `drop` — and a touch screen doesn't generate drag events at all. So the one clause written in the same breath as "tap" and "press and hold" was the one thing a thumb could never do. Stacked on #71. I found it by dragging seat 1 onto seat 4 with real touch pointer events and watching nothing happen: no swap, no menu, no error. ## Moving a seat is in the long-press menu now Which is the route a thumb already takes for everything else. "Move to…" replaces the action list with the other chairs, by number and name, and picking one makes the move: ``` Move Ben to... Their chips, cards and bet go with them. The button and the blinds stay on the chair. Seat 1 — Ann Seat 3 — Cal Seat 4 — Dee Seat 5 — empty ... ``` That subtitle is the rule, and it's the one a card room uses: **the whole seat travels, while everything naming a position stays put.** Somebody who sits down in the big blind's chair is the big blind. Driven through on an emulated phone: Ben — small blind, $109 behind with $1 posted — moves to seat 5 with both numbers; seat 2 goes empty; the button stays on seat 1; the toast reads "Ben moved to seat 5" and undo puts it all back. Reopening the menu on another seat shows actions again rather than the chair list it closed on. The hint tells the truth per device now — dragging is only mentioned where a mouse exists. Dragging still works there, checked. ## Validation **8 tests (232 total)**: the whole seat moves, the bet moves with it, chips are conserved, the button and the blinds stay on their chairs, swapping twice is a no-op, and a chair that isn't there is refused rather than swallowed. Picker rows all clear 44px on touch; no console errors. ## One audit fix rides along The "one dealer button" check counted the empty slot that a hovered seat deliberately fades in, so it reported two buttons whenever a mouse happened to rest on the table — which is most of the time a mouse exists. It ignores the hovered seat now, and still catches the real fault: with the pre-#62 behaviour put back it reports six, or five while hovering.
jheaps added 1 commit 2026-09-01 15:17:31 -06:00
The hint under the table has said this on every screen since the gestures went in:

  Tap a seat to edit - double-tap to fold - press and hold for quick actions -
  drag to swap seats.

Three of those work on a phone. The fourth never has. Swapping seats is HTML5
drag-and-drop -- draggable="true", dragstart, drop -- and a touch screen does not
generate drag events at all. So the one clause written in the same breath as "tap"
and "press and hold" was the one thing a thumb could never do.

I found it by dragging seat 1 onto seat 4 with real touch pointer events and watching
nothing happen: no swap, no menu, no error.

Moving a seat is in the long-press menu now, which is the route a thumb already takes
for everything else. "Move to..." replaces the action list with the other chairs, by
number and name, and picking one makes the move:

  Move Ben to...
  Their chips, cards and bet go with them. The button and the blinds stay on the chair.
    Seat 1 - Ann     Seat 3 - Cal     Seat 4 - Dee     Seat 5 - empty ...

That subtitle is the rule, and it is the one a card room uses: the whole seat travels,
while everything naming a position stays put. Somebody who sits down in the big
blind's chair is the big blind.

Driven through on a phone: Ben, small blind, $109 behind with $1 posted, moves to
seat 5 with both numbers; seat 2 goes empty; the button stays on seat 1; the toast
reads "Ben moved to seat 5" and undo puts it all back. Reopening the menu on another
seat shows actions again rather than the chair list it closed on.

The hint tells the truth per device now -- dragging is only mentioned where a mouse
exists. Dragging still works there, checked.

8 tests (232 total): the whole seat moves, the bet moves with it, chips are conserved,
the button and the blinds stay on their chairs, swapping twice is a no-op, and a chair
that is not there is refused rather than swallowed.

One audit fix rides along. The "one dealer button" check counted the empty slot that a
hovered seat deliberately fades in, so it reported two buttons whenever a mouse
happened to rest on the table -- which is most of the time a mouse exists. It ignores
the hovered seat now, and still catches the real fault: with the pre-#62 behaviour put
back it reports six, or five while hovering.

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:52 -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#72