-
-
Notifications
You must be signed in to change notification settings - Fork 373
feat: Traceroute map visualisation #4002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Traceroute map visualisation #4002
Conversation
Centralize map availability evaluation and use it from both traceroute dialogs before navigating. Add a "Showing X/Y nodes" indicator for traceroute maps (Google + F-Droid).
Keep traceroute response available until the map screen consumes it so 'View on map' from the completion popup doesn't render an empty traceroute overlay. Also stack the traceroute legend and node count at bottom-center (with per-flavor insets) to avoid Google watermark/zoom controls.
- Put traceroute legend + node count bottom-right on F-Droid (Google stays bottom-center). - Zoom the F-Droid traceroute fit slightly further out so routes aren’t framed too tightly.
…ute-map-modal # Conflicts: # core/strings/src/commonMain/composeResources/values/strings.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive traceroute visualization capabilities to the Meshtastic Android app, enabling users to visualize network paths on a map. The implementation includes a dedicated map screen, dialog integration, and sophisticated route rendering with parallel offset polylines to distinguish forward and return paths.
Key Changes:
- Introduces TracerouteMapScreen with flavor-specific UI positioning (Google/F-Droid) to avoid conflicts with map provider logos
- Refactors TracerouteResponse to include route data (forward/return paths, requestId, destination) for map overlay construction
- Implements polyline offsetting algorithms to visually separate overlapping routes with high-contrast color pairs
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteMapScreen.kt |
New dedicated screen for traceroute map visualization with legend and node count display |
feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt |
Adds "View on map" action to traceroute log with availability validation |
feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/MetricsViewModel.kt |
Implements overlay caching and map availability checks |
feature/node/src/google/kotlin/org/meshtastic/feature/node/metrics/TracerouteMapOverlayInsets.kt |
Google flavor UI positioning (bottom-center) |
feature/node/src/fdroid/kotlin/org/meshtastic/feature/node/metrics/TracerouteMapOverlayInsets.kt |
F-Droid flavor UI positioning (bottom-right) |
feature/node/build.gradle.kts |
Adds dependency on feature:map module |
feature/map/src/main/kotlin/org/meshtastic/feature/map/model/TracerouteOverlay.kt |
Data model for traceroute overlays with route colors |
feature/map/src/google/kotlin/org/meshtastic/feature/map/MapView.kt |
Google Maps implementation with polyline rendering and offset calculation |
feature/map/src/fdroid/kotlin/org/meshtastic/feature/map/MapView.kt |
OSMDroid implementation with custom polyline rendering |
core/strings/src/commonMain/composeResources/values/strings.xml |
Adds traceroute map UI strings |
core/service/src/main/kotlin/org/meshtastic/core/service/ServiceRepository.kt |
Refactors TracerouteResponse from String to data class with route details |
core/navigation/src/main/kotlin/org/meshtastic/core/navigation/Routes.kt |
Adds TracerouteMap route with requestId parameter |
core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt |
Implements map availability evaluation logic with endpoint validation |
app/src/main/java/com/geeksville/mesh/ui/Main.kt |
Updates traceroute completion dialog with "View on map" action |
app/src/main/java/com/geeksville/mesh/service/MeshService.kt |
Enhances traceroute response parsing to extract route data |
app/src/main/java/com/geeksville/mesh/navigation/NodesNavigation.kt |
Refactors TracerouteLog navigation and adds TracerouteMap screen |
app/src/main/java/com/geeksville/mesh/model/UIState.kt |
Adds tracerouteMapAvailability helper method |
gradle.properties |
Minor formatting fix |
.gitignore |
Ignores local Gradle home directories |
feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt
Outdated
Show resolved
Hide resolved
feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/MetricsViewModel.kt
Show resolved
Hide resolved
feature/map/src/google/kotlin/org/meshtastic/feature/map/MapView.kt
Outdated
Show resolved
Hide resolved
|
@jamesarich I've addressed all of Copilot's review comments. Ready for re-review if needed. |
|
A head's up that the |
jamesarich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a quick pass - left a few comments, overall liking this idea. May have further architectural notes as I digest the implementation details
feature/map/src/main/kotlin/org/meshtastic/feature/map/model/TracerouteOverlay.kt
Outdated
Show resolved
Hide resolved
Glad you like it. A few possible ideas I had for the future of this, after the initial version is merged:
|
jamesarich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@jamesarich Do you need me to change this from the failing job?
|
Yeah, unfortunately.. we'll want detetkt to pass. Trying to maintain some semblance of non-smelly code 😅 . |
No worries. I'll take a look! |
|
running a |
Head branch was pushed to by a user without write access
|
@DivineOmega appreciate the contribution 🤝. |
This pull requests provides visualisation of traceroutes on a map (either those started via the traceroute button, or those found in the traceroute log). The traceroute map visualisation shows the outgoing route and return route in different colours to be visually distinct, shows only the nodes on the route to avoid clutter, and states how many nodes are being visualised (to avoid any confusion if some nodes on the route do not have location information).
Here's a couple of screenshots of the traceroute map visualisation for both the Google and Fdroid flavours. There are subtle differences in order to position certain UI elements away from the map provider's logos/controls.
The traceroute map visualisation will zoom to contain all nodes in the traceroute, but I've panned/zoomed the map slightly in these screenshots for privacy reasons.
A few implementaion details: