Measure Updated ViewTransition Boundaries#32653
Merged
sebmarkbage merged 7 commits intofacebook:mainfrom Mar 18, 2025
Merged
Conversation
The restore phase should not check the flag. I removed that condition in the other passes. We stash previous measurments on "current". We should also clear that same Fiber. Also, when we cancel we need to visit the same Fiber we applied names to in case it changed. In practice this doesn't matter because if it did change we couldn't cancel it.
…celled If not cancelled, this is the path that adds the "new" name. Since the "old" name was only added to the clones, this will be the first time they're added, even if the HostInstances are shared.
We don't need to hold onto it all the way to the passive commit.
Don't update the button in the fixture optimistically to highlight this.
This allows us to adjust the measurement of the clone which is outside the viewport as if it was inside of it.
Because we don't use the helpers in CommitHostEffects we have to manually track whether this caused any mutations for deletions, insertions, hides, unhides and updates to text content. Otherwise, we end up canceling boundaries that should've animated.
Contributor
Author
|
This avoids actually animating the "Swipe me" bar since it doesn't change and its parents doesn't change. That avoids this Safari iOS bug: https://bugs.webkit.org/show_bug.cgi?id=288795 This means that the fixture now works on iOS Beta with the Scroll-driven flag on. In fact, it doesn't even have the bug I mentioned above which I'm observing on Safari Technical Preview on desktop. It is cheating though because really should be able to wrap the SwipeRecognizer around the content that animates. |
rickhanlonii
approved these changes
Mar 18, 2025
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 18, 2025
This does the same thing for that we did for in e3cbaff. If a boundary hasn't mutated and didn't change in size, we mark it for cancellation. Otherwise we add names to it. The different from the CommitViewTransition path is that the old names are added to the clones so this is the first time the new names. Now we also cancel any boundaries that were unchanged. So now the root no longer animates. We still have to clone them. There are other optimizations that can avoid cloning but once we've done all the layouts we can still cancel the running animation and let them just be the regular content if they didn't change. Just like the regular fire-and-forget path. This also fixes the measurement so that we measure clones by adjusting their position back into the viewport. This actually surfaces a bug in Safari that was already in #32612. It turns out that the old names aren't picked up for some reason and so in Safari they looked more like a cross-fade than what #32612 was supposed to fix. However, now that bug is even more apparent because they actually just disappear in Safari. I'm not sure what that bug is but it's unrelated to this PR so will fix that separately. DiffTrain build for [3c3696d](3c3696d)
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 18, 2025
This does the same thing for that we did for in e3cbaff. If a boundary hasn't mutated and didn't change in size, we mark it for cancellation. Otherwise we add names to it. The different from the CommitViewTransition path is that the old names are added to the clones so this is the first time the new names. Now we also cancel any boundaries that were unchanged. So now the root no longer animates. We still have to clone them. There are other optimizations that can avoid cloning but once we've done all the layouts we can still cancel the running animation and let them just be the regular content if they didn't change. Just like the regular fire-and-forget path. This also fixes the measurement so that we measure clones by adjusting their position back into the viewport. This actually surfaces a bug in Safari that was already in #32612. It turns out that the old names aren't picked up for some reason and so in Safari they looked more like a cross-fade than what #32612 was supposed to fix. However, now that bug is even more apparent because they actually just disappear in Safari. I'm not sure what that bug is but it's unrelated to this PR so will fix that separately. DiffTrain build for [3c3696d](3c3696d)
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 does the same thing for
measureUpdateViewTransitionthat we did formeasureNestedViewTransitionsin e3cbaff. If a boundary hasn't mutated and didn't change in size, we mark it for cancellation. Otherwise we add names to it. The different from the CommitViewTransition path is that the "old" names are added to the clones so this is the first time the "new" names.Now we also cancel any boundaries that were unchanged. So now the root no longer animates. We still have to clone them. There are other optimizations that can avoid cloning but once we've done all the layouts we can still cancel the running animation and let them just be the regular content if they didn't change. Just like the regular fire-and-forget path.
This also fixes the measurement so that we measure clones by adjusting their position back into the viewport.
This actually surfaces a bug in Safari that was already in #32612. It turns out that the old names aren't picked up for some reason and so in Safari they looked more like a cross-fade than what #32612 was supposed to fix. However, now that bug is even more apparent because they actually just disappear in Safari. I'm not sure what that bug is but it's unrelated to this PR so will fix that separately.