This document tracks all debug flags in the codebase to help diagnose performance issues.
All debug flags should be FALSE by default in production to avoid performance overhead.
- ✅
src/components/Map/DroppedObjects.jsx-DEBUG = false(line 13) - ✅
src/components/Map/MapContainer.jsx-DEBUG = false(line 28) - ✅
src/components/Map/CustomShapeLabels.jsx-DEBUG = false(line 3)
- ✅
src/hooks/useInfrastructure.js-DEBUG_INFRA = false(line 19) - ✅
src/hooks/useClickToPlace.js-DEBUG = false(line 5)
- ✅
src/utils/enhancedRenderingUtils.js-DEBUG = false(line 147, hardcoded to prevent runtime activation)
For development debugging, you can temporarily enable logs via:
- Browser console:
window.__DEBUG_DROPPED_OBJECTS__ = true(then reload) - localStorage:
localStorage.setItem('debug:dropped-objects', '1')(then reload) - Vite env:
VITE_DEBUG_DROPPED_OBJECTS=truein.env.local
These areas execute on every rotation event and must have minimal logging:
DroppedObjects.jsx-onRotate()handler (line 523)useInfrastructure.js-onRotate()handler (line 387)enhancedRenderingUtils.js-addEnhancedSpritesToMap()(called during sprite loading)
If you experience lag during rotation (Q/E keys):
- Check browser console - Are there any logs appearing? If yes, a debug flag is accidentally enabled.
- Check browser devtools Performance tab - Record during rotation and look for:
- Long-running JavaScript tasks
- Frequent
setData()calls on GeoJSON sources - Console logging operations
- Temporarily enable profiling:
// In browser console window.__DEBUG_DROPPED_OBJECTS__ = true; // Rotate the map // Count how many logs appear - should be 0 during normal rotation window.__DEBUG_DROPPED_OBJECTS__ = false;
- ✅
enhancedRenderingUtils.jswas checkingwindow.__DEBUG_DROPPED_OBJECTS__at runtime, allowing accidental activation - ✅ Now hardcoded to
falseto prevent runtime activation
Last updated: 2025-10-02