Update splash screen logic#6478
Update splash screen logic#6478roryabraham merged 5 commits intoExpensify:mainfrom zoontek:update-splash-screen-logic
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Fix status bar being a different color than the splash screen background.
There was a problem hiding this comment.
android:windowLightStatusBar and android:windowLightNavigationBar are not available on Android 21 (the min version), tools:ignore silents the Android studio linter.
src/Expensify.js
Outdated
There was a problem hiding this comment.
We wait for react-navigation to be ready. So there's no need to hide the splash screen here.
There was a problem hiding this comment.
Renamed because it's not only used for logging anymore.
Naming taken from https://github.com/bvaughn/react-error-boundary
|
Even if it wasn't implemented in this PR, I strongly recommend adding a default error screen (even without a CTA, just asking the user to restart the app) on error boundary catched error. Previously, if it happen during init (Onyx, etc) user might be stuck on the splash screen without any explanation. Now the splash screen will always disappear (at least, if it's not a complete native thread crash, just a JS error), having something else than a blank screen as error boundary fallback could be nicer for the user 🙂 |
|
Added screenshots for web / desktop where the splash screen module is a noop. |
|
@zoontek You've got a merge conflict |
|
@roryabraham Fixed after @NikkiWines's feedback |
|
I think we need to tag in @Expensify/design for a review here since you changed the |
|
It looks like the app background is now gray instead of white. The background of the right chat area should be white. |
Does the sign in process should also have a white background then? (It was grey, I reused this color for all screens) I can also switch back to appBG: white for all screens or just keep the color change (currently it would be sign in in grey -> loading view in white -> authenticated app in white), but as the colors are too close, it felt a bit weird 😕 |
|
Let's keep all of the colors as they were before this PR was created. Thanks! |
No problem, I will made the change tomorrow. |
|
@shawnborton @roryabraham Colors are rolled back, I fixed the |
|
Thank you! |
|
@zoontek I think you should be compensated for reporting this above so I added a comment to this issue.. Payment will be issues via Upwork once the the issue is fixed internally or by a contributor |
|
@zoontek You've got a merge conflict here |
src/App.js
Outdated
There was a problem hiding this comment.
As an error could happen on context provider initialization, ErrorBoundary should wrap them to hide the splash screen is something goes wrong.
There was a problem hiding this comment.
If there's something that might cause an Error in these components can you point it out?
The parameters used in these components are static, so if an error is to happen it would happen all the time. Meaning if someone introduces and error they'll see it right away
If this change is accepted we should at least add a reminder doc in ErrorBoundary that certain context based functionality is not available inside
Though I would prefer to keep the error boundary access the full context (e.g. withNetwork, withPersonalDetails and others), and only relinquish it if there's a proven possibility that certain context can cause an error
There was a problem hiding this comment.
react-native-onyx might have a bug, no software is perfect. To display an error fallback, it's not worth it to try (imho)
There was a problem hiding this comment.
Yeah, the code in ErrorBoundary might cause an error as well, we're obviously not adding another ErrorBoundary to guard from that
In the future more context components will be created it would be easier if those are kept on the same place and on the same level
- people won't wonder where to put them
- people would not mistakenly put them to the incorrect place
In the feature more components will be created and some of these component would rely on context,
Adding such a component (Like a network status indicator) in the error boundary would not work for seemingly no reason
If there's a bug in the initialization of some Context it fail with a bang any way and never make it to production. Wrapping the error boundary around the context is not necessary at least the currently defined contexts
To sum it up Moving the ErrorBoundary up would work, but introduces restrictions, while it's uncertain that it will help
Not changing the Error boundary position would work as well, and it's not necessary to move it to fix the splash screen bug
There was a problem hiding this comment.
I agree with @kidroca here, this change is accounting for an error that we haven't even encountered yet and it has larger implications than just catching potential initialization errors.
kidroca
left a comment
There was a problem hiding this comment.
Some items that I've noticed
I think addressing them would further reduce the changes in this PR
src/App.js
Outdated
There was a problem hiding this comment.
If there's something that might cause an Error in these components can you point it out?
The parameters used in these components are static, so if an error is to happen it would happen all the time. Meaning if someone introduces and error they'll see it right away
If this change is accepted we should at least add a reminder doc in ErrorBoundary that certain context based functionality is not available inside
Though I would prefer to keep the error boundary access the full context (e.g. withNetwork, withPersonalDetails and others), and only relinquish it if there's a proven possibility that certain context can cause an error
src/libs/BootSplash/index.native.js
Outdated
There was a problem hiding this comment.
If we're no longer using show, and won't be able to use it in the next major version we might as well remove it
This would leave only a single Log call here, so we might leave it in the original place where Log is imported anyway
Also this export configuration does not match the style guide. I think it's specified somewhere, but we first define functions and then export them
src/Expensify.js
Outdated
There was a problem hiding this comment.
This is the same as
setNavigationReady() {
this.setState({ isNavigationReady: true });
}When the state is already true it would just do nothing
But do we expect multiple onReady calls to be triggered anyway?
There was a problem hiding this comment.
Didn't see that it was a PureComponent, so it performs shallow compare on states comparaison anyway indeed. And lie you say, it shouldn't be called more than once.
|
@kidroca I've taken a few feedbacks, wrote some comments for the rest. |
NikkiWines
left a comment
There was a problem hiding this comment.
Some small comments but overall looking pretty good
src/App.js
Outdated
There was a problem hiding this comment.
I agree with @kidroca here, this change is accounting for an error that we haven't even encountered yet and it has larger implications than just catching potential initialization errors.
|
@NikkiWines I've taken your feedbacks 🙂 |
|
@zoontek this PR looks good but, unfortunately, the commits aren't signed so we're unable to merge this. Would you mind re-implementing the same changes in a new PR with signed commits? Sorry about that. |
|
@zoontek I think it might also be possible to retroactively sign your commits via rebase: https://webdevstudios.com/2020/05/26/retroactively-sign-git-commits/ |
|
@NikkiWines @roryabraham Thanks for the article! I signed every commit. The reviews has been dismissed, it will need your approval again (sorry about that) |
|
@zoontek looks like those commits are unverified |
This is weird, they were two days ago 🤔. Maybe because I pushed unverified commits on another repos since. I will re-perform the operation tomorrow. |
|
@NikkiWines @kidroca It's all good now, sorry about the inconvenience. It was my first time using GPG with git. |
|
@zoontek, Great job getting your first Expensify/App pull request over the finish line! 🎉 I know there's a lot of information in our contributing guidelines, so here are some points to take note of 📝:
So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! 😊 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @roryabraham in version: 1.1.20-3 🚀
|
|
🚀 Deployed to production by @Julesssss in version: 1.1.21-1 🚀
|

Following #5620
Details
There are several issue with the current splash integrations:
UIViewControllercould be mounted at the same time (splash screen & growl notifications, could cause [IOS] Stuck on Splash Screen with Code Push zoontek/react-native-bootsplash#119)bootsplash.hide()could reject, which is not handled (see iOS 15 throws "react-native-bootsplash has not been initialized" zoontek/react-native-bootsplash#264, which happen on tapping notification on iOS 15+)NavigationContaineronReadycallback to hide.Fixed Issues
#5620
Tests
QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android