Support eight-player game setup#271
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR extends game setup and scoring UI behavior to support 7–8 player “expansion” games by (1) ensuring all circle members are fetched during new-game setup and (2) allowing duplicate player accent colors once the six-color palette is exhausted, with added unit tests to lock in the behavior.
Changes:
- Use the paginated
getOrgMemberClerkIdshelper on the new-game page to avoid missing members in larger circles. - Allow duplicate accent colors for games with more players than
ACCENT_COLORS.length, both in the color picker UI and theuseGameColorsupdate behavior. - Add focused tests covering duplicate-color allowance in
ColorPickerand the 8-player path inuseGameColors.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/scoring/useGameColors.ts | Skips cascade resolution when the palette is exhausted to allow duplicates. |
| src/components/scoring/GameColorStep.tsx | Passes an allowDuplicateColors flag through to the picker for 7+ players. |
| src/components/scoring/ColorPicker.tsx | Stops disabling “taken” colors when duplicates are allowed. |
| src/components/tests/scoring/useGameColors.test.tsx | Adds coverage for cascade behavior (≤6) vs duplicate behavior (7+). |
| src/components/tests/scoring/ColorPicker.test.tsx | Adds coverage for disabling taken colors by default vs allowing duplicates. |
| src/app/games/new/page.tsx | Switches to paginated circle-member fetching via shared helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c595b728b1
ℹ️ 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".
| allowDuplicateColors | ||
| ? { ...prev, [playerId]: newColor } | ||
| : resolveColorCascade(prev, playerId, newColor) |
There was a problem hiding this comment.
Preserve duplicate color picks when creating games
When a seven/eight-player setup selects an already-used color, this branch keeps that duplicate in client state, but confirming the game sends it to createGame, which rebuilds playerColors with assignColorsToPlayers (src/server/mutations/games.ts:50-60); that allocator skips duplicate resolvedColors and reassigns them by palette order. The game page then runs the same allocator before rendering, so the selected duplicate is replaced after redirect, making the new duplicate-color UI misleading for the expansion games it enables.
Useful? React with 👍 / 👎.
Summary
Notes
There was no hard four-player cap in the DB, server action, or scoring flow. The practical gaps were around larger setup flows: membership fetching and color selection once the palette is exhausted.
Tests
npm run typechecknpm run lintnpm test -- --runInBand