refactor(ui): per-table action-submission track — unblock multi-tabling (blocks #833)

Aperta
#834 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Dzeezbtc ci sta già lavorando.

Dal 24/10/2026.

  • #893 di @Dzeezbtc — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
32/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
backend, frontend

Direzione di ricerca

Start with src/hooks/playerActions/transportAction.ts, then trace the GameMessageBus, ActionSubmitController, and auto-action hooks named in the issue. Check how GameStateProvider scopes state and how Table receives active-table status. Done means tests mount multiple tables and verify snapshot isolation, background tables do not auto-submit, and single-table behavior remains unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

architecture Backlog game-flow refactor

Overview

Blocker found while building multi-tabling PR 2 (block52/ui#833, part of block52/ui#55). The live workspace mounts up to 4 tables at once, each in its own GameStateProvider, and that works — but the outbound action-submission path is not table-scoped, so with more than one live table it can submit with the wrong state. This ticket is the submission-layer refactor that makes multi-tabling safe. Blocks #833.

The problem

  • The logical-track snapshot used when submitting an action lives in a module-level singleton (src/hooks/playerActions/transportAction.ts). Every mounted table's GameMessageBus writes to that one singleton.
  • With 2+ live tables, the active table's ActionSubmitController can read another table's snapshot → submits with the wrong action index (a real-money misfire risk).
  • Background tables also keep running their auto-action hooks (auto-post-blinds, auto-muck, auto-fold, etc.), so a table you're not looking at can act on its own.

Single-table play is unaffected — today there's only ever one table, so the singleton is fine. This only bites once multiple tables are mounted.

The fix (two parts)

  1. Per-table logical track — scope the submission snapshot per table (per GameStateProvider instance) instead of a module-level singleton, so each table's ActionSubmitController reads only its own state. Thread the table id / an instance-scoped store through transportAction.ts and the GameMessageBus.
  2. background / active gating on Table — add a prop so a table that isn't the active one pauses its auto- submission hooks*; only the visible/active table may auto-act (or submit) on the player's behalf.

Acceptance criteria

  • AC-1 With 4 live tables open, submitting an action on the active table always uses that table's own action index/state — never another table's.
  • AC-2 Background (non-active) tables keep their auto-actions (deal, blinds, armed pre-actions), each acting only on its own table (changed per review on #893).
  • AC-3 Single-table behaviour is unchanged (no regression to the current path).
  • AC-4 Covered by tests that mount multiple tables and assert isolation of the submission snapshot.

References

  • src/hooks/playerActions/transportAction.ts (the singleton), the GameMessageBus, ActionSubmitController, and the auto-* hooks under src/hooks/playerActions/.
  • Unblocks block52/ui#833 (multi-tabling PR 2); part of block52/ui#55.

🤖 Generated with Claude Code

Lingua principale
TypeScript
Stelle
2
Fork
5
Merge medio
22h 3m
PR unite (30g)
103

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di block52/ui

Tutte le issue di block52/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.