Skip to content

feat(ui): Sit-in method selection UI (Next Big Blind vs Post Required Blinds) #38

Description

@bitcoinbrisbane

Parent Issue

block52/poker-vm#1830 — Section 3: Sit In Options
Also related to #50 (initial join sit-in options) — this covers the UI specifically.

Problem

The current "SIT IN" button is a single-click action with no options. The document requires two sit-in methods with dynamic blind labels.

Current UI

┌─────────────────────────────┐
│  [ SIT IN ]                 │  ← Single button, no options
│                             │  ← Immediately sets ACTIVE
│                             │  ← No blind posting
└─────────────────────────────┘

Current code: ui/src/components/playPage/Table/components/PlayerActionButtons.tsx

Required UI

AC-1: Solo Player — No Sit-In Options, Show "Waiting for Players"

Industry standard: No major poker site (PokerStars, GGPoker, 888poker, PartyPoker, ACR) shows sit-in options to the first/only player at an empty table. There's no game to join, no blinds rotating, nothing to "wait for" or "post into."

Behavior:

  • When a player is the only player at the table (no other seated/active players), do NOT show the sit-in method options
  • Instead, show the existing "Waiting for players to join..." bubble (already in TableStatusMessages.tsx)
  • The sit-in options only appear when there are 2+ players at the table (i.e., a game is running or can start)
┌─────────────────────────────────┐
│  ⏳ Waiting for players to join │  ← Solo player, no options
└─────────────────────────────────┘

When 2nd player joins:

  • PVM bootstrap activates both players automatically (no sit-in selection needed for founding players)
  • Game starts with button draw

When 3rd+ player joins a running game:

  • Player is SEATED → sees sit-in options (AC-2)
Scenario Show sit-in options? What happens?
1st player at empty table No "Waiting for players" bubble
2nd player at empty table No Bootstrap activates both, game starts
3rd+ player joins running game Yes Choose "Sit In On Next Big Blind" or "Post Required Blinds Now"
Player returns from SITTING_OUT Yes Choose "Sit In On Next Big Blind" or "Post Required Blinds Now"

AC-2: Sit-In Options Panel (3+ players, joining running game)

When player is SEATED or SITTING_OUT and there are active players at the table, show two stacked buttons:

┌──────────────────────────────────────────────────────┐
│  [ Sit In On Next Big Blind ]       ← green primary  │
│  [ Post Required Blinds Now ]       ← subtle         │
└──────────────────────────────────────────────────────┘
  • "Sit In On Next Big Blind" calls handleSitIn(tableId, network, "next-bb")
  • "Post Required Blinds Now" calls handleSitIn(tableId, network, "post-now")
  • Mobile: compact version with smaller text

AC-3: Pending State (SITTING_IN)

After selecting a method, show waiting indicator with method-specific message:

┌──────────────────────────────────────────┐
│  ● Waiting For Next Big Blind...         │  ← method=next-bb
│     [ Cancel ]                           │
└──────────────────────────────────────────┘

or

┌──────────────────────────────────────────┐
│  ● Waiting to Post Required Blinds...    │  ← method=post-now
│     [ Cancel ]                           │
└──────────────────────────────────────────┘

AC-4: Dynamic Blind Labels (Future Enhancement)

The "Post Required Blinds Now" label could show exact blind amounts:

  • "Post Big Blind ($0.20) Now"
  • "Post Small Blind + Big Blind ($0.30) Now"

Deferred — requires PVM to expose missed blind data.

Implementation

Files to Modify

File Change
ui/src/components/playPage/Table/components/PlayerActionButtons.tsx Hide sit-in options when solo player; show stacked buttons for 3+ players
ui/src/hooks/playerActions/sitIn.ts Accept method parameter (done)
ui/src/components/common/actionHandlers.ts Pass method to handleSitIn (done)
ui/src/components/playPage/Table.tsx Pass active player count or solo flag to PlayerActionButtons

Key Logic Change (PlayerActionButtons)

// Don't show sit-in options if player is the only one at the table
if (hasSitInAction && activePlayerCount === 0) {
    return null; // "Waiting for players" bubble shown by TableStatusMessages
}

Related Issues

🤖 Generated with Claude Code

Metadata

Metadata

Labels

UIUI related issuesenhancementNew feature or requestfeatureFeature enhancement groupgame_logicGame logic related issuessdkSDK related issuesuxUX related issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions