fix(configs): Improve loading state feedback and dialog behavior#4271
Merged
Conversation
This commit enhances the user experience during radio configuration loading by providing more detailed status updates and improving the behavior of the response state dialog.
### Key Changes:
- **Detailed Loading Status:** The `ResponseState.Loading` class now includes an optional `status` string. This is used to display what is currently being fetched (e.g., "Fetching LoRa", "Fetching Channel 2/8"), giving the user better insight into the progress.
- **Auto-Dismissing Success Dialog:** The `PacketResponseStateDialog` now automatically dismisses itself 1.5 seconds after successfully completing an operation, reducing the need for an extra user tap.
- **Robust Progress Tracking:**
- The `completed` count check in `PacketResponseStateDialog` is now `>= total` instead of `== total` to prevent getting stuck if the count overshoots.
- The logic for setting the `total` in `RadioConfigViewModel` is now more robust, ensuring it doesn't decrease if new requests are added.
- **Code Simplification:** The set of request IDs is now managed as an immutable `emptySet()` and updated using cleaner `+` and `-` operators instead of mutable operations.
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4271 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 23 23
Branches 7 7
=====================================
Misses 23 23 ☔ 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 commit enhances the user experience during radio configuration loading by providing more detailed status updates and improving the behavior of the response state dialog.
Key Changes:
ResponseState.Loadingclass now includes an optionalstatusstring. This is used to display what is currently being fetched (e.g., "Fetching LoRa", "Fetching Channel 2/8"), giving the user better insight into the progress.PacketResponseStateDialognow automatically dismisses itself 1.5 seconds after successfully completing an operation, reducing the need for an extra user tap.completedcount check inPacketResponseStateDialogis now>= totalinstead of== totalto prevent getting stuck if the count overshoots.totalinRadioConfigViewModelis now more robust, ensuring it doesn't decrease if new requests are added.emptySet()and updated using cleaner+and-operators instead of mutable operations.