Commit graph

6 commits

Author SHA1 Message Date
1cb6da257f Fix 7 bugs: trade property transfer, UI owner colors, resign edge cases, spec flag, phase field, timestamps
Bug fixes:
- #1: Trade now transfers properties (parse printsq-format lines in trade summaries)
- #2: UI owner indicator uses player number lookup instead of raw array index
- #3: Mid-stream game pickup sets _first_player_idx
- #4: Resign with unresolved target clears properties (bank fallback)
- #6: spec flag cleared after rent payment (matches C's get_card cleanup)
- #13: get_state() always emits phase field (setup/playing/over)
- #16: Resign and trade log entries include timestamps

Also:
- Bankrupt players tracked with bankrupt flag, shown in UI with skull/dashed border
- 19 resignation tests (test_parser_resign.py)
- 10 bug-specific tests (test_parser_bugs.py)
- All 1551 parser checkpoints + 67 unit tests passing
2026-02-21 18:52:10 +00:00
72d996cb4b Show players during setup: empty slots and registration progress
Parser changes:
- Track num_players_expected from user input after 'How many players?'
- Create placeholder players ('Player N') on 'say me please' prompts
- Replace placeholder names when real names appear in roll lines
- Emit state during setup phase (was returning None)
- Include phase and numPlayersExpected in state JSON

UI changes:
- Empty slots shown as dashed/dimmed panels with '?' token
- Placeholder players shown as 'Registering...'
- Registered players shown with checkmark and ,500
- Status bar shows 'Setting up · 2/3 players registered'
2026-02-21 11:24:49 +00:00
435b24bfb8 Replace disconnected overlay with slim banner matching stale style
Same top-banner pattern as the stale indicator but with red accent
and 'Connection lost — retrying every 2s...' message. Page gets
subtle greyscale/dim instead of a blocking overlay.
2026-02-21 11:15:18 +00:00
dd4787615d Add stale data banner when game state hasn't updated in 20s
Subtle top banner with dimmed page (not a blocking overlay like the
full disconnect state). Shows elapsed time since last update.
Separate from the hard disconnect which triggers after 3 fetch failures.

Debug panel: added 'Stale' button to test.
2026-02-21 11:13:19 +00:00
34a4f47402 Add zero state, disconnected overlay, game over confetti, and debug panel
- Zero state: bouncing dice + message when no game exists
- Disconnected: greyed overlay after 3 consecutive fetch failures,
  with retry countdown
- Game over: gold banner with winner name + confetti animation,
  detected from log ('WINS!') or single remaining player
- Debug panel: Ctrl+Shift+D toggles hidden panel with buttons to
  test all four states (zero, playing, gameover, disconnected, reset)
- Also fixed player panel to use p.number for current-turn matching
  and property ownership display
2026-02-21 11:08:06 +00:00
7dadd1f37f Organize directory structure
- cardinal-plugin/ → plugins/ (matches Cardinal's plugin dir convention)
- index.html + game-state.json → site/
- OUTPUT_CATALOG.md → docs/
- Core Python files and tests stay flat (no import changes needed)
2026-02-21 10:16:49 +00:00
Renamed from index.html (Browse further)