feat(map): MeshCore node-type icons + map filtering (#3546)#3563
Conversation
Add role-based map markers and a node-type filter so operators can visually distinguish infrastructure from end-user nodes and focus the map on specific categories. - nodeTypeCategory.ts: single source of truth classifying nodes into repeater / roomServer / sensor / companion / standard. MeshCore uses advert type (1/2/3/4); Meshtastic ROUTER role folds into repeater. - mapIcons.ts: roleGlyphInnerSvg() + a roleCategory param on createNodeIcon (tower / server-rack / broadcast / person glyphs), applied in both the MeshMonitor and Official pin styles. White background circle keeps glyphs legible on light and dark tiles. - NodeMarkersLayer: classifies each node, hides toggled-off types, passes the category to the icon. - useMapAnalysisConfig: persisted config.nodeTypes (defaults all visible; merged into stored configs for forward-compat). - NodeTypeFilterControl: toolbar popover of per-type checkboxes. - MapLegend: a Node Types section rendering each glyph. - sourceRoutes: expose MeshCore advType in /api/sources/:id/nodes (was hardcoded away); it flows through the unified-node merge. - en.json: map.nodeType.* keys with English fallbacks in code. The feature request's "Observer" maps to the real MeshCore Sensor advert type (there is no Observer type in the protocol). Tests: nodeTypeCategory.test.ts (36 cases); full suite green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SVGxkuD4Fwa2JGVim8ZeVj
|
Claude finished @Yeraze's task —— View job PR Review: feat(map): MeshCore node-type icons + map filtering (#3546)Tasks:
Overall AssessmentThis is a well-structured, well-tested PR. The "single source of truth" design principle in Issues🐛 Potential Bug:
|
Finalize the 4.11.0 release (from 4.11.0-rc2) and bring documentation up to date with everything new since 4.10. Version bump across all five files: package.json, package-lock.json, helm/meshmonitor/Chart.yaml, desktop/src-tauri/tauri.conf.json, desktop/package.json. Documentation: - CHANGELOG: finalize the Unreleased section as [4.11.0], adding the previously-missing entries — headline MeshCore virtual node (#3540), MeshCore path-by-repeater-name (#3550), MeshCore map icons + filtering (#3563), per-node Hide from Map (#3565), telemetry time-range selector (#3530), newer AirQualityMetrics fields (#3517), UI/map unification (#3561), plus the bug-fix and documentation changes since 4.10.4. - virtual-node.md: document the new MeshCore Virtual Node alongside the Meshtastic one (default port 5000, per-source enablement, admin-command safety, MeshCore app setup, troubleshooting) + a two-variants intro note. - configuration/index.md, docs/index.md, README.md: mention the MeshCore Virtual Node in the Virtual Node feature blurbs. - CLAUDE.md: refresh stale version header (4.10.0 -> 4.11.0) and migration count (84 -> 92, latest 092_add_hide_from_map_to_nodes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes #3546.
What
Role-based map markers and a node-type filter on the Map Analysis view, so operators can visually distinguish infrastructure from end-user nodes and focus the map on specific categories.
Works for MeshCore (by advert type) and Meshtastic (router role), in both the MeshMonitor and Official pin styles.
Categories
repeater·roomServer·sensor·companion·standardrepeater; everything elsestandardChanges
src/utils/nodeTypeCategory.ts(new)getNodeTypeCategory()so the icon shown and the checkbox that hides it can't disagreesrc/utils/mapIcons.tsroleGlyphInnerSvg()(tower / server-rack / broadcast / person) +roleCategoryparam oncreateNodeIcon, applied in both pin styles. White bg-circle keeps glyphs legible on light & dark tilessrc/components/MapAnalysis/layers/NodeMarkersLayer.tsxsrc/hooks/useMapAnalysisConfig.tsconfig.nodeTypes(defaults all-visible; merged into stored configs)src/components/MapAnalysis/NodeTypeFilterControl.tsx(new)src/components/MapAnalysis/MapLegend.tsxsrc/server/routes/sourceRoutes.tsadvTypein/api/sources/:id/nodes(was hardcoded away); flows through the unified-node mergepublic/locales/en.jsonmap.nodeType.*keys (English fallbacks in code for untranslated locales)Design note
The feature request lists "Observer" as a fourth type, but the MeshCore protocol has no Observer advert type — the real fourth type is Sensor (4), which the rest of the codebase already uses. This PR maps that category to Sensor. Trivial to relabel if "Observer" is preferred in the UI.
Testing
src/utils/nodeTypeCategory.test.ts— 36 cases (MeshCore advTypes, Meshtastic roles, filter isolation)tsc --noEmitclean🤖 Generated with Claude Code
https://claude.ai/code/session_01SVGxkuD4Fwa2JGVim8ZeVj