Commit Graph

17 Commits

Author SHA1 Message Date
Daniel Pupius a7eb73c558 Replace react-map-gl with direct maplibre-gl imperative API
react-map-gl's Source/Layer components were silently dropping layers
even after onLoad gating — likely a compatibility issue with
maplibre-gl v5. Switch all three map components to the imperative API
(new maplibregl.Map, map.on('load', ...), source.setData()) which is
the approach shown in MapLibre's own docs and has no wrapper layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 23:50:56 +00:00
Daniel Pupius 19a81a363e Gate map layers behind onLoad to fix missing markers
Source/Layer components mounted before the map style finishes loading
fail silently. Add mapLoaded state + onLoad callback to LocationMap,
NodeLocationMap, and NetworkMap so GeoJSON sources and layers are only
added after the style is ready.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 23:46:03 +00:00
Daniel Pupius cb04054d18 Add compact attribution to NodeLocationMap and NetworkMap
Both were missing attributionControl so they rendered MapLibre's
default (full text). Now consistent with LocationMap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 23:35:44 +00:00
Daniel Pupius d95a74c1d7 refactor(web): replace Google Maps with MapLibre, clean up map components
- Migrate all three map components (Map, GoogleMap, NetworkMap) to MapLibre GL JS
- Extract shared CARTO_DARK_STYLE constants into lib/mapStyle.ts
- Move buildCircleCoords to lib/mapUtils.ts (was duplicated across components)
- Rename exports: Map → LocationMap, GoogleMap → NodeLocationMap
- Remove dead props (width, height, nightMode) from LocationMap interface
- Lazy-mount GL contexts via IntersectionObserver to prevent WebGL exhaustion
- Fix Math.spread RangeError in NetworkMap bounds calculation
- Remove showLinks conditional render in favour of visibility layout property
- Remove cursor state; set canvas cursor style directly on map interactions
- Remove Google Maps API key env vars from .env.example and .env.local
- Move Vite dev server to port 5747 (avoids cached redirect on 3000)
- Fix CORS/404: set VITE_API_BASE_URL="" so browser uses Vite proxy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 20:22:12 +00:00
Daniel Pupius e8e1a112ab feat(topology): track mesh node connections and render as map polylines
Add passive topology tracking from four sources with confidence ranking:
- Zero-hop MQTT observations (continuous, per-gateway, highest frequency)
- Traceroute replies (RouteDiscovery, full path + SNR data)
- NeighborInfo packets (self-reported neighbor SNR)
- relay_node inferred links (1-hop packets with known relay)

Backend: add rx_snr (field 62) and rx_rssi (field 63) to meshstream Data
proto; extract from MeshPacket in decoder.go; regenerate Go bindings.

Frontend:
- topologySlice: LinkObservation model, per-direction confidence merge,
  24h TTL pruning, 2000-edge cap, Redux-pure (timestamp from payload)
- aggregatorSlice: add hopsFromGateway to NodeData
- __root.tsx: dispatch processTopologyPacket after each SSE message
- NetworkMap: render polylines colored by SNR (green/yellow/red/gray),
  dimmed at 0.4 opacity for viaMqtt edges; Links toggle button in legend
- NodeDetail: Connections section showing per-edge SNR, source badge,
  viaMqtt badge, and last-seen time

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-15 16:43:48 +00:00
Daniel Pupius 8779da32a8 refactor(map): extract useCallback hooks and fix XSS in NetworkMap
Convert plain function declarations inside component body to useCallback
with correct deps, eliminating the eslint-disable-react-hooks banner.
Extract buildMarkerContent to module level (pure, no state/refs).
Reorder fitMapToBounds before resetAutoZoom to avoid TDZ reference.
Replace innerHTML SVG in marker with DOM-API construction.
Replace showInfoWindow innerHTML template with .textContent DOM APIs
to eliminate XSS risk from node name/status fields.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-15 16:35:04 +00:00
Daniel Pupius fc72e9f65a Mobile layout tweaks 2025-05-05 09:42:19 -07:00
Daniel Pupius e9fa0104e3 Docker set up and fixes for build 2025-05-01 15:34:16 -07:00
Daniel Pupius b7359339d3 Yet more map tweaks 2025-04-30 13:10:40 -07:00
Daniel Pupius a88e55d22e Full-screen network map 2025-04-30 12:30:35 -07:00
Daniel Pupius c029ca1f7a Fix errors relating to lazy loading of map 2025-04-30 12:14:23 -07:00
Daniel Pupius 95800b33c7 Lazy load maps 2025-04-30 10:50:46 -07:00
Daniel Pupius f83e6a9c31 Consistent colors and activity status 2025-04-30 09:16:44 -07:00
Daniel Pupius 38d5a8da79 Lint fixes 2025-04-29 13:26:23 -07:00
Daniel Pupius 2c37282dab Fix zooming functionality 2025-04-29 12:47:44 -07:00
Daniel Pupius b2b94d7204 Fix node types 2025-04-29 12:12:41 -07:00
Daniel Pupius 4061bbc28f Network map 2025-04-28 17:27:45 -07:00