Skip to content

feat(cardshed): implement S01 MainMenu (M3 — first half of #149)#159

Merged
w7-mgfcode merged 2 commits into
masterfrom
feat/cardshed-main-menu
May 21, 2026
Merged

feat(cardshed): implement S01 MainMenu (M3 — first half of #149)#159
w7-mgfcode merged 2 commits into
masterfrom
feat/cardshed-main-menu

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

First half of #149 (M3 only). M4 PlayerSetup + matchStore ships in a follow-up PR — it needs its own Stitch run for S02 per the warm-session-drop invariant.

Summary

  • Stitch run T2 — BLUEPRINT.md & architecture docs rewrite #2 — S01 MainMenu. DS-1 propagated via designSystem parameter (asset `a70557bcdeed4f9ca600d28ffca0d467`, "Tournament Card Elite"). Theme block round-trips byte-identical to S03 Table — confirming DS-1 carries cleanly across screens.
  • Wired DS-1 into apps/ui/src/index.css. Replaced the M1 placeholder `@theme` with the full DS-1 token block from `.stitch/DESIGN.md` §9 (felt, ink, accents, card, outlines, typography, spacing, radius). Added Google Fonts `@import` for Inter + Playfair Display before the `tailwindcss` import (CSS spec ordering).
  • Implemented MainMenu.tsx as a stateless presentational component consuming DS-1 tokens via CSS vars (no inline hex). Three buttons: gold PLAY pill with glow + two ghost-styled RULES/SETTINGS pills + decorative fanned cards.
  • App.tsx routes between MainMenu and three labelled placeholders ("Coming at M4 (S02)", etc.) so every button lands somewhere visible. Real PlayerSetup / Rules dialog / Settings dialog land at their owning milestones (M4 / M11 / M11).

Acceptance gates (PRP 3 §M3 lines 758–773)

  • `Skill: stitch-design` → `docs/SCREENS/main-menu.md` committed with full provenance
  • `apps/ui/src/features/menu/MainMenu.tsx` consumes DS-1 tokens — no invented colors / spacing
  • `App.tsx` updated to route to MainMenu
  • Click "Play" advances (to a labelled M4 placeholder — real PlayerSetup is M4)
  • `agent-browser` captured boot, Play-click, and back-navigation at 1440 × 900
  • `npm run build` green
  • `npm run lint` green (`--max-warnings 0`)
  • Zero console errors

Evidence

  • dogfood-output/20260521T195710Z/m3-main-menu/ — three screenshots + report.md
    • 01-mainmenu-1440x900.png — initial render
    • 02-play-click-routes-to-m4-placeholder.png — Play navigates correctly
    • 03-back-to-mainmenu.png — back navigation restores MainMenu
  • Stitch source-of-truth: .stitch/designs/S01-main-menu.{html,png}
  • Decision doc: docs/DECISIONS/2026-05-21-stitch-run-2.md records what Stitch produced, what was skipped (mouse-tracking gradient + audio cue + ornament footer line), and the token-name bridge between Material-3 names Stitch uses and the domain names DS-1 uses
  • Screen doc: docs/SCREENS/main-menu.md documents the component contract + layout regions + token consumption table

What this PR does NOT do

  • No M4 PlayerSetup — needs another Stitch session. Play button currently routes to a labelled placeholder.
  • No Rules dialog — that's S09 / M11. Rules button routes to placeholder.
  • No Settings dialog — that's S10 / M11. Settings button routes to placeholder.
  • No framer-motion animations — Tailwind transitions only. Real motion tokens (--motion-snap, --motion-card-snap) wire at M14.
  • No mobile sweep — M13 owns responsive.

Notable design decisions (also in docs/DECISIONS/2026-05-21-stitch-run-2.md)

  • Mouse-tracking radial gradient skipped. Stitch's HTML added a `mousemove` listener repainting the body bg. Distracting against the calm-tournament tone the brief anchored.
  • Audio hover cue removed. MVP scope excludes audio per PRP 3 §A.
  • Token bridge. Stitch's HTML uses Material-3 names (`secondary-container`, `on-surface-variant`). DS-1 uses domain names (`accent`, `ink-muted`). 1:1 mapping documented in docs/SCREENS/main-menu.md § "Token consumption".

Test plan

  • `cd @lab/ll-CARDSHED/apps/ui && npm install && npm run build && npm run lint` — all green
  • `npm run dev` then open http://localhost:4343 — MainMenu renders, fonts load, no console errors
  • Click PLAY → "PLAYER SETUP / Coming at M4 (S02)" placeholder
  • Click "BACK TO MENU" → MainMenu restored
  • Visual diff against `.stitch/designs/S01-main-menu.png` (Stitch mockup) — fidelity per the table in `dogfood-output/20260521T195710Z/m3-main-menu/report.md`

Next (post-merge → M4)

Follow-up session opens, runs one Stitch generation for S02 PlayerSetup against the same project ID + DS-1, implements `PlayerSetup.tsx` + `matchStore.ts` (zustand) calling `@cardshed/core.startNewRound(null, seed)` where `seed` comes from `crypto.getRandomValues()` called once outside core (per PRP 3 M4 common-bug warning). Closes #149.

First half of #149. M4 (PlayerSetup + matchStore) ships in a follow-up
session — needs its own Stitch run per the warm-session-drop invariant.

Stitch run #2 (S01 MainMenu)
  - DS-1 propagated via designSystem=assets/a70557bcdeed4f9ca600d28ffca0d467
    — theme round-trips byte-identical to S03 Table.
  - Project 4083518914509964664 / Screen cb1645e2f8f84834914174930efbbfb6.
  - .stitch/designs/S01-main-menu.{html,png} kept as visual source-of-truth.

apps/ui — wire DS-1 + render MainMenu
  - index.css: replace M1 placeholder @theme with the full DS-1 token block
    from .stitch/DESIGN.md §9 (felt, ink, accents, card, outlines, type,
    spacing, radius). Add Google Fonts @import for Inter + Playfair Display
    BEFORE the tailwindcss @import (CSS spec ordering).
  - features/menu/MainMenu.tsx: stateless presentational component, props
    {onAction, version}. Tokens consumed via CSS vars (no inline hex).
    PrimaryButton (gold pill + glow) + GhostButton (1px outline-variant)
    + FannedCardsMotif (aria-hidden decorative).
  - lib/cn.ts: clsx + tailwind-merge helper.
  - App.tsx: replace M1 boot stub. Tiny useState screen router with three
    placeholders ("Coming at M4 (S02)" / "Coming at M11 (S09)" / "...S10")
    so all three menu buttons land somewhere visible. Real PlayerSetup,
    Rules, Settings ship at their owning milestones.

What this PR does NOT do
  - No PlayerSetup component (M4 owns it).
  - No matchStore (M4 owns it).
  - No mouse-tracking gradient or audio cue from Stitch's HTML — skipped
    per docs/DECISIONS/2026-05-21-stitch-run-2.md.
  - No framer-motion (M14).
  - No mobile sweep (M13).

Evidence
  - dogfood-output/20260521T195710Z/m3-main-menu/ — three agent-browser
    screenshots (initial render, Play→placeholder, back-to-menu) +
    report.md. Zero console errors.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Warning

Rate limit exceeded

@w7-mgfcode has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 2 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d2513fa-a984-40c1-ba88-6fe9f3f4c78a

📥 Commits

Reviewing files that changed from the base of the PR and between d07c3ca and 2672655.

⛔ Files ignored due to path filters (4)
  • @lab/ll-CARDSHED/.stitch/designs/S01-main-menu.png is excluded by !**/*.png
  • @lab/ll-CARDSHED/dogfood-output/20260521T195710Z/m3-main-menu/01-mainmenu-1440x900.png is excluded by !**/*.png
  • @lab/ll-CARDSHED/dogfood-output/20260521T195710Z/m3-main-menu/02-play-click-routes-to-m4-placeholder.png is excluded by !**/*.png
  • @lab/ll-CARDSHED/dogfood-output/20260521T195710Z/m3-main-menu/03-back-to-mainmenu.png is excluded by !**/*.png
📒 Files selected for processing (8)
  • @lab/ll-CARDSHED/.stitch/designs/S01-main-menu.html
  • @lab/ll-CARDSHED/apps/ui/src/App.tsx
  • @lab/ll-CARDSHED/apps/ui/src/features/menu/MainMenu.tsx
  • @lab/ll-CARDSHED/apps/ui/src/index.css
  • @lab/ll-CARDSHED/apps/ui/src/lib/cn.ts
  • @lab/ll-CARDSHED/docs/DECISIONS/2026-05-21-stitch-run-2.md
  • @lab/ll-CARDSHED/docs/SCREENS/main-menu.md
  • @lab/ll-CARDSHED/dogfood-output/20260521T195710Z/m3-main-menu/report.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cardshed-main-menu

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@w7-mgfcode w7-mgfcode merged commit 748d164 into master May 21, 2026
14 checks passed
@w7-mgfcode w7-mgfcode deleted the feat/cardshed-main-menu branch May 21, 2026 20:14
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.

feat(cardshed): pre-match screens — MainMenu + PlayerSetup (M3+M4)

1 participant