Commit Graph

105 Commits

Author SHA1 Message Date
tiennm99 49142bdfdd feat(01-04): create ItemForm component for adding items
- Controlled form with name and price inputs
- Calls store.addItem on form submit
- Shows error message on validation failure
- Clears inputs on successful add
2026-03-12 02:50:31 +00:00
tiennm99 be6e89e698 docs(01-03): complete People UI components plan
- Created 01-03-SUMMARY.md with full execution documentation
- Updated STATE.md position to Plan 3 of 5 (60% progress)
- Added decisions: controlled forms, signal access pattern
- All 3 tasks committed atomically

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:48:47 +00:00
tiennm99 2903191bf6 docs(01-02): complete core data layer plan
- Created 01-02-SUMMARY.md documenting currency utilities and billStore
- Updated ROADMAP.md to mark 01-02 as complete (2/5 plans done)
- All tests passing (20/20)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:47:38 +00:00
tiennm99 7893729563 feat(01-03): wire components in App with Vite + Preact setup
- Create App.jsx importing PersonForm and PeopleList
- Create main.jsx entry point for Preact render
- Add index.html as app entry point
- Add basic CSS styles for layout
- Configure Vite with @preact/preset-vite
- Update vitest config for Preact/jsdom environment
- Add missing dependencies (preact, vite, @preact/preset-vite)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:46:25 +00:00
tiennm99 710fb8d733 docs(01-01): complete test infrastructure plan
- Created SUMMARY.md with execution details and deviations
- Updated STATE.md with plan completion metrics
- Updated ROADMAP.md with plan 01-01 progress
- Marked PEOPLE-01 through PEOPLE-04 as complete in REQUIREMENTS.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:46:21 +00:00
tiennm99 e49c7bc605 feat(01-03): create PeopleList component
- Subscribes to store.people signal
- Renders list of person names with unique keys
- Shows empty state when no people added
- Preact Signals auto-track dependencies in components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:46:12 +00:00
tiennm99 62240697ce feat(01-03): create PersonForm component
- Controlled form with useState for local state
- Calls store.addPerson on form submit
- Shows error message if addPerson fails
- Clears input on successful add
- Uses Preact hooks for form state management

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:46:06 +00:00
tiennm99 801f40f229 fix(01-01): fix syntax error in billStore.js negation operator
- Fix escaped exclamation marks (\! to !) in condition checks
- Add currency utility module (dollarsToCents, centsToDollars, formatCurrency)

All 20 tests now pass (10 billStore + 10 currency)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:42:28 +00:00
tiennm99 1a4367fc32 feat(01-01): set up test infrastructure with Vitest
- Add package.json with Vitest, jsdom, Vite, and Preact dependencies
- Configure Vitest with jsdom environment for component testing
- Create test stubs for billStore (PEOPLE-01, PEOPLE-02, PEOPLE-03, PEOPLE-04)
- Create test stubs for currency utilities (dollarsToCents, centsToDollars, formatCurrency)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:40:10 +00:00
tiennm99 f917177215 chore(01-01): configure Vitest test infrastructure
- Add vitest.config.js with jsdom environment and global test APIs
- Install vitest and jsdom as dev dependencies
- Add test scripts (test, test:run) to package.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 02:39:49 +00:00
tiennm99 9e8335af90 docs(01): create Phase 1 plans for bill entry and assignment 2026-03-12 02:08:47 +00:00
tiennm99 1cb89716d9 docs(01): add validation strategy 2026-03-12 01:59:35 +00:00
tiennm99 f8e9bf434f docs(01): research phase domain - bill entry & assignment 2026-03-12 01:58:22 +00:00
tiennm99 0959e43ee2 docs: create roadmap (3 phases) 2026-03-11 20:16:05 +00:00
tiennm99 f676e189f1 docs: define v1 requirements 2026-03-11 20:14:24 +00:00
tiennm99 d634d220cf docs: complete project research 2026-03-11 20:11:51 +00:00
tiennm99 891e7fe1ca chore: add project config 2026-03-11 20:03:00 +00:00
tiennm99 1a54ab0dfa docs: initialize project 2026-03-11 16:37:11 +00:00
tiennm99 a13db5481a chore: add Claude Code GSD framework configuration and agents
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:50:35 +07:00
tiennm99 196db6bbc3 chore: reset 2026-03-11 22:35:40 +07:00
tiennm99 004664e2df Archive v1.0 planning; finalize MVP docs
Archive and finalize v1.0 milestone and planning artifacts: add MILESTONES.md, milestone archives (v1.0-ROADMAP.md, v1.0-REQUIREMENTS.md), verification and phase artifacts, and update phase/roadmap/project state to mark v1.0 MVP as shipped. Tidy PROJECT and ROADMAP to reflect shipped features and next steps, remove the old REQUIREMENTS.md (moved to milestone archive), and update STATE.md to show milestone completion. Minor code change: expose GridManager.events as public readonly to allow external subscribers. Package metadata: normalize keywords formatting and add an optional dependency entry in package.json for rollup native binary support.
2026-03-11 21:54:55 +07:00
Claude Code 7a38e4c77c fix(06): connect GridManager events to Game match handler
Bug: Game was listening on its own events emitter for 'tilesSelected'
but GridManager emits on its own events emitter.
Fix: Changed listener from this.events to this.gridManager.events

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:18:03 +00:00
Claude b49ea1bb93 docs(06-04): complete responsive canvas scaling plan
- Enhanced setupCanvas() with viewport-based scaling
- Scale down only, never scales up
- CSS transform for display scaling (preserves coordinates
- Added comprehensive test coverage for responsive scaling behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:01:16 +00:00
Claude 2b40554330 docs(06-04): complete responsive canvas scaling plan
- Enhanced setupCanvas() with viewport-based scaling
- Scale down only on scales to fit viewport on mobile devices
- CSS transform for display scaling (preserves coordinate mapping
- Added comprehensive test coverage for responsive scaling

- Verified coordinate mapping works correctly with CSS transform

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:58:53 +00:00
Claude b1192774ed docs(06-01): complete Tile Match Animations plan
- MatchAnimation class with easeOutBack easing for satisfying pop effect
- scale+fade transforms in renderTile()
- CONFIG.animation.matchDuration = 250ms
- All tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:54:18 +00:00
Claude 6f660c223b docs(06-02): complete path glow effect plan
- Created 06-02-SUMMARY.md with accomplishments, deviations, and metrics
- Updated STATE.md with plan completion and decisions
- Updated ROADMAP.md progress (3/4 summaries complete)
- Marked UX-01 requirement complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:53:56 +00:00
Claude Code 4d8ceeee01 docs(06-02): complete path glow effect plan
- Added shadowBlur glow effect to path visualization
- Wired animateMatch call for concurrent tile animations
- Auto-fixed missing MatchAnimation integration from plan 06-01

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:52:24 +00:00
Claude 51ed2f30a5 feat(06-01): integrate MatchAnimation into Renderer with animateMatch method
- Add animateMatch() method to start animations for matched tiles
- Apply scale/alpha transforms in renderTile() when animation exists
- Clean up completed animations from matchAnimations map
- Add tests for animateMatch integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:49:18 +00:00
Claude Code 29ae674e15 feat(06-02): wire animateMatch call to tilesMatched event
- Add animation.matchDuration=250 to CONFIG
- Add matchAnimations Map and animateMatch method to Renderer
- Apply scale+alpha transforms in renderTile for animating tiles
- Wire animateMatch call in Game.ts after drawPath

This completes the dependency from plan 06-01 (Rule 2 auto-fix for missing critical functionality)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:49:11 +00:00
Claude ac1860df28 feat(06-01): add animation.matchDuration to CONFIG
- Add animation configuration object with matchDuration: 250ms
- Per CONTEXT.md recommendation (200-300ms range)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:46:56 +00:00
Claude Code f220fe4ae1 feat(06-02): add glow effect to path line visualization
- Add shadowBlur=15 and shadowColor='#00ff00' for green glow
- Wrap path drawing in ctx.save()/ctx.restore() for state preservation
- Add tests for glow effect properties (shadowBlur, shadowColor, save/restore)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:44:57 +00:00
Claude Code 6beae97b7e docs(06-03): complete mobile touch optimization plan
- SUMMARY.md with RippleAnimation implementation details
- STATE.md updated with Phase 6 position and decisions
- ROADMAP.md updated with plan progress
- REQUIREMENTS.md: UX-02 marked complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:44:31 +00:00
Claude Code d672975d55 feat(06-03): trigger ripple effect on touch/click input
- Add renderer.addRipple(x, y) call in handleInput method
- Ripple appears at touch/click coordinates before tile selection
- Provides visual feedback for all input interactions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:41:57 +00:00
Claude Code d660e09703 feat(06-03): add RippleAnimation class for touch feedback
- Add RippleAnimation class with 300ms duration and 40px max radius
- Add rippleAnimations property to Renderer
- Add addRipple(x, y) method to trigger ripple effect
- Render ripples in main render loop with auto-cleanup
- Use selection color (rgba 233, 69, 96) for visual consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:40:52 +00:00
Claude Code 6f651e7d6e feat(06-03): add touch-action CSS for mobile optimization
- Add touch-action: none to canvas to prevent zoom/scroll
- Add overflow: hidden to body to prevent page scroll
- Mobile touch gestures now properly blocked during gameplay

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:34:53 +00:00
tiennm99 f620340a8e fix(06): correct dependency for plan 06-02 on 06-01 2026-03-11 11:34:11 +00:00
tiennm99 8da131f47e docs(06): add phase plans for Polish and UX 2026-03-11 11:18:34 +00:00
tiennm99 72778a9dba docs(06): add research and validation strategy 2026-03-11 11:10:03 +00:00
tiennm99 a221c99345 docs(06): research Phase 6 polish and UX domain 2026-03-11 11:08:59 +00:00
tiennm99 4b491dd45d docs(state): record phase 6 context session 2026-03-11 10:54:40 +00:00
tiennm99 fad9718442 docs(06): capture phase context for Polish and UX 2026-03-11 10:54:34 +00:00
tiennm99 d4b329b73f Add game-state planning, NoMovesDetector & overlay
Update project planning and implement game-end components: tweak .gitignore entries, bump planning state progress, and add extensive Phase 04 artifacts (plans, summary, research, validation) plus Phase 05 initial plan. Deliverables include index.html overlay for game-over UI and modifications to src/game/Game.ts and src/models/Tile.ts to support win / no-moves detection and restart hooks; also add GameStateManager / NoMovesDetector integration notes and tests scaffolding in planning docs. Purpose: prepare and record implementation details for win/lose detection, game-over overlay, input blocking, reset/restart flow, and board-generation recovery.
2026-03-11 17:45:14 +07:00
GSD Executor 2a8775fc2f docs(05-01): complete Random Board Generation plan 2026-03-11 10:12:37 +00:00
GSD Executor ea4aa8a1bf docs(05-01): complete Random Board Generation plan
- Created SUMMARY.md with execution results
- Updated ROADMAP.md with plan progress
- Updated STATE.md with position and decisions, and session info

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-11 10:11:50 +00:00
GSD Executor fd813ecaa4 feat(05-01): implement random board generation with Fisher-Yates shuffle
- Add board:generated event to GameEvents interface
 - implement generateRandomGrid() method with solvability verification
 - Enhance initializeGrid() to use NoMovesDetector for verification
 - Add tests for random board generation
 - add import for NoMovesDetector

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-11 10:09:23 +00:00
GSD Executor bec8532c07 feat(05-02): implement shuffleTiles() method with Fisher-Yates shuffle
- shuffleTiles() redistributes tile types while preserving positions
- Clears selection to prevent stale tile references
- Emits board:shuffling before and board:shuffled after
- Handles partially cleared boards correctly
- Added comprehensive test coverage for shuffle functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:05:43 +00:00
GSD Executor db8a72f2e1 test(05-02): add shuffle events to GameEvents interface
- Add board:shuffling event with tilesRemaining payload
- Add board:shuffled event with tilesRemaining payload
- These events enable UI feedback during tile shuffle recovery

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:02:14 +00:00
GSD Executor 6a8862397d feat(04-04): wire up restart button click handler
- Added restart button click event listener in Game constructor
- Click handler calls restart() method to reset game
- Null check for restart button element (defensive programming)
- Tests verify click handler registration and restart() invocation
- Tests verify graceful handling of missing button element

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 08:29:09 +00:00
GSD Executor c9d0fdbc63 feat(04-04): implement restart() method with score preservation
- Added previousScore property to Game class
- Implemented restart() method that stores previousScore, resets grid/score/state/UI
- Added updatePreviousScoreDisplay() helper method
- Added game:restart event type to GameEvents interface
- Restart resets grid via initializeGrid(), resets score to 0, transitions state to IDLE
- Previous score preserved and displayed, hidden if 0
- All tests passing for restart functionality

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 08:28:44 +00:00
GSD Executor 1b7324141e test(04-04): add previous score display tests and HTML element
- Added tests for previous-score-display element existence and styling
- Added previous-score-display div to HTML with score-container wrapper
- Element initially hidden with display: none
- Follows existing score-display pattern for consistency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 08:28:07 +00:00