- Add monster attack animation (rubber band snap towards player)
- Fix animation direction (now snaps left towards player)
- Add orange highlight on attacking monster
- Fix animation persistence through DOM rebuilds
- Prevent login music playing over game music on refresh
- Check for existing auth before starting login music
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix class skill names: Game now reads from class_skills table (what admin edits) instead of legacy class_skill_names table
- Add per-hit targeting mode for multi-hit skills (configurable in admin)
- Music now attempts autostart on page load
- WASD keyboard controls auto-enable test mode (like on-screen buttons)
- Update CLAUDE.md with Docker restart vs rebuild documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Key fixes:
1. Add pagehide handler for reliable mobile saves
2. Add visibilitychange handler - refresh stats when tab becomes visible
3. Add cache: 'no-store' to all stats API calls to bypass browser cache
4. Mount service-worker.js in docker-compose (was using stale cached version)
This ensures:
- Mobile saves reliably when switching apps or closing
- Desktop fetches fresh data when tab becomes active
- Browser cache never serves stale API responses
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Service Worker changes:
- Bump version to v1.0.1 to invalidate old caches
- Use network-first strategy for all API calls
- Use network-first strategy for HTML files
- Only use cache-first for static assets (CSS, JS libs, images)
Server changes:
- Serve service-worker.js with no-cache headers
- Serve HTML files with no-cache headers
Client changes:
- Detect service worker updates and auto-reload page
- Check for updates on every page load
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Generate unique server session ID on startup
- Client detects session ID mismatch on reconnect and forces re-login
- Add "Kickems" as Trail Runner's custom name for basic_attack skill
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Forces all users to log in again when the server restarts.
Useful for applying auth changes or clearing stale sessions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Declare userLocation properly (was implicit global)
- Sync testPosition to real location on first GPS fix
- Sync testPosition when toggling GPS off for seamless manual mode
- Disable gpsTestMode when starting real GPS tracking
- Use userLocation instead of map center when enabling test mode via admin
Fixes issue where position would jump between two spots when toggling GPS.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Utility Skills section with dedicated table showing effect type, value, duration, cooldown
- Add "Add Utility Skill" button with pre-configured defaults
- Filter utility skills out of main combat skills table
- Fix updateSkill() to handle both snake_case and camelCase field names
- Add getUtilitySkillConfig() for database lookup of utility skill settings
- Replace hardcoded BUFF_CONFIGS in server.js with dynamic database lookup
- Support effect types: HP/MP regen multipliers, ATK/DEF boosts, XP multiplier
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add toast notification system with CSS animations for user feedback
- Add WebSocket broadcast for admin panel changes (monsters, skills, settings)
- Client auto-refreshes when admin makes changes
- Add HP/MP regen settings to admin panel (intervals, percentages, home multipliers)
- Fix SQL parameter mismatch in saveRpgStats (data_version = excluded.data_version)
- Implement optimistic updates in admin panel for immediate feedback
- Add broadcastAdminChange helper with client count logging
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create SKILLS.md with base skill reference documentation
- Update CLAUDE.md with comprehensive RPG system documentation
- Update README.md with game features and mechanics overview
- Fix race condition where auto-save could overwrite server data
- Add statsLoadedFromServer flag to prevent premature saves
- Move startAutoSave() to after server data loads
- Add save error notifications to user
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add on-screen WASD control pad for movement testing
- Implement hold-to-move for continuous movement on direction buttons
- Add music system with 5 tracks: overworld, battle, victory, death, homebase
- Music pauses/resumes instead of restarting when switching tracks
- Add home base reset button in admin panel
- Implement double-tap for home base placement on mobile
- Fix WASD controls visible when dead (z-index above death overlay)
- Add MP regeneration while walking
- Clear monsters when entering home base area
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Combat skill buttons now:
- Check both hardcoded SKILLS and database SKILLS_DB
- Display class-specific skill names (e.g., "Brand New Hokas")
- Use fallback icon for database-only skills
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously auto-center was turned off after the first GPS fix.
Now it stays on, keeping the map centered on the player's position.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added new base skills:
- quick_strike: Fast attack with 98% accuracy
- focus: Accuracy buff for 3 turns
- second_wind: MP restore skill
- heavy_blow: High damage (250%), low accuracy (60%)
- quick_heal: Efficient small heal
- triple_strike: 3-hit combo attack
- full_restore: Full HP restore at high MP cost
Trail Runner skill tree (2 choices per level):
- Lv1: Trail Kick (auto)
- Lv2: Brand New Hokas OR Gel Pack
- Lv3: Downhill Sprint OR Pace Yourself
- Lv4: Trail Blaze OR Quick Feet
- Lv5: Second Wind OR Trail Mix
- Lv6: Finish Line Sprint OR Zone In
- Lv7: Ultra Marathon OR The Bonk
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed hardcoded PLAYER_CLASSES and SKILL_POOLS constants
- Added loadClasses() function to fetch classes from /api/classes
- Dynamically builds PLAYER_CLASSES from database with skills
- Dynamically builds SKILL_POOLS from class_skills with choice_groups
- Updated showSkillChoice() to use class-specific skill names
- Updated selectSkill() to display class-specific skill names
- Added safety fallbacks for level-up stat gains
- Classes loaded on app initialization alongside skills/monsters
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GPS Test Mode (WASD movement) now automatically enables when an admin
user logs in, improving the development/testing experience.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Modified executePlayerSkill() to loop through all living monsters when
skill.target === 'all_enemies'
- Each target gets individual hit chance roll
- Added Whirlwind skill (75% ATK to all enemies, 12 MP) to database seeds
- Added whirlwind to Trail Runner class skills for testing
- Fixed skill seeding to check for existence before inserting
- Added try-catch for class skill names to prevent duplicate errors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add classes table (base stats, stat growth per level)
- Add class_skills table (skill assignments with unlock levels, choice groups)
- Seed 4 classes: Trail Runner (enabled), Gym Bro, Yoga Master, CrossFit Crusader
- Seed Trail Runner skills with level-up choices at levels 2 and 3
- Add API endpoints for class and class skill CRUD
- Add Classes section to admin panel with full editor UI
- Skills grouped by unlock level with choice group indicators
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix death system: add clearMonsterEntourage(), set HP to 0 on death
- Add movement-based monster spawning (configurable distance)
- Add admin-editable spawn settings (interval, chance, distance)
- Add home base HP/MP regeneration when player is nearby
- Update character sheet to show damage range, accuracy, MP cost
- Change WASD test step from 11m to 1m
- Fix monster spawning after respawn
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add visual status/buff overlays on combat sprites (100x100px full overlay)
- Monster skills can now have custom names per monster
- Skills admin page for full skill CRUD
- Fix monster buff skills (defend) to properly buff instead of damage
- Fix custom skill names appearing in combat log
- Auto-copy default images when creating new monsters
- Add monster toggle endpoint fix
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Clone copies all monster data with modified key/name
- Auto-generates unique key suffix (_copy, _copy1, etc.)
- Cloned monster is disabled by default for review
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add admin.html with monster/user/settings management UI
- Add admin API endpoints with adminOnly middleware
- Add game_settings table for configurable settings
- Replace emoji monster icons with PNG images (50px map, 100px battle)
- Add mapgameimgs/ directory with default fallback images
- Fix mobile geocache tap by checking for markers before preventDefault
- Increase geocache marker touch target to 64x64px
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Skill Selection System:
- Added 3 new alternative skills (quick_step, second_wind, finish_line_sprint)
- Created SKILL_POOLS for level 2, 3, 5 skill choices
- Added skill choice modal on level up
- Players now choose 1 of 2 skills at milestone levels
- Combat UI shows only unlocked skills
- Character sheet displays learned skills
Monster Database Migration:
- Renamed "Discarded GU" to "Moop" (Matter Out Of Place)
- Created monster_types table for storing monster definitions
- Added CRUD methods for monster types
- Added /api/monster-types endpoint
- Frontend now loads monster types from API
- Auto-seeds Moop monster on first run
- Ready for admin UI and multiple monster types
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Phase 3: Character sheet modal (click class name in HUD)
- Display all stats (HP, MP, ATK, DEF)
- Show XP progress bar with level milestones
- Show unlocked/locked skills based on level
- Fix mobile double-tap inconsistency (50/50 bug)
- Add monster check to native touchend handler
- Block press-and-hold navigation when monsters present
- Both touch handlers now consistently prioritize combat
- Increase monster touch targets to 70x70 with visible tap area
- Add pointer-events:none to trails in nav mode
- Add interactive:false to accuracy circles
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Features:
- Trail Runner class with 4 skills (Attack, Brand New Hokas, Runner's High, Shin Kick)
- Skill level requirements (unlock at levels 1, 2, 3, 5)
- Discarded GU monster type with dialogue escalation phases
- Multi-monster combat: all entourage monsters join fight simultaneously
- Target selection system (click to select enemy)
- Sequential monster turns after player action
- XP bar in HUD showing progress to next level
- Server-side RPG stats persistence (survives cache clear)
Technical:
- Added rpg_stats table to database
- Added GET/PUT /api/user/rpg-stats endpoints
- Fixed auth token name mismatch (accessToken vs authToken)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Trail-appropriate slime monster: sentient energy gel residue.
Includes stats, abilities, variants, and entourage dialogue.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete RPG class design with:
- Full stat progressions and passives
- 10 skills with detailed level-by-level mechanics
- XP tables, damage calculations, and strategy guides
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fixed updateUndoButton null reference at line 1543
- Added null check before accessing DOM element properties
- Tracks now load properly
- Hamburger menu confirmed functional
- All critical JavaScript execution errors resolved
This commit represents a stable, working state after multiple fix attempts documented in FIX_ATTEMPTS.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed 20+ syntax errors caused by incorrect event listener wrapping
- Fixed null reference error in updateTrackList function
- Added null checks for trackCount and trackList elements
- Corrected all misplaced closing braces in arrow functions
- Separated nested if statements that were incorrectly combined
- Hamburger menu now functional
- Track loading error resolved
- Fixed misplaced closing braces in 7 event listeners
- Arrow functions were being closed too early (lines 4958, 4969, 6140, 6162, 6180, 6490, 6503)
- Corrected brace placement to properly wrap multi-line event handlers
- All event listeners now have proper null checks AND correct syntax
- Application now loads without JavaScript errors
- Wrapped all getElementById().addEventListener calls with null checks
- Prevents 'Cannot read properties of null' errors
- Keeps event listeners in original locations (no code movement)
- Fixes hamburger menu and track loading issues
- All 28+ event listeners now safely wrapped
Simple fix to prevent JavaScript from breaking when elements don't exist:
- Wrapped geocache event listeners in setupGeocacheListeners() function
- Added null checks for panelToggle (hamburger menu)
- Added null checks for clearNavBtn, undoBtn, mergeConnectBtn, etc.
- Added debug logging for hamburger click
This prevents errors from stopping script execution.
The hamburger menu should work now if the element exists.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Defer tool button initialization until DOM is ready
- Add null checks to prevent errors if elements don't exist
- Use setTimeout to ensure DOM elements are available
- This fixes all track tool buttons not responding to clicks
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Removed duplicate edit content from tab divs
- Removed duplicate admin content from tab divs
- JavaScript now finds correct button elements in overlays
- All track tools (select, draw, reshape, smooth, geocache) now work
- Fixed duplicate element IDs that prevented event listeners
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Limited max-width to 500px on desktop for better usability
- Right-aligned panels on desktop (right: 0)
- Full width on mobile (max-width: 100% below 768px)
- Adjusted border radius: rounded top-left only on desktop
- Prevents excessive width on large screens
- Maintains full-width experience on mobile
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Similar design to admin panel but 60vh height for more tools
- Green accent color (#4CAF50) to distinguish from admin
- Smooth slide-up animation with backdrop blur
- Close button returns to navigate mode
- All edit tools and controls preserved in overlay
- Properly closes other overlays when switching tabs
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added ensurePopupInBody() helper function
- Applied fix to navigation confirm dialog
- Applied fix to resume navigation dialog
- Applied fix to remesh dialog
- Applied fix to route overlay
- Applied fix to geocache dialog
- All popups now moved to document.body before display
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Force move popups to document.body if inside another container
- Added detailed console logging to show parent element
- Shows bounding rect position to debug visibility
- Popups were displaying but trapped inside hidden controls div
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Set z-index to 999999/999998/999997 for dialogs
- Added !important to all positioning properties
- Forced width/height to 100vw/100vh
- Added pointer-events: auto to ensure clickability
- Restricted Leaflet z-index to prevent interference
- Popups were showing but rendered behind map layers
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added explicit z-index layers (map: 1, dialogs: 10000+)
- Force visibility, opacity, and overflow on dialogs
- Added reflow trigger to ensure proper rendering
- Added console logging for debugging
- Ensure body has overflow: visible
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added 100ms delay to ensure DOM is ready before showing icon selector
- Popups already have proper z-index (3000+) above controls (1000)
- Icon selector should now appear immediately on page load if no icon saved
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added console logging for debugging
- Increased timeout to 100ms to ensure DOM is ready
- Added preventDefault and stopPropagation
- Included inline onclick as fallback method
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Admin panel HTML is created after JavaScript runs
- Used setTimeout to defer event binding until DOM is ready- Close button now properly attaches and functions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed selector to use correct ID 'adminCloseBtn'
- Close button now properly dismisses overlay and returns to edit mode
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Issues fixed:
- Removed broken range slider that was causing black boxes
- Simplified HTML structure with proper containers
- Fixed input visibility on both mobile and desktop
- Added proper flex containers for inputs and units
- Removed complex wrapper divs that were breaking layout
- Ensured all inputs are visible and properly sized
- Fixed checkbox alignment issues
- Made inputs actually usable on all screen sizes
The admin panel should now work properly on both mobile and desktop.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>