fix(map): anchor neighbor-info lines to the merged node marker position (#3642)#3648
Conversation
…on (#3642) On the Unified (multi-source) map, a node's marker renders at its merged / override-aware position, but neighbor-info lines were drawn from the source-specific coordinates embedded in each neighbor record. When the two diverge (the same node reported at different positions by different sources), the line floats away from the marker it should connect to. Resolve each neighbor-line endpoint to the rendered marker position (`nodePositions`, keyed by nodeNum — the same map the markers use), falling back to the record's embedded coords only when the node isn't currently on the map. Applied to the line, distance, bearing, and direction arrows so they stay consistent. Adds a pure `resolveMapEndpoint` helper in nodeHelpers with unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011JEaCGwY9Wz8jeV4e22GW4
|
Claude finished @Yeraze's task —— View job PR Review: fix(map): anchor neighbor-info lines to the merged node marker position (#3642)
SummaryThis is a clean, well-scoped fix. The root cause was clearly identified and the solution is minimal and correct: neighbor-info line endpoints now resolve to the rendered marker position via the existing Code Quality
The helper is small, pure, and well-documented. The JSDoc block thoroughly explains the problem context, which is appreciated for future maintainers. One minor nit: the function signature uses
The replacement is clean. The two One observation: Potential BugsNo bugs found. The fallback path ( One edge case that the fix doesn't address (and likely doesn't need to): nodes where PerformanceNo regressions. SecurityNo security concerns. This is purely a UI coordinate resolution fix. Test CoverageThe three unit tests in
The mixed-null test on line 23 ( One optional improvement would be a test where Minor Suggestions (non-blocking)
VerdictApproved. The fix is correct, minimal, well-tested, and follows the existing patterns in the codebase. The new helper function is properly extracted into |
Summary
Closes #3642.
On the Unified (multi-source) map, a node's marker renders at its merged / override-aware position, but neighbor-info lines were drawn from the source-specific coordinates embedded in each neighbor record (
ni.nodeLatitude/Longitude,ni.neighborLatitude/Longitude). When the same node is reported at different positions by different sources, the line floats away from the marker it should connect to.Fix
NodesTab.tsxnow resolves each neighbor-line endpoint to the rendered marker position —nodePositions(keyed bynodeNum), the same memoized merged-position map the markers use — via a new pure helperresolveMapEndpoint. It falls back to the record's embedded coords only when the node isn't currently on the map. The resolved coords are used consistently for the line, the distance readout, the bearing, and the direction arrows.Testing
resolveMapEndpoint(prefer marker, fall back to embedded, return null when neither) —nodeHelpers.test.ts(62 passed).tscclean on the edited files.🤖 Generated with Claude Code