feat: add 4v4 gamemode support (R1 + R2)#314
Merged
Merged
Conversation
Deploying rainbow with
|
| Latest commit: |
390b686
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://34c5f6f6.rainbow-ctx.pages.dev |
| Branch Preview URL: | https://4v4-support.rainbow-ctx.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end client support for a new "4v4" gamemode key, wiring it into shared gamemode constants, PIT data shapes/conversion, wrapped-session streak typing/rendering, and associated mocks/fixtures so the UI can display 4v4 alongside existing modes.
Changes:
- Extends core gamemode registries (keys, labels, colors) to include
"4v4". - Updates PIT query types/conversion and bumps persisted query-cache buster to reflect the new data shape.
- Extends Wrapped session streak types/UI and updates MSW/UI fixtures to include
"4v4".
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/theme/tokens.ts | Adds an accent color entry for the new "4v4" gamemode. |
| src/stats/progression.unit.test.ts | Updates test builder fixtures to include "4v4" stats. |
| src/stats/labels.ts | Adds a label mapping for "4v4". |
| src/stats/keys.ts | Adds "4v4" to ALL_GAMEMODE_KEYS (ordering between fours and overall). |
| src/routes/wrapped/$uuid.tsx | Includes "4v4" in the modes rendered by the Wrapped streaks section. |
| src/routes/wrapped/-uuid.ui.test.tsx | Updates Wrapped UI test fixtures to provide "4v4" streak data. |
| src/queries/wrapped.ts | Extends Wrapped session streak types to require "4v4" entries. |
| src/queries/playerdata.ts | Extends PIT data types and conversion to include a "4v4" stats block. |
| src/mocks/data.ts | Updates mock PIT data and Wrapped response mocks to include "4v4" and keep overall invariants. |
| src/helpers/session.unit.test.ts | Updates session helper fixtures to include "4v4" in PlayerDataPIT. |
| src/App.tsx | Bumps persisted query cache buster to invalidate old cached shapes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
58
to
60
| fours: apiPlayerData.fours, | ||
| "4v4": apiPlayerData["4v4"], | ||
| overall: apiPlayerData.overall, |
Add "4v4" to ALL_GAMEMODE_KEYS, gamemode labels, chart identity colors, the PlayerDataPIT types/mapper, and the MSW mock data (overall mock stays the sum of the five modes). Everything else — zod search params, gamemode selectors, chart series, stat helpers — is data-driven off ALL_GAMEMODE_KEYS and picks the new mode up automatically. PlayerDataPIT changed shape, so the persisted query cache buster is bumped to "2". The session-detail-page branch also uses "2"; it will be rebased on top of this later. Must not be deployed before flashlight serves the "4v4" block in its PIT responses — parsing crashes on payloads without it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add "4v4" to both streak maps (winstreaks / finalKillStreaks) in the wrapped query types, to the mode list rendered by the Streaks section, and to the MSW wrapped mock and UI-test fixture. Mirrors the existing modes' handling: the StreakInfo fields stay non-optional in TS even though flashlight omits absent streaks on the wire, matching how solo/doubles/threes/fours are typed today. Requires flashlight to serve 4v4 wrapped streaks (plan step F4/F5) before this reaches production. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements steps R1 (core gamemode plumbing) and R2 (wrapped page) of
plans/2026-07-06-4v4-full-support.md, one commit each.Warning
Merge gate: do not merge until flashlight F1–F4 are deployed (plan step F5). A rainbow built with this change crashes on PIT responses that lack the
"4v4"block.R1 — core gamemode plumbing (
feat(stats))"4v4"added toALL_GAMEMODE_KEYS(betweenfoursandoverall— controls selector/chart order), gamemode labels, andGAMEMODE_COLORS(#ef4444)APIPlayerDataPIT/PlayerDataPIT/apiToPlayerDataPITgain the"4v4"stats block"1"→"2"(shape change). Thesession-detail-pagebranch also uses"2"; it will be rebased on top of this later.overall = Σ(modes)invariant (* 4→* 5)PlayerDataPITneeded the new key (caught by type-aware oxlint, which checks tests even thoughtscdoesn't)Everything else (zod
?gamemode=4v4search params, selectors, chart series, stat helpers) is data-driven offALL_GAMEMODE_KEYSand needs no edits.R2 — wrapped page (
feat(wrapped))"4v4"added to both streak maps (winstreaks/finalKillStreaks) in the wrapped query types, mirroring the existing modes' non-optional typingVerification
Both commits:
pnpm run tscclean,pnpm test:unit622/622,pnpm test:ui:chromium201/201,pnpm lint:checkclean (also enforced by pre-commit hooks).Follow-up after this lands on main: R3 — rebase #256 and promote 4v4 on the session detail page.
🤖 Generated with Claude Code