Fix overflow encore, projector clipping, and gone-room board - #2
Conversation
Reset was seating every spectator, so an 80-player room plus one watcher could not start again. The projector hid names at 720p and treated a gone room as a reconnect loop. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb001ab224
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Deal spectators in, but never above MAX_PLAYERS — otherwise start_game | ||
| // refuses and the encore (the reason we reset) cannot begin. Earliest | ||
| // joiners keep seats; overflow stays watching. | ||
| const ordered = Object.values(next.players).sort((a, b) => a.joinedSeq - b.joinedSeq); |
There was a problem hiding this comment.
Preserve occupied seats before promoting spectators
When an overflow spectator joined before a later replacement player, this global joinedSeq sort can eject the replacement on reset. For example, fill the lobby, add an overflow spectator, kick one seated player, let a new player take the free seat, then play and reset: the older spectator is promoted while the newer current player is demoted, even though the spectator hint says a reset keeps them watching while 80 people remain. Prioritize existing non-spectators before filling remaining seats from the spectator queue.
Useful? React with 👍 / 👎.
| const status = p.you?.spectator | ||
| ? 'The lobby is full — you are watching this round.' |
There was a problem hiding this comment.
Derive the full-lobby message from the seat count
A lobby spectator is not guaranteed to mean the lobby is still full: after an 81st player becomes a spectator, the moderator can kick a seated lobby member, leaving 79 seated while the spectator remains. In that state this branch still tells the spectator that the lobby is full, contradicting both lobbyCount and the new nextStepHint logic and obscuring that a seat is available.
Useful? React with 👍 / 👎.
Summary
start_gamestill works; lobby copy no longer promises them a seat.goneso a missing room shows room not found instead of looping on reconnecting….Test plan
npx vitest run test/reducer.test.ts test/redaction.test.ts test/mcp.e2e.test.tsreset_room→start_gamesucceeds; overflow remains a spectator/room/NOPE/boardsettles on room not found, not reconnecting…Made with Cursor