Repository navigation
Conversation
Overlap suspend with the page slide and let swap-marked chrome hand off at rest with duration 0, so native header controls do not flash Web on push/pop. Refs rdlabo-dev#266 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Supersedes #266 (closed). Rebased onto the new
packages/layout and trimmed. It answers the questions asked there.Problem
On a real iPhone SE (iOS 26), native header chrome (a segment that turns into a back button) flashes Web for a frame on stack push and pop. This is visible on a plain Ionic nested stack with nothing exotic.
Why
suspend()/resume()is not enoughconnectNativeUIShellTransitionawaitsprepare()(the suspend) beforeplay(). Native chrome is therefore retired while the page is still at rest, and Web shows for a frame before the slide starts. This is the tap-time flicker.ion-pagetransform. During the slide,visible()/blockedReasonsee the entering page as transformed or hidden and retire its chrome. Only the leaving chrome should retire.0first (that was feat(native): opt-in instant Web/native swap on stack push/pop #266's original commit) and it still flickered on device.Keeping the entering controls native through the slide is a requirement for us: the glass segment and back button are the product, and a Web fallback for 350ms looks broken next to them.
Change
theme-ios27:withNativeUIShellTransitionoverlapsprepare()andplay()and awaitsprepare()beforefinish(). This affects all transitions that use the adapter.data-shell-handoff="swap"(or theios-theme-shell-handoff-swapclass):swapEnteringPage,withoutPageTransform) and stays projected;measureMarkeris used while measuring so the shell marker is not cleared;leftPagesstops a resumed leaving page from re-projecting;0and the two-frame paint wait is skipped only when every changed source is a swap. Mixed sets keep 180ms.native-ui-shell.md.dom-atomic-swap.spec.ts, andnative-ui-shell-transition.spec.tsnow asserts that play starts before suspend completes.Without the attribute, tab switches, modals, menus and unchanged-chrome pushes behave as before. The only unconditional behavior change is the play/prepare overlap.
Verification
build:tspass. Prettier is clean on the changed files.packages/revision, and the Playwright e2e is not included because I couldn't run it here. ThedemoSass build currently fails onutils/structured-listonmain.If you would prefer to split the play/prepare overlap into its own PR first, I can do that.