-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Bluetooth ViewModel and HomeScreen logic #101
Labels
Comments
Basler182
added
enhancement
New feature or request
ENGAGE HF
ENGAGE-HF-specific issues
labels
Sep 16, 2024
PSchmiedmayer
added a commit
that referenced
this issue
Dec 9, 2024
# Initial app permissions ## ♻️ Current situation & Problem - We already have an [issue](#101) to improve bluetooth/home viewmodel as it is growing and we should extract some logic into smaller components. As part of this PR I just did the renaming from `BluetoothViewModel` to `HomeViewModel` - We are now requesting also notification permissions in home right after login - Since bluetooth permissions are also needed to display the devices header in home, those are also kept and requested right after notification permission. - Requested permissions are cleared after their result is received, so that the next permission can be requested - Introduced `BuildInfo` and `NotificationPermissions` component and unit tested. - Adapted `PermissionChecker` component to return also `granted` status ## ⚙️ Release Notes *Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.* *Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.* ## 📚 Documentation *Please ensure that you properly document any additions in conformance to [Spezi Documentation Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).* *You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.* ## ✅ Testing *Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.* *This section describes important information about the tests and why some elements might not be testable.* ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [ ] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Paul Schmiedmayer <[email protected]>
1 task
eldcn
added a commit
that referenced
this issue
Dec 16, 2024
…del (#155) # *Message completion* ## ♻️ Current situation & Problem - Fixes #101 by extracting message handling logic out of home view model and reuse in main activity during push notifications flow - Fixes #153 by using `dismissMessage` firebase function instead of updating `completionDate` field. Messages are dismissed correctly now, and we receive a new update (within a couple of seconds) upon dismissal via the snapshot listener - Adapt and extend unit tests ## ⚙️ Release Notes *Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.* *Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.* ## 📚 Documentation *Please ensure that you properly document any additions in conformance to [Spezi Documentation Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).* *You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.* ## ✅ Testing *Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.* *This section describes important information about the tests and why some elements might not be testable.* ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [ ] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Kilian Schneider <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
The
BluetoothViewModel
currently handles a lot more than it should and is tightly coupled with the Home Screen logic.Solution
MessageHandler
and extract the message logic currently residing inBluetoothViewModel
into this component.MessageHandler
intoMainActivityViewModel
and invoke a new action that will internally call the handler.BluetoothViewModel
toHomeScreenViewModel
to better reflect its purpose.Additional context
This refactor will simplify the ViewModel, improve the separation of concerns, and make the application easier to test and extend in the future.
Code of Conduct
The text was updated successfully, but these errors were encountered: