feat: area-based visual node filter — attribute packets by transmitter GPS (#804)#839
feat: area-based visual node filter — attribute packets by transmitter GPS (#804)#839efiten wants to merge 4 commits intoKpa-clawbot:masterfrom
Conversation
d1e22ff to
223cfde
Compare
|
Area map can be tested here: https://staging.on8ar.eu/area-map.html Area view can be tested: https://staging.on8ar.eu/#/analytics |
Expert Review — PR #839: Area-Based Visual Node FilterJudgment: COMMENT — merge-ready with notes below Well-structured PR. Clean separation from existing MeshCore Perspective1. [should-fix] Area filter silently drops ALL non-ADVERT packets — 2. [question] GPS staleness — 3. [nit] Taleb (Failure Modes)4. [should-fix] 5. [question] Degenerate polygon / misconfiguration — What happens with 6. [nit] Cross-antimeridian — Polygons spanning the 180° meridian will break with ray-casting PIP. Low priority (unlikely for current deployments) but worth a 7. [nit] Cache race on config reload — If areas config is updated while server runs, Overall: Merge-ready. Items 1 and 4 are worth addressing but neither is a blocker — #1 is by-design but should be explicit, #4 is a description/code mismatch. Solid work by @efiten. |
|
Follow-up to my earlier review after discussion with maintainer: Re: should-fix #2 ("polygon data exposed" claim) — we don't consider exposed polygons a concern. They're operator-defined geographic regions, not PII/credentials/infrastructure; same info any mapping app has. The Action: just drop the "no polygon data exposed to clients" line from the PR description so the code and description agree. No code change needed on that point. Should-fix #1 (area filter silently drops non-ADVERT packets) still stands — worth a comment in the code or a brief note in the docs/PR body explaining that only GPS-bearing packets are attributable. Thanks for the contribution 🎉 |
Area filter — screen-by-screen updateFollow-up changes to the area filter pill placement and wiring:
Also: the 'All' pill (no-filter reset) appears empty — text is not visible, likely a CSS issue to fix at the same time. |
bc81545 to
b445f30
Compare
… analytics, bulk-health (Kpa-clawbot#804) - Add AreaEntry type and Areas field to Config - Add GetNodePubkeysInArea DB query - Add resolveAreaNodes with 30s TTL cache (areaNodeMu RWMutex) - Add PacketQuery.Area + filterPackets polygon check - Propagate area param through all analytics and topology functions - Add /api/config/areas endpoint - Add ?area= support to /api/bulk-health (bypasses 500-node cap when area active) - Add ?area= support to topology and clock-health routes - Add demo areas to config.example.json Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es, live map (Kpa-clawbot#804) - Add area-filter.js: single-select dropdown matching region filter style - Wire AreaFilter into analytics, nodes, packets, channels, map, live pages - Live map: clear node markers on area change - style.css: area dropdown styles reusing region-dropdown-* classes - live.css: no layout changes needed (dropdown is compact, fits live-header) - area-map.html: polygon debug tool and builder for defining area boundaries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3e5ae82 to
cab1bc8
Compare
…y-liveness - cmd/ingestor/db.go: keep both scope_name_v1 and multibyte_sup_v1 migrations - cmd/server/db.go: keep both hasScopeName and hasMultibyteSupCols fields - cmd/server/db_test.go: keep both TestGetScopeStats and TestGetNodesReturnsMultibyteSupField - cmd/server/routes.go: enrich nodes with both multibyte and relay stats - cmd/server/relay_liveness_test.go: pass area="" to GetBulkHealth (added in Kpa-clawbot#839) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Summary
config.json; nodes are attributed to an area if their last-known position falls inside the polygonArea: …dropdown filter (matching the existing region filter style) appears on all analytics, nodes, packets, map, and live screens when areas are configured/api/bulk-healthso all area nodes are always returned/area-map.html) for drawing and exporting area boundariesChanges
Backend
AreaEntrytype +Areasconfig fieldGetNodePubkeysInAreaDB query +resolveAreaNodes(30s TTL,areaNodeMuRWMutex)PacketQuery.Area+filterPacketspolygon check?area=param propagated through all analytics, topology, clock-health, and bulk-health routes/api/config/areasendpointFrontend
area-filter.js: single-select dropdown, persists to localStorage, cleans up stale keys on loadDocs & tools
docs/user-guide/area-filter.md— configuration and usage guidedocs/api-spec.md— updated with new endpoint and?area=param tabletools/area-map.html— polygon builder for defining area boundariesconfig.example.jsonTest plan
/api/bulk-health?area=Xreturns all nodes in area (no 500-node cap)/api/config/areasreturns correct list🤖 Generated with Claude Code