Closed Supereg closed 1 year ago
@PSchmiedmayer SpeziViews seems to have an outdated list of required status checks in the branch protection rule.
Fixed the merge check requirements @Supereg 👍
Fixed the merge check requirements @Supereg 👍
The Upload Coverage Report
action is still referencing the old one. If you could update that as well 😇
Merging #8 (11beb6d) into main (bae5330) will decrease coverage by
1.36%
. The diff coverage is72.23%
.
@PSchmiedmayer Do you remember how we fixed the issue of a 0% code coverage 🙈
EDIT: nevermind. Codecov was still outdated.
Was there an easy way to exclude PreviewProviders from code coverage reporting?
Not really, that is an unfortunate thing that Xcode does not really support. I have tried a lot of things with a dedicated TEST build configuration in the Template App but this wasn't ideal either and results in large build times when switching between DEBUG and TEST builds ... I can merge the PR like this.
Regarding code coverage: Sometimes Xcode is flaky with the test reporting. If that happens, I have made a good experience adding the target to the build scheme for tests (e.g. SpeziViews in this case):
And then explicitly adding it in the coverage report settings:
Thanks for the tipps regarding code coverage. feel free to merge 👍
Implement a generic AsyncButton with support for throwing closures
:recycle: Current situation & Problem
Currently, Spezi Views (nor SwiftUI) provide a way to easily manage buttons with asynchronous action closures. We have several use cases where a reusable button with an async (throwing) action closure would be helpful (e.g. SpeziAccount for Login/Signup/Password Reset buttons).
:bulb: Proposed solution
This PR introduces a the new, reusable component
AsyncButton
that allows to supplyasync
andasync throwing
action closures. It handles disabling the button and rendering of a processing indicator automatically. To deal with thrown errors of the action closure, we reuse theViewState
abstraction already available in SpeziViews. This can easily be combined with theviewStateAlert(state:)
modifier to display a simple error alert.:gear: Release Notes
AsyncButton
component forasync
andasync throwing
action closures.processingDebounceDuration
EnvironmentKey for a generalized configuration of debounce durations.processingOverlay(isProcessing:overlay)
modifier to easily replace a view with a processing indicator.:heavy_plus_sign: Additional Information
Related PRs
This PR refines the
AsyncDataEntrySubmitButton
implementation currently used in the upcoming SpeziAccount PR https://github.com/StanfordSpezi/SpeziAccount/pull/7 and moves it to SpeziViews.Testing
Additional UI tests were added.
Reviewer Nudging
Ideally, have a look at the added UI tests and then at the
AsyncButton
implementation itself. It might be helpful to play around with the Previews ofAsyncButton
as well.Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: