Add "View on map" button to node detail panel - #93
Open
vfortin99-ctrl wants to merge 3 commits into
Open
vfortin99-ctrl wants to merge 3 commits into
vfortin99-ctrl wants to merge 3 commits into
Conversation
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>
Author
|
Closed by mistake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lat/lng/zoomdeep-link paramsMapViewalready reads on mount — no changes toMapView.tsxor the map hooks neededselectedNodeIdis preserved across the tab switch (mirrors the existinghandleViewObserverStatspattern), so the same detail panel stays open, now layered over the mapNodeDetailOverlay— 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 regularNodeDetailPanel(not the overlay) is what reopens on MapWhy
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— cleannpx vitest run— all pre-existing tests pass (858/870; the 12 failures are pre-existinglocalStoragemock issues in unrelated i18n/language-picker tests, reproduce ondevwithout this change)npx vitest run tests/features/nodes tests/features/map— 134/134 pass🤖 Generated with Claude Code