Files
soroban-abacus-flashcards/REBUILD_CHECKLIST.md
Thomas Hallock bda5bc6c0e fix: prevent database imports from being bundled into client code
**Problem:**
- player-ownership.ts imported drizzle-orm and @/db at top level
- When RoomMemoryPairsProvider imported client-safe utilities, Webpack bundled ALL imports including database code
- This caused hydration error: "The 'original' argument must be of type Function"
- Node.js util.promisify was being called in browser context

**Solution:**
1. Created player-ownership.client.ts with ONLY client-safe utilities
   - No database imports
   - Safe to import from 'use client' components
   - Contains: buildPlayerOwnershipFromRoomData(), buildPlayerMetadata(), helper functions

2. Updated player-ownership.ts to re-export client utilities and add server-only functions
   - Re-exports everything from .client.ts
   - Adds buildPlayerOwnershipMap() (async, database-backed)
   - Safe to import from server components/API routes

3. Updated RoomMemoryPairsProvider to import from .client.ts

**Result:**
- No more hydration errors on /arcade/room
- Client bundle doesn't include database code
- Server code can still use both client and server utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 11:40:46 -05:00

2.2 KiB

🚂 STEAM TRAIN FEATURES REBUILD CHECKLIST

⚠️ CRITICAL: All these features were lost due to git reset fuckup. Need to rebuild systematically.

💥 FEATURES TO REBUILD:

🚂 Visual Train Features:

  • Realistic railroad tracks with ties and dual rails
  • Dynamically generated curved train tracks (not basic SVG paths)
  • Half-circle pressure gauge with narrow isosceles triangle indicator
  • Enhanced train locomotive visuals
  • Steam effects and animations

🎈 Floating Math Display System:

  • Floating speech bubble that follows the train along the track
  • Display switching logic (static → floating after delay)
  • Proper positioning that keeps math problems above the moving train

Enhanced Pressure/Momentum System:

  • Pressure system where wrong answers drop momentum to zero
  • Coal spilling animations and sound effects for wrong answers
  • Momentum-based train physics with dramatic consequences

🔊 Complete Audio System:

  • Realistic train chuffing sounds that vary with momentum
  • Steam train whistles for celebrations and milestones
  • Coal spilling sound effects with multiple chunks/scatter
  • Momentum-based audio that changes with train speed

🎨 Animations & Effects:

  • Coal shoveling animations (for correct answers)
  • Coal spilling animations (for wrong answers)
  • Steam particle effects
  • Train movement along curved paths

🎮 Game Mechanics:

  • Timer hidden for train variant only (already working)
  • Question generation system (confirmed working - no rebuild needed)
  • Proper game state management

📋 REBUILD PROGRESS TRACKING:

Completed Features:

  • (none yet - starting from scratch)

In Progress:

  • (mark items when started)

Next Priority:

  • Fix question generation system first (so game actually works)
  • Then build visual features systematically

🔥 REMINDER: Reference this checklist throughout the rebuild process to ensure no features are forgotten again.

💡 TIP: Check off items as completed and commit each feature individually to prevent future data loss.