Skip to content

Conversation

@DivineOmega
Copy link
Contributor

@DivineOmega DivineOmega commented Dec 14, 2025

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.

signal-2025-12-14-015758_003
signal-2025-12-14-015758_002

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:

  • Adds a View on map action to both traceroute dialogs (traceroute log + “traceroute complete” popup) for one-tap spatial context.
  • Introduces a dedicated Traceroute Map screen that auto-centers on the traceroute and only shows nodes involved in that traceroute.
  • Visualizes both outgoing + return paths with a high-contrast color pair and rounded, semi-transparent strokes.
  • Offsets the two routes slightly in parallel so identical/overlapping paths remain distinguishable.
  • Adds a compact on-map legend plus a “Showing X/Y nodes” indicator to make route interpretation and coverage obvious at a glance.
  • Positions the overlays per flavor to avoid UI collisions (Google: bottom-center away from watermark/controls; F-Droid: bottom-right).
  • Centralizes “can this traceroute be mapped?” checks and uses the same error messaging from both entry points (no more inconsistent behavior).
  • Improves traceroute parsing/data plumbing so the map consistently receives the correct requestId + forward/return route data (including popup timing edge-cases).
  • Tunes F-Droid traceroute framing so the map doesn’t zoom in uncomfortably tight.
  • Minor repo/build hygiene: ignore local Gradle home dirs and wire feature:node to depend on feature:map for the new screen.

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
Copy link
Contributor

Copilot AI left a 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

@DivineOmega
Copy link
Contributor Author

@jamesarich I've addressed all of Copilot's review comments. Ready for re-review if needed.

@jamesarich
Copy link
Collaborator

A head's up that the fdroid implementation may need rework once #3785 is wrapped, though the lift should be similar/easier.

Copy link
Collaborator

@jamesarich jamesarich left a 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

@DivineOmega
Copy link
Contributor Author

DivineOmega commented Dec 16, 2025

Made a quick pass - left a few comments, overall liking this idea. May have further architectural notes as I digest the implementation details

Glad you like it.

A few possible ideas I had for the future of this, after the initial version is merged:

  • Change line thickness/colour/opacity (?) based on signal strength
  • Display estimated locations of nodes in the traceroute that do not provide location information directly

Copy link
Collaborator

@jamesarich jamesarich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jamesarich jamesarich enabled auto-merge December 16, 2025 14:38
@jamesarich jamesarich added enhancement New feature or request ui Something to do with the UI of the Android app labels Dec 16, 2025
@jamesarich jamesarich changed the title Traceroute map visualisation feat: Traceroute map visualisation Dec 16, 2025
@DivineOmega
Copy link
Contributor Author

@jamesarich Do you need me to change this from the failing job?

Task :core:model:detekt FAILED
/home/runner/work/Meshtastic-Android/Meshtastic-Android/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt:101:5: Function evaluateTracerouteMapAvailability has 3 return statements which exceeds the limit of 2. [ReturnCount]

@jamesarich
Copy link
Collaborator

@jamesarich Do you need me to change this from the failing job?

Task :core:model:detekt FAILED
/home/runner/work/Meshtastic-Android/Meshtastic-Android/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt:101:5: Function evaluateTracerouteMapAvailability has 3 return statements which exceeds the limit of 2. [ReturnCount]

Yeah, unfortunately.. we'll want detetkt to pass. Trying to maintain some semblance of non-smelly code 😅 .

@DivineOmega
Copy link
Contributor Author

@jamesarich Do you need me to change this from the failing job?

Task :core:model:detekt FAILED
/home/runner/work/Meshtastic-Android/Meshtastic-Android/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt:101:5: Function evaluateTracerouteMapAvailability has 3 return statements which exceeds the limit of 2. [ReturnCount]

Yeah, unfortunately.. we'll want detetkt to pass. Trying to maintain some semblance of non-smelly code 😅 .

No worries. I'll take a look!

@jamesarich
Copy link
Collaborator

running a ./gradlew spotlessApply detekt prior to commit/push should let you know how you're doing locally

auto-merge was automatically disabled December 16, 2025 16:12

Head branch was pushed to by a user without write access

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 0% with 257 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.56%. Comparing base (24f40b2) to head (807be24).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tastic/feature/node/metrics/TracerouteMapScreen.kt 0.00% 68 Missing ⚠️
...g/meshtastic/feature/node/metrics/TracerouteLog.kt 0.00% 47 Missing ⚠️
...eshtastic/feature/node/metrics/MetricsViewModel.kt 0.00% 32 Missing ⚠️
.../com/geeksville/mesh/navigation/NodesNavigation.kt 0.00% 31 Missing ⚠️
app/src/main/java/com/geeksville/mesh/ui/Main.kt 0.00% 31 Missing ⚠️
...kotlin/org/meshtastic/core/model/RouteDiscovery.kt 0.00% 23 Missing ⚠️
...in/java/com/geeksville/mesh/service/MeshService.kt 0.00% 13 Missing ⚠️
.../meshtastic/feature/map/model/TracerouteOverlay.kt 0.00% 5 Missing ⚠️
...src/main/java/com/geeksville/mesh/model/UIState.kt 0.00% 4 Missing ⚠️
...otlin/org/meshtastic/core/ui/theme/CustomColors.kt 0.00% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #4002      +/-   ##
========================================
- Coverage   0.56%   0.56%   -0.01%     
========================================
  Files        402     404       +2     
  Lines      23893   24116     +223     
  Branches    3061    3098      +37     
========================================
  Hits         136     136              
- Misses     23736   23959     +223     
  Partials      21      21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Dec 16, 2025
@jamesarich
Copy link
Collaborator

jamesarich commented Dec 16, 2025

@DivineOmega appreciate the contribution 🤝.
If you're interested in contributing more regularly, feel free to reach out on discord - I'm @olm3c. We can get you better looped in to conversations and processes there ➰ .

@jamesarich jamesarich added this to the 2.7.10 milestone Dec 16, 2025
Merged via the queue into meshtastic:main with commit 3dbc510 Dec 16, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ui Something to do with the UI of the Android app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants