Skip to content

refactor(map): deduplicate hover/glow logic and extract timeout constant#883

Merged
alanhargreaves merged 1 commit intoaccius:Stagingfrom
ceotjoe:feature/spot-hover-popup
Apr 6, 2026
Merged

refactor(map): deduplicate hover/glow logic and extract timeout constant#883
alanhargreaves merged 1 commit intoaccius:Stagingfrom
ceotjoe:feature/spot-hover-popup

Conversation

@ceotjoe
Copy link
Copy Markdown
Collaborator

@ceotjoe ceotjoe commented Apr 5, 2026

What does this PR do?

  • Add POPUP_AUTO_CLOSE_MS = 20_000 module-level constant; replace the two inline 20000 literals in bindSpotClick
  • Add bindHoverGlow(marker, latlng, color, markersRef) useCallback that owns all mouseover/mouseout popup + glow logic: uses a Leaflet glow ring for SVG circleMarkers (this._path) and a CSS drop-shadow filter for divIcon markers (this._icon), auto-detected at event time
  • Replace ~150 lines of repeated inline mouseover/mouseout handlers across DX circles, DX labels, POTA/SOTA/WWFF/WWBOTA markers and labels, PSK Reporter TX+RX, and WSJT-X with a single bindHoverGlow() call each

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

- Add POPUP_AUTO_CLOSE_MS = 20_000 module-level constant; replace the two
  inline 20000 literals in bindSpotClick
- Add bindHoverGlow(marker, latlng, color, markersRef) useCallback that owns
  all mouseover/mouseout popup + glow logic: uses a Leaflet glow ring for SVG
  circleMarkers (this._path) and a CSS drop-shadow filter for divIcon markers
  (this._icon), auto-detected at event time
- Replace ~150 lines of repeated inline mouseover/mouseout handlers across DX
  circles, DX labels, POTA/SOTA/WWFF/WWBOTA markers and labels, PSK Reporter
  TX+RX, and WSJT-X with a single bindHoverGlow() call each

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alanhargreaves alanhargreaves merged commit e13a46a into accius:Staging Apr 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants