Cards on the table and in the hand are larger and the table is sized… #7
Loading…
Reference in a new issue
No description provided.
Delete branch "osf/176-ui-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was done
npm test) passed, and a judge served the app and drove it through browser checks on desktop and phone portrait, confirming no card is clipped, seats are uniform, the hand is a straight full-color row, and a full game plays to the end screen.How to review
osf/176-ui-fixesso your tree matches the pull request (it diffs againstmain).npm testandnpm run typecheckfrom the repository root; both should pass with no failures.npm start, open the printedhttp://127.0.0.1:3000URL, and play a full game against four bots (seat them with Fill remaining seats in the waiting room); you should see bot moves arrive one at a time with a visible randomized delay, larger unclipped cards, a straight full-color hand row, uniform seat boxes, per-player trick card backs, and labeled scratch counts.packages/server/src/gameServer.tsandpackages/client/src/components/Seat.tsxfirst — the server-side bot pacing and the new seat display (avatars, trick card backs, labeled scratches) live there.Code review
Reviewed the avatar + server-side bot-pacing + table-layout change against its proposal, delta specs, and tasks. Every requirement is implemented and covered by a test, and the commit carries no generated, cached, or secret files (node_modules/dist are gitignored; .osf/ and openspec/ are meant to be committed). Found and fixed one blocking bug: the room:rejoin handler cleared the room's single pending auto-move timer without rescheduling, so a tab reload during a bot's turn (the normal rejoin path) dropped the bot's move and stalled the game, violating the game-bots requirement that a game with bots never stalls; added a regression test that times out without the fix. Also tightened botAvatarId's parameter type to remove a dead null-fallback that would have rendered a bot's face for a non-bot.
Fixed before the commit
packages/server/src/gameServer.ts:482: The room:rejoin handler called clearAutoTimer(room) unconditionally but never rescheduled. The pending timer usually belongs to a bot's move (the rejoining player is normally not the current actor), so a human reloading their tab during a bot's turn lost the bot's pending move and the game stalled on the bot's turn forever. This violates the game-bots spec ('a game with bots never stalls') and is the common production reload path. Fixed by calling maybeScheduleAuto(room) after clearAutoTimer(room) so the move is rescheduled when the current actor is still automatic; added a regression test in session.test.ts that times out without the fix and passes with it.packages/shared/src/avatars.ts:54: botAvatarId accepted BotPersona | null | undefined and fell back to BOT_AVATARS.cautious for null/undefined — dead code (all call sites pass a non-null persona) and a footgun that would render Cautious Carl's face for a non-bot. Tightened the parameter type to BotPersona and removed the arbitrary fallback.Tests
All 26 scenarios of
ui-fixes-1-the-cards-on-the-table-are-to-cm8884have a tagged test.Left untested on purpose:
game-bots/A full table of bots plays to completion: Covered by session.test.ts 'plays a full table of bots to completion without stalling' (now run with the zero-delay injection).game-bots/A game with one bot plays to completion: Covered by session.test.ts 'plays a game with one bot to completion, with the bot playing its named style' (now run with the zero-delay injection).game-bots/Disconnected humans keep the safe fallback: Covered by session.test.ts 'auto-plays a disconnected human with the safe fallback, not a bot style' and 'auto-plays for a disconnected player and resumes control on reconnect'.game-bots/Every style stays legal: Covered by bots.test.ts 'cautious bids the lowest legal bid...', 'aggressive bids the hand size (or the highest legal bid)...', and 'bluffer always picks a legal bid and card...'; a new test would restate the same legality checks.game-bots/Roster offers four named styles: Covered by bots.test.ts 'offers at least four named bots with distinct personas and names, one presented as hard to beat' and game-lobby.test.tsx 'shows the creator the bot roster with each bot's name and style blurb'.game-bots/The hard-to-beat bot beats the other styles: Covered by fullGame.test.ts 'four roster bots play a full seeded game with the dealer restriction on; master scratches less than the other three average'.game-bots/The hard-to-beat bot plays to its bid: Covered by bots.test.ts 'bids trumps plus aces of the other suits, clamped to the legal bids' and 'takes tricks with the cheapest winning card while behind, and dumps when level or ahead'.game-table/Consistent card design: Covered by game-table.test.tsx Card 'identifies the %s suit by glyph, not color alone'; this change does not alter the card face or back design, so a new test would restate the existing one.game-table/Own seat distinguished: Covered by game-table.test.tsx 'marks the player's own seat and only that seat'; the change does not alter how the own seat is marked.game-table/Tap to select, tap to play: Covered by game-table.test.tsx 'exposes cards, bids, and the top controls as named, focusable buttons with a selection state'; the select-then-play interaction is unchanged by this change.The test lint recorded nothing in the run's tests.
Braid run
ui-fixes-1-the-cards-on-the-table-are-to-cm8884(29 steps).forgejo/workflows,.gitea/workflowsor.github/workflows); what only CI tests went unverifiedOpened by Braid.