feat(connections): Connecting state refactor #3722
Conversation
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>
f4ad01c to
fd5df48
Compare
Connecting state refactor
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
|
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. |
This introduces a new
Connectingstate to the connection lifecycle, providing users with better visual feedback during the device connection process.Key changes include:
ConnectionStatefrom anenumto asealed classto accommodate the newConnectingstate.Connectingstate:CircularWavyProgressIndicator.DeviceListItemshows a progress indicator instead of a radio button for the device being connected to.DeviceListSectioncomposable, reducing code duplication inBLEDevices,NetworkDevices, andUsbDevices.MeshServiceto be more explicit and state-driven.Screen_recording_20251117_141603.mp4
Screen_recording_20251117_150527.mp4