- Subscribes to store.items signal
- Displays each item with name and formatted price
- Includes ItemAssign component for each item
- Shows empty state when no items added
- Multi-select checkbox UI for each person
- Reflects current assignment state
- Toggles person on/off when clicked
- Calls store.setAssignment on change
- Shows hint when no people added
- Controlled form with name and price inputs
- Calls store.addItem on form submit
- Shows error message on validation failure
- Clears inputs on successful add
- 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>
- 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>
- 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>
- 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>
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.
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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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.
- 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>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added game-over-overlay div with fixed positioning and z-index 1000
- Added overlay-content div with semi-transparent background
- Added game-over-message h1 element for win/lose message
- Added restart-button button with hover effect
- Overlay hidden by default (display: none)
- Styling matches score overlay pattern
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created comprehensive test suite with 10 test cases
- Tests cover valid/invalid move detection, type-optimization, edge cases
- Tests verify path detection with 0, 1, and 2 turns
- Tests verify cleared tiles are skipped and empty board handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add transition validation with validTransitions mapping
- Implement transitionTo() method with validation and event emission
- Add canSelectTile() helper method for input blocking
- Add reset() method for restart functionality
- Update tests to cover all state machine behavior (7 test cases)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add Phase 3 plan files (pathfinding, scoring, visual feedback),
update state tracking for Phase 4 context, and clean up gitignore.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark Phase 3 as completed in roadmap, add verification documentation,
and create Phase 4 context for Game State Management.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added clearTiles method that marks tiles as cleared
- Emits tile:cleared event for each cleared tile
- Calls deselectAll() after clearing tiles
- Enables CORE-05 (connected tiles disappear) and CORE-07 (cleared tiles become passable)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created test suite with 5 test cases for score calculation
- Tests cover base score (100), 0-turn bonus (150), 1-turn bonus (125)
- Tests verify default to base score for invalid turn counts
- Tests verify integer scores (no floating point)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added PathNode interface for BFS state tracking (row, col, direction, turns, path)
- Added MatchResult interface for match validation results (valid, reason, path, turns)
- Created test file with type import tests
- Direction encoding: -1=none/start, 0=up, 1=right, 2=down, 3=left
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add shell configs, IDE files, and local configs to .gitignore
- Add Phase 2 planning artifacts (CONTEXT, RESEARCH, VERIFICATION)
- Add GridManager test suite
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add resizeTimeout field for debounce timer
- Add handleResize() method with 150ms debounce
- Add window resize event listener
- Recalculate canvas size on resize
- Trigger renderer.render() after resize
Implements Task 3 of plan 02-03
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add setupInputListeners() public method
- Add handleClick and handleTouch event handlers
- Add handleInput() method for coordinate translation
- Implement getBoundingClientRect() for accurate hit detection
- Account for device pixel ratio in coordinate calculations
- Map canvas coordinates to tile grid position
- Call gridManager.selectTile() for valid tiles
Implements Task 2 of plan 02-03
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add GridManager and Renderer imports
- Add gridManager and renderer fields to Game class
- Initialize GridManager and create grid in constructor
- Initialize Renderer with canvas reference
- Delegate render() to renderer.render()
- Add tilesSelected event listener for logging
Implements Task 1 of plan 02-03
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created Renderer class with tile rendering, selection highlighting, and fade-in animations
- Created GridManager class with tile array and selection state management (blocking dependency)
- Added tilesSelected event to GameEvents interface
- Created comprehensive test suite for Renderer with 9 test cases
**Renderer Features:**
- Renders all non-cleared tiles from GridManager at correct positions
- Centers grid horizontally and vertically within canvas
- Displays emoji characters centered within tile bounds
- Selection highlights with border (3px) and background tint (30% opacity)
- Fade-in animation over ~100ms using performance.now()
- Uses CONFIG.tile.size, gap, cornerRadius for positioning
- Respects CONFIG.colors for styling
**GridManager Features:**
- Manages 2D tile array (10x16 grid = 160 tiles)
- Selection state tracking with toggle behavior (0-2 tiles)
- selectTile() with toggle deselect and cleared tile filtering
- Emits tilesSelected event when 2 tiles selected
- getTileAt() for coordinate-based tile access
**Note:** Tests created but not runnable due to sandbox file system restrictions
preventing npm install. Implementation verified manually against plan requirements.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Node's 'events' module doesn't work in browsers. Replaced with custom
Map-based implementation that provides the same API but works in both
Node.js and browser environments.
All 98 tests still pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update main.ts to import and instantiate Game class
- Wait for DOMContentLoaded before initializing
- Add error event listener on game.events
- Add tick event listener (commented debug logging)
- Log initialization message to console
- Add main.test.ts with entry point tests (4 tests)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create Game class that orchestrates canvas, game loop, and events
- Game constructor initializes canvas, context, loop, and events
- Game.start() starts the loop and emits 'game:start' event
- Game.render() clears canvas with background color
- Handle device pixel ratio for sharp rendering
- Add comprehensive tests (15 tests) for Game class
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Changed EventEmitter generic constraint to `object` for interface compatibility
- Fixed GameLoop test closure variable narrowing issue by using array
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Tests for constructor with id, type, position
- Tests for emoji getter returning correct emoji
- Tests for isAdjacent() method with various positions
- Tests for readonly properties and cleared default
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Generic class wrapping Node's EventEmitter
- Type-safe on(), emit(), off() methods
- Added once() and removeAllListeners() methods
- Returns this for method chaining
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Tests for on(), emit(), off() methods
- Tests for multiple listeners and chaining
- Tests for type safety with typed payloads
- Tests for error handling and once() method
- Tests for removeAllListeners()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Tests for start(), stop(), isRunning(), getRafId()
- Tests for update callback with deltaTime
- Tests for delta time accumulation
- Tests for loop lifecycle (start/stop multiple times)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>