Repository navigation
feat(map): AR mesh view - #7659
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
3323ef4 to
2b8e81d
Compare
2b8e81d to
91ce3ed
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: meshtastic/Meshtastic-Android/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1ae94a8b-5d6c-4d70-9c6a-6fad9a59a22a
📒 Files selected for processing: 86
.skills/compose-ui/strings-index.txtandroidApp/src/fdroid/kotlin/org/meshtastic/app/di/FlavorModule.ktandroidApp/src/google/kotlin/org/meshtastic/app/di/FlavorModule.ktandroidApp/src/google/kotlin/org/meshtastic/app/map/hud/GoogleFusedOrientationSource.ktandroidApp/src/main/kotlin/org/meshtastic/app/MainActivity.ktandroidApp/src/test/kotlin/org/meshtastic/app/ui/NavigationAssemblyTest.ktcore/data/src/androidMain/kotlin/org/meshtastic/core/data/location/AndroidMagneticFieldProvider.ktcore/data/src/androidMain/kotlin/org/meshtastic/core/data/location/AndroidPhoneLocationProvider.ktcore/model/src/commonMain/kotlin/org/meshtastic/core/model/NodeMapFilter.ktcore/model/src/commonMain/kotlin/org/meshtastic/core/model/util/PositionPrecision.ktcore/navigation/src/commonMain/kotlin/org/meshtastic/core/navigation/Routes.ktcore/navigation/src/commonTest/kotlin/org/meshtastic/core/navigation/NavigationConfigTest.ktcore/prefs/src/commonMain/kotlin/org/meshtastic/core/prefs/map/MapPrefsImpl.ktcore/repository/src/commonMain/kotlin/org/meshtastic/core/repository/AppPreferences.ktcore/repository/src/commonMain/kotlin/org/meshtastic/core/repository/MagneticFieldProvider.ktcore/repository/src/commonMain/kotlin/org/meshtastic/core/repository/NodeFilterPrefs.ktcore/repository/src/commonMain/kotlin/org/meshtastic/core/repository/PhoneLocationProvider.ktcore/resources/src/commonMain/composeResources/drawable/ic_center_focus_strong.xmlcore/resources/src/commonMain/composeResources/values/strings.xmlcore/testing/src/commonMain/kotlin/org/meshtastic/core/testing/FakeAppPreferences.ktcore/ui/detekt-baseline.xmlcore/ui/src/androidMain/kotlin/org/meshtastic/core/ui/util/MeshHudSupport.android.ktcore/ui/src/commonMain/kotlin/org/meshtastic/core/ui/icon/Hardware.ktcore/ui/src/commonMain/kotlin/org/meshtastic/core/ui/util/LocalMapMainScreenProvider.ktcore/ui/src/commonMain/kotlin/org/meshtastic/core/ui/util/MeshHudSupport.ktcore/ui/src/iosMain/kotlin/org/meshtastic/core/ui/util/MeshHudSupport.ios.ktcore/ui/src/jvmMain/kotlin/org/meshtastic/core/ui/util/MeshHudSupport.jvm.ktdesktopApp/src/main/kotlin/org/meshtastic/desktop/Main.ktdesktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopStubsModule.ktdesktopApp/src/main/kotlin/org/meshtastic/desktop/stub/CompassStubs.ktdocs/en/user.mddocs/en/user/map-and-waypoints.mddocs/en/user/nodes.mdfeature/map/build.gradle.ktsfeature/map/src/androidHostTest/kotlin/org/meshtastic/feature/map/hud/DeviceAttitudeTest.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/hud/AndroidCameraPoseProvider.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/hud/DeviceAttitude.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/hud/FusedOrientationSource.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/hud/HudCameraPreview.android.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/BaseMapViewModel.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/MapNodePolicy.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/MapScreen.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/CameraPoseProvider.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/FixAverager.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudCameraPreview.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudChipLayer.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudChips.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudEdges.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudGeometry.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudOverlay.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPanels.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPaths.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPathsDraw.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudRadar.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudRadarPaths.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudTargets.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/MeshHudScreen.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/MeshHudViewModel.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/OneEuroQuaternionFilter.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/navigation/MapNavigation.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/FixAveragerTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudChipsTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudEdgesTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudGeometryTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudPathsTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudRadarTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudTargetsTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/MeshHudViewModelTest.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/OneEuroQuaternionFilterTest.ktfeature/map/src/iosMain/kotlin/org/meshtastic/feature/map/hud/HudCameraPreview.ios.ktfeature/map/src/jvmMain/kotlin/org/meshtastic/feature/map/hud/HudCameraPreview.jvm.ktfeature/node/detekt-baseline.xmlfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/compass/CompassViewModel.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/CompassBottomSheet.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/NodeContextMenu.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/PositionSection.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/detail/NodeDetailScreens.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/list/NodeListScreen.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/PositionLogScreens.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/TracerouteMapScreen.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/navigation/AdaptiveNodeListScreen.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/navigation/MeshHudBackStack.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/navigation/NodesNavigation.ktfeature/node/src/commonTest/kotlin/org/meshtastic/feature/node/compass/CompassViewModelTest.ktfeature/node/src/commonTest/kotlin/org/meshtastic/feature/node/navigation/MeshHudBackStackTest.ktfeature/node/src/jvmTest/kotlin/org/meshtastic/feature/node/detail/NodeDetailCompassLifecycleTest.kt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Restore the accessibility click action on radar dots. · HudRadar.kt:197-203
feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudRadar.kt:197-203
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRestore the accessibility click action on radar dots.
clearAndSetSemanticsreplaces the clickable semantics with only a button role and description. Pointer taps still call the callback, but TalkBack activation has no click action for node or waypoint dots. Add the action in the sharedRadarDotcomponent.Suggested fix
+import androidx.compose.ui.semantics.onClick @@ -private fun RadarDot(subject: HudSubject, description: String, onClick: () -> Unit) { +private fun RadarDot(subject: HudSubject, description: String, onActivate: () -> Unit) { @@ - Modifier.minimumInteractiveComponentSize().clickable(onClick = onClick).clearAndSetSemantics { + Modifier.minimumInteractiveComponentSize().clickable(onClick = onActivate).clearAndSetSemantics { contentDescription = description role = Role.Button + onClick { + onActivate() + true + } },
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: meshtastic/Meshtastic-Android/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
692d5bb6-80d0-4e4e-88c5-bc47a469038c
📒 Files selected for processing: 6
feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudChips.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPathsDraw.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/MeshHudScreen.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudChipsTest.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/compass/CompassViewModel.ktfeature/node/src/commonTest/kotlin/org/meshtastic/feature/node/compass/CompassViewModelTest.kt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: meshtastic/Meshtastic-Android/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f0205e7a-b2ee-4610-8eac-2565f4e6da9c
📒 Files selected for processing: 3
feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPaths.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/MeshHudViewModel.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/HudPathsTest.kt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: meshtastic/Meshtastic-Android/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
28b50a7f-adb4-4525-a32b-493c3f99fa93
📒 Files selected for processing: 3
.skills/compose-ui/strings-index.txtcore/resources/src/commonMain/composeResources/values/strings.xmlfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPanels.kt
🚧 Files skipped from review as they are similar to previous changes: 2
- .skills/compose-ui/strings-index.txt
- core/resources/src/commonMain/composeResources/values/strings.xml
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.
This comment has been minimized.
This comment has been minimized.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
🧹 Nitpick comments: 1
feature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/MeshHudViewModelTest.kt: 1
264-264: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThis test passes even when the track does not keep the node visible.
The view model no longer applies a range limit, and no
MapFilterPrefsexcludesnode-3. As a result,node-3appears throughpassesMapFiltereven withshowTrack(3)removed. The test name says the track pins the node, but the test does not check that. A regression in thepinnedpath oftargets(node.num in settings.pinned) would not fail this test.To fix this, set a filter that excludes
node-3, for exampleonlyFavorites = truewithnode(1, favorite = true). The test then fails unless the track keepsnode-3visible.♻️ Proposed change
fun `a tracked node stays in the whole mesh view`() = runTest(testDispatcher) { - nodeRepository.setNodes(listOf(node(1), node(3, lat = FAR_LAT))) + nodeRepository.setNodes(listOf(node(1, favorite = true), node(3, lat = FAR_LAT))) + mapPrefs.mapFilters.value = MapFilterPrefs(onlyFavorites = true) viewModel.openFor(null) viewModel.showTrack(3) assertEquals(setOf("node-1", "node-3"), collectTargets().keys) }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: meshtastic/Meshtastic-Android/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
77179a62-082f-43a0-afd2-022872b9c4bc
📒 Files selected for processing: 9
.skills/compose-ui/strings-index.txtcore/resources/src/commonMain/composeResources/values/strings.xmlfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudChipLayer.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudOverlay.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudPanels.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/HudTargets.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/MeshHudScreen.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/hud/MeshHudViewModel.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/hud/MeshHudViewModelTest.kt
💤 Files with no reviewable changes: 2
- core/resources/src/commonMain/composeResources/values/strings.xml
- .skills/compose-ui/strings-index.txt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The map's node filters become a plain NodeMapFilter predicate over Node, so a view outside feature:map can apply the same rules. MapNodePolicy delegates to it, and MapFilterPrefs converts to it directly.
…to core The compass's phone location and declination providers become core:repository interfaces with their Android implementations in core:data, so a view outside feature:node can read the phone's fix and true north the same way.
Point the back camera at the horizon and see the mesh in place: nodes as their chips and waypoints as their emoji, by bearing and elevation, over a CameraX preview. It opens from the map for everything in range, from node detail and the compass for one node, from a traceroute's map to draw that route in the air, and from the position log to draw that node's track. The pose is the rotation vector's camera axes, smoothed with a 1€ filter, and the field of view comes from the lens calibration and the stream crop. Elevation compares altitudes in one frame. Precision draws as a fading zone from both positions' accuracy and the heading error. The phone's own fix is averaged while it is still and shown live, and targets too close to point at go on a heading-up radar. Off-screen targets pin to the edge to turn or tilt toward, a focused target gets a reticle, a turn hint and a haptic lock, and dragging the view corrects the compass. Traceroutes draw as lifted arcs, forward up and return down, weighted by each link's SNR; tracks as breadcrumbs fading with age; geofences as walls on the ground. It follows the map's filters and a range toggle. The compass shares the mesh view's position uncertainty and fix time rules.
From node detail or the compass the view shows that node alone; from the position log, that node and its track; from a traceroute, its destination and hops. Waypoints, geofences, other nodes and the range toggle stay out. Opened from the map it still shows everything the filters allow.
A scoped view whose nodes all sit inside their own uncertainty showed only radar dots, so a traceroute or track looked empty. The radar now draws both in plan view, and a node with no live position takes the one its route or track recorded. The view no longer reports an empty mesh before its first update. Also: the return leg's stem from the viewer, scoped views ignore the range limit, AltitudeConverterCompat for sea level altitude, the geofence foot line clipped at the near plane, and an "Open waypoint" click label.
…er stacks on itself
…with sensor fallbacks and thermal backoff
…ecreation A waypoint at latitude or longitude 0 is a real position, and the nullable field already carries absence. Reopening the view for the same node, as a recreated screen does, no longer resets the focus the user chose.
…e focused chip says its height
…e top and bottom edges
…irpy's glyphs in a resource
…aypoint hand-off back stack
…de test needs the pin
0a5c6e5 to
6945de3
Compare
Finding a node on foot means flipping between the map and the compass. This adds a camera mesh view: point the phone at the horizon and see nodes, waypoints, traceroutes and tracks where they actually are, with how sure each position is.
🌟 New Features
feature/map/.../hud), opened from the map's top bar, a node's position section and compass sheet, the node list's long-press menu, a traceroute's map, and the position log. The node list menu also gains Open Compass.googlecomes from the Fused Orientation Provider, with its live heading error;fdroidand phones without Play services use the rotation vector, then the geomagnetic rotation vector on phones with no gyroscope.🛠️ Refactoring & Architecture
feature:maptocore:model(NodeMapFilter);MapNodePolicydelegates to it.PhoneLocationProviderandMagneticFieldProvidermove fromfeature:nodetocore:repository, their Android implementations tocore:data.core:modelPositionPrecision).rememberMeshHudSupported()incore:ui;MapRoute.MeshHudroute;NodesRoute.NodeDetail(openCompass);MapPrefs.meshHudCoachSeen.FusedOrientationSourcebound per flavor, soAndroidCameraPoseProviderstays the one pose provider.center_focus_strong;view_in_arstays with the 3D model viewer in feat(node): view a device's 3D model, and place it in AR on the google flavor #7639.Deferred: the ARCore Geospatial API (Cloud project, privacy text, camera frames to Google, no F-Droid), adding
FUSED_PROVIDERto the phone's location request until it is measured against the compass jitter fix, and a "Find" action on the map, which has no node info window to hold one.📝 Documentation
Testing Performed
HudGeometryTest,HudTargetsTest,HudPathsTest,HudRadarTest,HudEdgesTest,HudChipsTest,FixAveragerTest,OneEuroQuaternionFilterTest,MeshHudViewModelTest,DeviceAttitudeTest,MeshHudBackStackTest;MapRoute.MeshHudround trip inNavigationConfigTest.HudTargetsTestplaces a waypoint at 0,0 and treats a 0 altitude as a reading;MeshHudViewModelTestkeeps the chosen focus when the screen opens again for the same node.-PwarningsAsErrors=true(spotless, detekt, detektTypeResolved, assembleDebug, test, allTests, kmpSmokeCompile).Summary by CodeRabbit
New Features
Documentation
Localization