Skip to content

fix(map): location perms and button visibility, breadcrumb taps#4651

Merged
jamesarich merged 4 commits intomainfrom
fix/map-loc
Feb 26, 2026
Merged

fix(map): location perms and button visibility, breadcrumb taps#4651
jamesarich merged 4 commits intomainfrom
fix/map-loc

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

This pull request introduces enhancements to the map feature, primarily focusing on improved track visualization, location permissions handling, and UI updates for both FDroid and Google map implementations. The most important changes are grouped below by theme.

Track Visualization Enhancements:

  • Added support for displaying tracks (historical positions) for nodes, including track markers and polylines, with color gradients and time filtering in MapView (feature/map/src/fdroid/kotlin/org/meshtastic/feature/map/MapView.kt). [1] [2]
  • Updated the updateMarkers function to handle new track overlays, ensuring proper addition and removal of track markers and polylines.

Location Permissions Handling:

  • Integrated Accompanist permissions library for runtime location permission management and removed legacy hasGps checks in both FDroid and Google map implementations. [1] [2] [3]
  • Updated the Google map implementation to toggle location tracking based on permissions and to enable "My Location" only when tracking and permissions are active. [1] [2]

UI and Map Overlay Improvements:

  • Increased z-index for traceroute overlays and focused node track markers to ensure visibility above other map elements in Google map implementation. [1] [2] [3]
  • Updated MapButton and dropdown menu to use stringResource for content descriptions, improving accessibility and localization.
  • Added new imports for resources and utility functions to support enhanced track and position display features. [1] [2] [3] [4]

Code Cleanup and Refactoring:

  • Removed unused and legacy code, such as the hasGps variable and redundant conditionals, to simplify logic and improve maintainability. [1] [2] [3]

API and Parameter Updates:

  • Added new parameters (focusedNodeNum, nodeTracks) to MapView composable for more flexible track visualization.

These changes collectively improve map interaction, visualization of node movement, and user experience regarding location permissions and overlays.

@github-actions github-actions bot added the bugfix PR tag label Feb 26, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 15.36%. Comparing base (145cde9) to head (639afad).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4651   +/-   ##
=======================================
  Coverage   15.36%   15.36%           
=======================================
  Files          83       83           
  Lines        4342     4342           
  Branches      734      734           
=======================================
  Hits          667      667           
  Misses       3551     3551           
  Partials      124      124           

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

This commit refactors the location permission handling logic within the map feature for both Google and F-Droid variants.

The changes streamline the process by requesting location permissions only when the user attempts to enable location tracking, rather than relying on a pre-fetched permission state. This improves the user experience by moving the permission request to the point of use.

Specific changes:
- Remove the `hasLocationPermission` state and related handlers.
- Use Accompanist's `rememberMultiplePermissionsState` to manage and request location permissions directly.
- Trigger the location permission request when the "My Location" button is tapped if permissions have not been granted.
- Automatically enable location tracking after the user grants the necessary permissions.
Only show the user's location on the map if both location permissions are granted and location tracking is enabled in the settings.
Adjusted the `zIndex` for traceroute polylines and node track markers to ensure they are rendered in the correct order on the map.

Additionally, this commit implements the node track history feature for the F-Droid map view, displaying historical positions and paths for a selected node.
@jamesarich jamesarich marked this pull request as ready for review February 26, 2026 15:08
@jamesarich jamesarich enabled auto-merge February 26, 2026 15:08
Signed-off-by: James Rich <[email protected]>
@jamesarich jamesarich added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit b60d672 Feb 26, 2026
8 checks passed
@jamesarich jamesarich deleted the fix/map-loc branch February 26, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant