-
Notifications
You must be signed in to change notification settings - Fork 121
[Just In Time Messages] Animate hiding of message in My Store screen #8293
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
Conversation
You can test the changes from this Pull Request by:
|
|
The code looks great and it tests (almost) well. I found a crash, I couldn't get the exact steps but it happened often to me:
Tested with device iPhone 13 Pro 16.1, Crash in 00:17 RPReplay_Final1669983404.MP4 |
|
Good catch, I pushed a couple new commits that should make this more solid:
I tested a few random scenarios and it seems to work fine. A small glitch is that if you leave the screen while you are on portrait with the header visible, rotate to landscape from other screen, and go back to My Store, the header will be visible for a split second before disappearing. This is because I'm running the update from |
Generated by 🚫 dangerJS |
|
Moving this to 11.6, if you get to it earlier, feel free to move back to 11.5 and merge |
|
Now it tests well @koke, thanks for the change. I just added a non-blocker comment. |
| /// | ||
| func updateAnnouncementCardVisibility() { | ||
| announcementView?.isHidden = navigationBarIsShort | ||
| func showHeader() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker but perhaps we could collapse these two methods that look very similar into one with a parameter:
func changeHeaderVisibility(isHidden: Bool) {
contentTopToHeaderConstraint?.isActive = !isHidden
headerStackView.alpha = isHidden ? 1 : 0
view.layoutIfNeeded()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On one hand, I like the idea of reducing duplication, but I think I lean towards the current implementation since it seems clearer what showing or hiding would do, without having to parse inline conditionals.
Closes: #8048
Description
In #8228 we started hiding the message without animation as the stats view scrolled. This PR both adds animation and simplifies the logic.
After wrestling with SwiftUI and Auto Layout for almost a week, this seems to be the solution that works for now:
UIHostingController. The header was rendered in the right place, but it was reserving the original space, not letting the stats grow upwards.UIViewPropertyAnimator, so we can correctly cancel any animation in progress, in case the user starts scrolling in the other direction while the animation is in progress. That would stop the animation in the current position, and start a new one in the opposite direction.Testing instructions
See pdfdoF-1uc-p2#comment-2581 for details of setting up your store to be eligible for the test JITM
With a US store that is eligible for the test JITM, on a debug/alpha build of the app
This also seems to fix the rotation issues described in #8228
Screenshots
Screen.Recording.2022-12-02.at.11.25.04.mov
Screen.Recording.2022-12-02.at.11.31.04.mov
RELEASE-NOTES.txtif necessary.