- 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>
- 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 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>
- 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>
- 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>
- 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>
- 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>
Major improvements:
1. Mobile-friendly redesign with vertical stacking
2. Touch-optimized inputs (44px minimum targets)
3. Better event handling with input events
4. Debounced saving to prevent excessive saves
5. Visual save indicator (toast notification)
6. Collapsible sections for better organization
7. Range sliders with value display
8. Responsive design (mobile-first approach)
Fixes:
- Settings now save immediately on input
- Visual feedback when settings are saved
- Proper mobile layout with full-width inputs
- Larger touch targets for better usability
- Sections can be collapsed and state persists
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Features added:
1. Custom icon colors - Choose any color for geocache icons
2. Secret caches - Set visibility distance (only visible within X meters)
3. Edit existing caches - Change title, icon, color, visibility after creation
4. Geocache list sidebar - View all caches in edit mode, click to navigate
5. Visual indicators for secret caches (purple badge, transparency in edit mode)
Implementation:
- Added color picker with preview in geocache dialog
- Added visibility distance field (0 = always visible)
- Edit button for existing caches in edit mode
- Dynamic visibility updates based on user location in nav mode
- Geocache list sidebar with stats and quick navigation
- All properties sync via WebSocket to other users
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
The title and icon fields were not showing when creating new geocaches.
Added the missing logic to show these fields for new caches.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Added title field for naming geocaches when created
- Added icon selection with MDI icon support
- Users can browse Material Design Icons and choose custom icons
- Updated notifications to show geocache title instead of 'undefined'
- Messages now say 'Someone left a note at [geocache title]'
- Fixed nearby cache notifications to include title
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed notification not triggering when adding message from another device
- Now notifies ALL devices (including your own) when near a cache with new message
- Added null checks for messages array to prevent errors
- Notifications work for messages from same user on different devices
This fixes the issue where adding a message from desktop wouldn't
notify your phone even when nearby.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added "Send Test Notification to All Users" button in admin panel
- Button appears after enabling push notifications
- Server endpoint /test-notification sends to all subscribed users
- Shows count of successful deliveries
- Purple button to distinguish from other actions
- Useful for testing notification system is working
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implemented three types of notifications with cooldowns:
1. Nearby Cache Notification
- Triggers when within 200m of a geocache
- 10-minute cooldown per cache
- Resets when you move >200m away
2. Cache Message Notification
- Triggers when another user adds a message to a nearby cache
- Only notifies if you're within 200m of the cache
3. Destination Arrival Notification
- Triggers when within 10m of navigation destination
- 1-minute cooldown to prevent spam
Features:
- Server endpoint /send-notification for triggering push notifications
- Cooldown tracking to prevent notification spam
- Distance-based triggers for relevant notifications
- Automatic cleanup of expired subscriptions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Changed from new Notification() to registration.showNotification()
- Mobile browsers require ServiceWorkerRegistration API for notifications
- Added vibrate pattern and badge icon for better mobile experience
This fixes the "Illegal constructor" error when enabling push notifications
on Chrome for Android and other mobile browsers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Changed showStatus() to updateStatus() in 3 places
- Added proper status types ('success', 'info') for notifications
- Fixes ReferenceError when enabling/disabling push notifications
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>