39bfcd2032c61db99c10cb90ff3dafa3d9624957
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
572c86192f |
feat(02-03): journal + reveal modal + harvest pointer wiring
Task 2 of Plan 02-03: ship the Memory Journal UI surfaces (D-23/D-24/D-25) and wire harvest + compost pointer events through the Garden scene to the sim → store → React reveal flow. src/ui/journal/ (new module): - Journal.tsx — full-screen modal (D-24); fragments grouped by Season; DOM-rendered text with userSelect: text per MEMR-05; reads harvestedFragmentIds from the store; resolves ids against the eager `fragments` corpus (defensive — unresolvable ids skip silently). - FragmentRevealModal.tsx — D-25 active-play reveal modal; backdrop click + inner Close button dismiss; event.stopPropagation on the article body so clicking inside the text doesn't dismiss; defensive silent dismiss on unresolvable id. - journal-icon.tsx — D-23 + D-29 corner affordance; gated by selectJournalRevealed (`harvestedFragmentIds.length > 0`); local open state (no store pollution); 'j' hotkey deferred to Plan 02-05. - index.ts — barrel. - 16 new Vitest cases across 3 test files (Journal: 7 / FragmentRevealModal: 6 / journal-icon: 3); all green. src/App.tsx — mount FragmentRevealModal + JournalIcon as DOM siblings of PhaserGame. src/ui/index.ts — re-export ./journal. src/game/scenes/Garden.ts — harvest/compost pointer flow: - create() builds a SimContext from the eager `fragments` corpus filtered to Season 1; passed to every simulateOneTick call (Phase 4+ should swap to await loadSeasonFragments(currentSeason) when Season transitions land). - handleTilePointerDown branches on tile state: empty → seed picker event; ready plant → enqueue 'harvest' command; immature plant → enqueue 'compost' command (TODO Plan 02-04: render the Ink-authored compost acknowledgement beat from compost-acknowledgements.ink). - update() detects newly-appended harvestedFragmentIds and sets fragmentRevealId so the reveal modal pops with the new fragment text. - BLOCKER 3 invariant preserved — sim writes tickCount, never lastTickAt. content/dialogue/season1/compost-acknowledgements.ink — authored content for the GARD-04 + D-07 compost beat. 6 short lines in the gardener-keeper voice (NOT Lura — she's the warmth anchor; the garden's voice is the contrast). Plan 02-04 wires the inkjs runtime; Plan 02-03 ships the content so the writer can iterate independently. 214/214 tests green (was 163; +51 new this plan); npm run lint exits 0; npm run ci exits 0; npm run build exits 0 with the expected INEFFECTIVE_DYNAMIC_IMPORT warnings (eager `fragments` export still imports the Season-1 yaml/md statically alongside the lazy loadSeasonFragments path — documented in 02-02-SUMMARY.md). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
df7d687da4 |
chore(01-01): scaffold Phaser 4 + React 19 + Vite + TS template + Phase-1 deps + firewall directories
- Built equivalent React + Vite + TypeScript scaffold by hand because the official npm create @phaserjs/game@latest scaffolder is interactive-only and the documented --template/--yes flags are ignored (verified 2026-05-08 with create-game v1.3.2). Plan Step 1 explicitly authorizes this fallback. Resulting tree mirrors the official template shape: index.html, src/main.tsx, src/App.tsx, src/PhaserGame.tsx, src/game/main.ts, src/game/scenes/Boot.ts. - Installed Phase-1 production deps at versions verified in RESEARCH.md: phaser@4.1.0, react@19.2.6, react-dom@19.2.6, idb@8.0.3, lz-string@1.5.0, zod@4.4.3, crc-32@1.2.2, gray-matter@4.0.3, yaml@2.8.4, inkjs@2.4.0. - Installed Phase-1 dev deps: vite@8.0.11, @vitejs/plugin-react@6.0.1, typescript@6.0.3, @types/react@19, @types/react-dom@19, @types/node@22, vitest@4.1.5, @vitest/ui, happy-dom, fake-indexeddb@6 (for Plan 03 IDB tests), @playwright/test@1.59.1, eslint@9, eslint-plugin-boundaries@6.0.2, inklecate@1.8.1. - Created the seven architectural-firewall directories under src/ with .gitkeep markers (sim, render, ui, save, content, audio, store) — siblings to the template-provided src/game/ — so Plan 02's ESLint boundaries rule has clean targets per CLAUDE.md 'Architectural Firewall'. - Created repo-root /content/ (with /dialogue/ and /seasons/ subdirs) and /assets/ trees per CONTEXT D-11, D-12. - Pre-declared all downstream-required scripts in package.json so Plans 02–06 only edit code, not script keys: dev, build, preview, lint (--max-warnings 0 per RESEARCH CI Pitfall C), test (--passWithNoTests=false per CI Pitfall B), test:watch, validate:assets, compile:ink (no-op stub for Phase 1; Phase 2 replaces with real inklecate invocation), ci. - TypeScript strict mode enforced via tsconfig.json + tsconfig.app.json + tsconfig.node.json. - npm run build succeeds (tsc -b && vite build) producing dist/index.html and dist/assets/index-*.js (~1.5MB Phaser bundle; code-splitting deferred to Phase 2+ when actual scenes exist). |