Skip to content

Support eight-player game setup#271

Open
mwickett wants to merge 1 commit into
mainfrom
mike/eight-player-support
Open

Support eight-player game setup#271
mwickett wants to merge 1 commit into
mainfrom
mike/eight-player-support

Conversation

@mwickett

Copy link
Copy Markdown
Owner

Summary

  • reuse the paginated Circle membership helper on the new-game page so larger circles are available when setting up games
  • allow duplicate player colors once a game has more players than the six-color palette, which keeps seven/eight-player expansion games editable instead of treating every other color as unavailable
  • add focused tests for color-picker duplicate behavior and the game-color hook's eight-player path

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 typecheck
  • npm run lint
  • npm test -- --runInBand

Copilot AI review requested due to automatic review settings June 28, 2026 14:32
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blitzer Ready Ready Preview, Comment Jun 28, 2026 2:34pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getOrgMemberClerkIds helper 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 the useGameColors update behavior.
  • Add focused tests covering duplicate-color allowance in ColorPicker and the 8-player path in useGameColors.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +29 to +31
allowDuplicateColors
? { ...prev, [playerId]: newColor }
: resolveColorCascade(prev, playerId, newColor)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants