Review: Unified Player Dashboard (/play page)
Verdict: NEEDS_REFINEMENT
Template Completeness
- [x] Type -- Feature
- [x] Lineage -- V2 ticket, part of #66
- [x] Repo -- forgejo_admin/twitch-2k-wager
- [x] User Story -- player wants unified dashboard with pool balance, proposals, games
- [x] Context -- explains V1 (guest checkout + admin queue) vs V2 (unified player dashboard) transition
- [x] File Targets -- 4 files listed with clear action verbs
- [x] Acceptance Criteria -- 9 criteria listed
- [x] Test Expectations -- 4 test cases
- [x] Constraints -- dependencies, mobile, stream visibility noted
- [x] Checklist -- standard PR/tests/no-unrelated
- [x] Related -- parent #66 and dependency tickets referenced
Traceability
- [x] story:player-propose -- verified in project-twitch-2k-wager user-stories table
- [x] story:player-decide -- verified in project-twitch-2k-wager user-stories table
- [ ] arch:twitch-2k-wager-app -- arch note MISSING in pal-e-docs. [SCOPE] Create architecture note arch-twitch-2k-wager-app for the SvelteKit frontend component.
- [x] Forgejo issue -- #70, open, forgejo_admin/twitch-2k-wager
File Targets
- [x] src/routes/play/+page.svelte -- verified: exists (5.4k, current V1 guest checkout page). REWRITE is correct.
- [ ] src/routes/play/+page.server.ts -- ISSUE: file does not exist on disk. Issue says "REWRITE" but this should be "CREATE." Parent directory src/routes/play/ exists. [BODY] Change "REWRITE" to "CREATE" for +page.server.ts.
- [x] src/routes/game/[id]/+page.svelte -- verified: exists. UPDATE is correct.
- [x] src/routes/game/[id]/+page.server.ts -- verified: exists. UPDATE is correct.
Targets are specific enough for an agent to act on without guessing.
Repo Placement
OK. Issue filed on forgejo_admin/twitch-2k-wager. All 4 file targets are in the same repo. No cross-repo work required. Single-repo ticket is correct.
Dependencies
- [ ] #67 (v2 schema -- player pools, proposals, peer-to-peer game model) -- PENDING. Open, backlog (board item #845). BLOCKER: dashboard queries pool/proposal/game tables that do not exist yet.
- [ ] #68 (deposit flow -- Stripe Checkout to fund player pool) -- PENDING. Open, backlog (board item #846). BLOCKER: dashboard shows pool balance which requires the deposit flow to exist.
- [ ] #69 (proposal API -- propose, accept, counter, decline) -- PENDING. Open, backlog (board item #847). BLOCKER: test expectations reference /api/propose and /api/accept endpoints that come from this ticket. Currently no /api/propose or /api/accept routes exist in the codebase.
- [x] #66 (parent vision) -- open. Epic umbrella, not a direct blocker.
All three blockers are in backlog. This ticket CANNOT move to in_progress until #67, #68, and #69 are merged.
Acceptance Criteria
9 acceptance criteria. Assessment:
- AC 1-7 are testable and specific -- an agent can verify pool balance display, form rendering, button presence, route behavior.
- AC 8 ("Requires authentication -- redirect if not logged in") is testable via server-side load function check.
- AC 9 ("Dark theme, mobile-friendly, stream-readable") is subjective and not agent-verifiable as written. [BODY] Refine to: "Uses existing dark theme CSS variables" (verifiable via grep) and "Mobile viewport (375px) renders without horizontal scroll" (verifiable via Playwright).
Test expectations reference /api/propose and /api/accept which do not exist yet (dependency on #69). Tests will fail until #69 merges -- this is expected and documented in Constraints.
Blast Radius
- The existing /admin route (admin-auth.ts, admin/+page.svelte, admin/+layout.server.ts, api/admin/result/) is extensive. AC says "No /admin link or reference anywhere" -- this means /play should not link to /admin, NOT that /admin is being removed. The /admin route cleanup is tracked separately (#73, board item #851).
- The /play route rewrite replaces the V1 guest checkout flow. Any external links pointing to /play with query params (tier selection) will break. This is expected for V2 but not called out in constraints.
- No downstream services affected -- this is a frontend-only rewrite consuming new API endpoints.
- Rollback is straightforward -- revert the PR to restore V1 /play.
Decomposition Assessment
Apply three-thing limit and five-minute rule:
- File count: 4 files in 1 repo. Two are rewrites/creates (play route), two are updates (game route). Under the 3-file-across-2-repos threshold.
- AC count: 9 acceptance criteria. Exceeds the 5 AC threshold.
- Estimated agent time: 5-8 minutes. Borderline on the 5-minute rule.
- Parallelization: The /play rewrite and /game/[id] update are logically independent -- they could be split into two tickets. However, they share the same proposal data model and visual language, making a single cohesive pass more efficient than two context-switching passes.
No decomposition needed. The 9 AC count is a warning flag, but the work is cohesive within a single route family. If agent exceeds 5 minutes during execution, split /game/[id] updates into a follow-up ticket.
Recommendation
- [BODY] Fix file target: src/routes/play/+page.server.ts -- change "REWRITE" to "CREATE" (file does not exist on disk)
- [SCOPE] Create architecture note arch-twitch-2k-wager-app for the SvelteKit frontend component in pal-e-docs
- [BODY] Refine AC 9 "Dark theme, mobile-friendly, stream-readable" into agent-verifiable criteria: "Uses existing dark theme CSS variables" and "Mobile viewport (375px) renders without horizontal scroll"