Skip to content

feat(cardshed): table render + privacy splash (M5+M6) #147

@w7-mgfcode

Description

@w7-mgfcode

Sub-issue of #146. PRP 3 milestones M5 (Table render / S03) + M6 (Privacy splash / S04). Reference: `PRPs/cardshed-03-experience-prp.md` lines 796–842.

Scope

M5 — Table

  • `docs/SCREENS/table.md` (Stitch)
  • `apps/ui/src/features/table/Table.tsx` — reads `matchStore` + `createPrivateView(state, viewerId)`
  • `apps/ui/src/components/{Card,Hand,OpponentBar,TrumpIndicator,DeckPile,DiscardPile,PhaseLabel}.tsx`
  • `apps/ui/src/dispatcher/LocalDispatcher.ts` — wraps `@cardshed/core`; exposes `dispatch(action) → ActionResult`; emits to in-process EventBus

M6 — Privacy splash

  • `docs/SCREENS/privacy.md` (Stitch)
  • `apps/ui/src/features/privacy/PassDeviceSplash.tsx` — between turns, blank previous player's view, "Pass device to {next}" + confirm
  • `apps/ui/src/state/uiStore.ts` (currentViewerId, transitions)

Acceptance

  • `Skill: stitch-design` → both screens committed
  • Seeded match → Table shows 3–4 opponents (count only), deck=`52 - (5 * playerCount)`, trump indicator = bottom card's suit
  • Playwright assert: NO opponent hand contents in DOM — uses `createPrivateView`, never raw `MatchState`
  • Card components read `card.suit` / `card.rank` — NEVER parse `card.id`
  • After every action changing attacker/defender, PassDeviceSplash interposes
  • Previous hand DOM is unmounted (not just `display:none`) on hand-off
  • Confirm tap required to advance — no auto-advance
  • `agent-browser` captures `dogfood-output//{m5-table,m6-privacy}/`

Common bugs (from PRP 3)

  • Leaking opponent hand contents via raw `MatchState` — use `createPrivateView` only
  • Card component parsing `card.id` for suit/rank (FORBIDDEN)
  • `display:none` on previous hand — STILL inspectable; must UNMOUNT
  • Auto-advancing without confirm — destroys pass-and-play privacy

Complexity

M + M = ~7–9 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions