Skip to content

Conversation

@jamesarich
Copy link
Collaborator

@jamesarich jamesarich commented Nov 17, 2025

This introduces a new Connecting state to the connection lifecycle, providing users with better visual feedback during the device connection process.

Key changes include:

  • Refactoring ConnectionState from an enum to a sealed class to accommodate the new Connecting state.
  • Updating the UI to display progress indicators and status text when in the Connecting state:
    • The main navigation icon now shows a "cached" icon and an orange tint.
    • The Connections screen displays a CircularWavyProgressIndicator.
    • DeviceListItem shows a progress indicator instead of a radio button for the device being connected to.
  • Centralizing device list rendering logic by creating a reusable DeviceListSection composable, reducing code duplication in BLEDevices, NetworkDevices, and UsbDevices.
  • Refactoring the connection handling logic in MeshService to be more explicit and state-driven.
Screen_recording_20251117_141603.mp4
Screen_recording_20251117_150527.mp4

@jamesarich jamesarich marked this pull request as draft November 17, 2025 20:15
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 0% with 210 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.56%. Comparing base (12ccb34) to head (fd5df48).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...in/java/com/geeksville/mesh/service/MeshService.kt 0.00% 67 Missing ⚠️
...shtastic/feature/node/component/NodeStatusIcons.kt 0.00% 36 Missing ⚠️
...sh/ui/connections/components/ConnectionsNavIcon.kt 0.00% 24 Missing ⚠️
...e/mesh/ui/connections/components/DeviceListItem.kt 0.00% 10 Missing ⚠️
...esh/ui/connections/components/DeviceListSection.kt 0.00% 10 Missing ⚠️
...e/mesh/ui/connections/components/NetworkDevices.kt 0.00% 10 Missing ⚠️
...eeksville/mesh/ui/connections/ConnectionsScreen.kt 0.00% 9 Missing ⚠️
.../org/meshtastic/feature/node/component/NodeItem.kt 0.00% 9 Missing ⚠️
app/src/main/java/com/geeksville/mesh/ui/Main.kt 0.00% 8 Missing ⚠️
...ville/mesh/ui/connections/components/UsbDevices.kt 0.00% 8 Missing ⚠️
... and 8 more
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3722      +/-   ##
========================================
- Coverage   0.56%   0.56%   -0.01%     
========================================
  Files        380     381       +1     
  Lines      21649   21694      +45     
  Branches    2653    2674      +21     
========================================
  Hits         122     122              
- Misses     21506   21551      +45     
  Partials      21      21              

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

This commit refactors the `ConnectionState` from an `enum` to a `sealed class` to better represent the connection lifecycle. A new `Connecting` state has been introduced to provide more granular feedback to the user during the device connection process.

Key changes include:
- Replaced `enum` with `sealed class` for `ConnectionState`.
- Added a new `Connecting` state to indicate an in-progress connection.
- Updated UI components to display a progress indicator (`CircularWavyProgressIndicator`) when in the `Connecting` state. This affects the device list and main connection status views.
- Introduced `DeviceListSection.kt` to deduplicate device list rendering logic.
- Updated connection status icons to reflect the new `Connecting` state.
- Refined the connection logic in `MeshService` to properly handle the new state transitions.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich force-pushed the refactor/connectionstate branch from f4ad01c to fd5df48 Compare November 17, 2025 20:58
@jamesarich jamesarich added enhancement New feature or request ui Something to do with the UI of the Android app labels Nov 17, 2025
@jamesarich jamesarich changed the title refactor(connections): Convert ConnectionState from enum to sealed class feat(connections): Connecting state refactor Nov 17, 2025
@jamesarich jamesarich marked this pull request as ready for review November 17, 2025 21:08
@jamesarich jamesarich added this pull request to the merge queue Nov 17, 2025
Merged via the queue into main with commit 73d933f Nov 17, 2025
9 of 11 checks passed
@jamesarich jamesarich deleted the refactor/connectionstate branch November 17, 2025 21:24
mdecourcy pushed a commit to mdecourcy/Meshtastic-Android that referenced this pull request Nov 19, 2025
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@Domwilko1
Copy link

Since the 'enhancements' to Bluetooth connectivity in Version 2.7.7, the Bluetooth connection appears to have become unstable. I have 4 nodes and 2 mobile phones and since the upgrade Bluetooth now constantly disconnects from the nodes and will not re-establish a connection. In the app, it sits there saying 'connecting' but never re-establishes a connection. I've found the only way to get it to reconnect is the Force Stop the app and reboot the node, which isn't great if the node is up the top of a pole.

Never had this issue with Bluetooth before until this update.

@jamesarich
Copy link
Collaborator Author

Since the 'enhancements' to Bluetooth connectivity in Version 2.7.7, the Bluetooth connection appears to have become unstable. I have 4 nodes and 2 mobile phones and since the upgrade Bluetooth now constantly disconnects from the nodes and will not re-establish a connection. In the app, it sits there saying 'connecting' but never re-establishes a connection. I've found the only way to get it to reconnect is the Force Stop the app and reboot the node, which isn't great if the node is up the top of a pole.

Never had this issue with Bluetooth before until this update.

Which fw is running on your 'pole node'? - the latest firmware alpha (v2.7.15) seems to be much more solid. Give that a shot.

@jamesarich jamesarich added this to the 2.7.8 milestone Nov 26, 2025
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.

3 participants