Skip to content

Add "View on map" button to node detail panel - #93

Open
vfortin99-ctrl wants to merge 3 commits into
MeshCore-Beacon:devfrom
vfortin99-ctrl:add-view-on-map-button
Open

vfortin99-ctrl wants to merge 3 commits into
MeshCore-Beacon:devfrom
vfortin99-ctrl:add-view-on-map-button

Conversation

@vfortin99-ctrl

@vfortin99-ctrl vfortin99-ctrl commented Sep 29, 2026 •

Copy link
Copy Markdown

Summary

  • Adds a "View on map" button to the node detail panel's Location section, shown only when the node has a location — styled to match the packet analyzer's existing "View path on map" button (full-width bordered pill + folded-map icon), since both are "jump to a location on the map" actions
  • Clicking it switches to the Map tab and centers/zooms (14) on that node's exact coordinates, via the lat/lng/zoom deep-link params MapView already reads on mount — no changes to MapView.tsx or the map hooks needed
  • selectedNodeId is preserved across the tab switch (mirrors the existing handleViewObserverStats pattern), so the same detail panel stays open, now layered over the map
  • Also wired into NodeDetailOverlay — the modal opened when you click a hop in the packet analyzer's PATH DATA. That path closes the overlay and promotes the node into the shared selection, so the regular NodeDetailPanel (not the overlay) is what reopens on Map

Why

Currently there's no quick way to jump from a node you're looking at — in the Nodes table, or via a path hop in the packet analyzer — straight to its location on the map. You have to switch to Map manually and search/scroll to find it. This closes that gap using infrastructure that already exists (the map's own copy-link params).

Test plan

  • npx tsc -b — clean
  • npx vitest run — all pre-existing tests pass (858/870; the 12 failures are pre-existing localStorage mock issues in unrelated i18n/language-picker tests, reproduce on dev without this change)
  • npx vitest run tests/features/nodes tests/features/map — 134/134 pass
  • Manually verified against a live production Beacon instance (real node/map data): clicking the button from a node in the Nodes tab, and from a path-hop overlay in the packet analyzer, both switch to Map and center/zoom tightly on that node's coordinates with its marker highlighted

🤖 Generated with Claude Code

vfortin99-ctrl and others added 3 commits September 28, 2026 20:44
Jumps from a node's detail panel straight to that node on the Map
tab, framed close on it (zoom 14) via the existing lat/lng/zoom
deep-link params MapView already reads on mount — no changes needed
there. Only shown when the node has a location. selectedNodeId is
preserved across the switch (mirrors handleViewObserverStats), so
the same detail panel stays open, now over the map.

Verified against a live production Beacon instance: clicking the
button from a node in the Nodes tab correctly switches to Map,
centers/zooms on that node's exact coordinates, and keeps its
highlighted marker and detail panel in view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The Packet Analyzer's PATH DATA lets you click a hop to peek at that
node via NodeDetailOverlay (a modal, separate component from the
regular NodeDetailPanel used by the Nodes/Map tabs) — that overlay
didn't get the button in the first commit.

Wiring it through required a bit more than passing the prop down:
handleViewOnMap deliberately bypasses handleTabChange (see its own
comment) so it doesn't clear selectedNodeId on mobile, but that
also means it won't clear overlayNodeId as a side effect the way
onViewObserver's handleTabChange call does above it. So the overlay
closes itself explicitly and promotes the node into the shared
selection, so NodeDetailPanel — not the overlay — is what reopens
on the Map tab.

Verified live: clicking a path hop in the packet analyzer opens the
overlay, its "View on map" button switches to Map and centers/zooms
on that hop's node, same as from the Nodes tab.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Was a small text link like "View observer →"; switched to the same
full-width bordered pill + folded-map icon as the packet analyzer's
"View path on map" button, since both are "jump to a location on
the map" actions and read as a matched pair now.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vfortin99-ctrl

Copy link
Copy Markdown
Author

Closed by mistake

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.

1 participant