Merged
Conversation
This commit refactors the settings user interface to improve organization by moving device configuration, module settings, and administration actions into dedicated sub-screens. - **New Screens**: Introduced `DeviceConfigurationScreen`, `ModuleConfigurationScreen`, and `AdministrationScreen` to reduce clutter on the main Settings screen. - **Navigation**: Updated the settings navigation graph with new routes for the sub-screens and added `LaunchedEffect` hooks to trigger configuration loading upon navigation. - **UI Components**: Introduced the `ExpressiveSection` composable in `RadioConfig.kt` to provide a unified, styled container for settings groups. - **State Management**: Refactored `RadioConfigViewModel` to use `copy()` for state updates and moved the "User" configuration into the primary radio configuration group. - **Interaction**: Relocated packet response dialogs and administration confirmation dialogs (shutdown, reboot, node DB reset) to their respective sub-screens for better separation of concerns. Signed-off-by: James Rich <[email protected]>
…gurations This commit introduces a dedicated `LoadingOverlay` component to provide better visual feedback during asynchronous operations, such as updating radio settings or channel configurations. Key changes include: - **New Loading Component**: Added `LoadingOverlay` which utilizes a `CircularWavyProgressIndicator` and displays real-time progress percentages and status messages. - **UI Refactoring**: Updated `ChannelConfigScreen`, `AdministrationScreen`, and `RadioConfigScreenList` to incorporate the new overlay. These screens now wrap their content in a `Box` to layer the overlay and conditionally show the `PacketResponseStateDialog` only upon task completion (Success or Error) rather than while waiting. - **State Management**: Updated `RadioConfigViewModel` to track pending request IDs and explicitly trigger success or clear states once all administration packets are processed. - **UI Polish**: Updated the "Acknowledgements" item in `SettingsScreen` to use a standard chevron icon and applied error color tints to the Administration section in `RadioConfig` for better visual hierarchy. Signed-off-by: James Rich <[email protected]>
Signed-off-by: James Rich <[email protected]>
Signed-off-by: James Rich <[email protected]>
- Add `delivery_confirmed_reboot_warning` string resource. - Update `PacketResponseStateDialog` to use Material 3 Expressive API components, including `LinearWavyProgressIndicator`. - Enhance dialog layout with status icons for success and error states. - Display a reboot warning message when settings are successfully applied. - Refine dialog dismiss and back navigation logic. Signed-off-by: James Rich <[email protected]>
- Replace `collectAsState` with `collectAsStateWithLifecycle` across multiple UI screens. - Implement `limitedParallelism` and usage marking in `DatabaseManager.withDb`. - Add timeout support to `SequentialJob` to prevent hanging coroutines. - Use cached configurations in `MeshService` to eliminate `runBlocking` calls. - Wrap BLE `connect` and `disconnect` operations in `NonCancellable` context. - Increase buffer capacity for `meshPacketFlow` to improve packet handling. - Ensure null safety for node queries in `SwitchingNodeInfoReadDataSource`. Signed-off-by: James Rich <[email protected]>
…logs Decomposes large composable functions in `AdministrationScreen` and `PacketResponseStateDialog` into smaller, more manageable components. Also cleans up unused parameters in `RadioConfigItemList` and replaces magic numbers with constants in `LoadingOverlay`. Signed-off-by: James Rich <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4678 +/- ##
==========================================
- Coverage 15.35% 15.31% -0.04%
==========================================
Files 83 83
Lines 4344 4354 +10
Branches 734 734
==========================================
Hits 667 667
- Misses 3553 3563 +10
Partials 124 124 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and fixes across navigation, data handling, BLE connection management, and internal utility classes. The most significant changes include adding new screens to the settings navigation, improving coroutine and flow usage for robustness, introducing timeout handling for sequential jobs, and making various codebase cleanups and enhancements.
Navigation and UI Enhancements:
DeviceConfigurationScreen,ModuleConfigurationScreen,AdministrationScreen) and updated navigation logic to support them. Also passedsettingsViewModeland handled state collection for excluded modules. [1] [2] [3]LaunchedEffectand lifecycle-aware state collection. [1] [2] [3]Coroutines and Flow Improvements:
simpleSharedFlowwithMutableSharedFlowwith buffer capacity inRadioInterfaceService, improving event delivery reliability for received data, connection errors, and mesh activity. [1] [2] [3] [4]connectanddisconnectfunctions non-cancellable to ensure proper resource cleanup and state management. [1] [2] [3] [4]Data Handling and Repository Fixes:
SwitchingNodeInfoReadDataSourcereturns empty lists instead of null when database queries return null, preventing potential null pointer issues.SwitchingNodeInfoWriteDataSourceto use block bodies for suspend functions, improving readability and maintainability.Performance and Robustness:
SequentialJobutility, allowing jobs to be automatically cancelled and logged if they exceed a specified duration, preventing silent hangs. [1] [2] [3]MeshCommandSenderandMeshServiceto provide cached config and channel set data, removing blocking calls and improving responsiveness. [1] [2] [3] [4]Internal Codebase Cleanups:
DatabaseManagerwith@OptIn(ExperimentalCoroutinesApi::class)to suppress warnings and clarify usage of experimental APIs. [1] [2]These changes collectively enhance the application's navigation capabilities, robustness in asynchronous operations, and maintainability of the codebase.