feat(cardshed): implement S02 PlayerSetup + matchStore (M4)#160
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Closes second half of #149 (M3 closed via #159 / #148 closed via #156). Implements PRP 3 §A M4 — the PlayerSetup screen (S02) plus the
matchStorethat bridges the UI to@cardshed/core.startNewRound.apps/ui/src/features/lobby/PlayerSetup.tsx— Stitch-origin (DS-1 propagated viadesignSystemparam), 3–4 name inputs, optional Player 4 remove, Advanced disclosure showing the real RNG seed + Randomize, accessibility wired (single<h1>,<label htmlFor>,role="status" aria-live="polite",aria-disabled+aria-describedbyon the Start button while invalid).apps/ui/src/state/matchStore.ts— zustand.startMatch({ players, seed })calls@cardshed/core.startNewRound(null, seed, { matchId, players }). Seed is generated viagenerateMatchSeed()— onecrypto.getRandomValues(new Uint32Array(1))[0]call outside the core (per PRP 3 M4 common-bug warning).apps/ui/src/App.tsx—mainmenu→player-setup→table-placeholder(M5 owns the real Table). Back-to-menu also callsmatchStore.reset().docs/SCREENS/player-setup.md+docs/DECISIONS/2026-05-21-stitch-run-3.md+.stitch/designs/S02-player-setup.{html,png}.apps/ui/src/state/matchStore.test.ts— 7/7 vitest green (3-player, 4-player, <3 reject, >4 reject, replay invariant, seed sanity).dogfood-output/20260521T202659Z/m4-setup/— 7 screenshots at 1440 × 900 +report.mdcovering: empty disabled → 3 names enabled → 4 names + Advanced → Start → placeholder → back → 1-name disabled.Acceptance gates (PRP 3 §M4 lines 776–793)
MatchStatevalid for 3 namesMatchStatehas 4 players for 4 namescrypto.getRandomValuesonce, outside coreagent-browserdogfood capturedTest plan
npm run lint— clean (eslint --max-warnings 0)npm run build— green (12.16 kB CSS / 178.69 kB JS / 0 warnings)npm test— 7/7 green (matchStore engine integration + replay invariant)agent-browserat 1440 × 900 — 7 screenshots covering 0/1/3/4 name states + Start nav + back navOut of scope
Decisions (
docs/DECISIONS/2026-05-21-stitch-run-3.md)◀,▼,▲) — consistent with M3.© 2024 CARD SHED v1.0.4-betafooter line removed.style={{ var(--color-…) }}— same pattern as M3 MainMenu; the wrapper-vs-utility decision lands before M5 (Table).