[POC] react navigation 8 pauseWhenCovered - #97477
Draft
LukasMod wants to merge 5 commits into
Draft
Conversation
Contributor
|
|
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.
Explanation of Change
Explanation of Change
Why: screens under the RHP re-render on every Onyx write during interactions —
ManualSendMessage626 ms on web, 1289 ms on iOS, 940 ms on Android. Stock v8 can't pause them on either platform: both stack implementations keep covered/before-last screens live, and neither can see a cover coming from an ancestor navigator.What: patched
pauseWhenCoveredscreen option, on web and native — pauses a screen via React<Activity mode="hidden">(subscriptions unmounted, renders deferred to idle) while keeping it painted. Applied per-screen to the same 5 heavy list screens on all platforms (report chat, Search listing, 3 report RHP screens). Onyx updates aren't lost, just deferred — paused screens still re-render at idle priority and pull fresh data, so content under the blur stays up to date off the critical path.How: three patches —
CardStack): pause flagged screens when covered in-stack or by an ancestor's cover viaIsFocusedContext; +dontDetachScreenso split sidebars survive.NativeStackView): same two branches, plus native-only cover exclusions — sheets, iPad/form-sheet modals, dismissing screens. Keep-visible and the 500 ms delay come from stockActivityView.native, which neutralizesdisplay: nonevia adisplay: contentsview config instead of web's MutationObserver.{web, native}options conversion — without it v8 silently drops every platform-nested option, and it's the path the newnative:flags travel.Native also forced
react-native-gesture-handler3.1.0 — a hard peer requirement of v8's stack (>= 3.0.0) — whoseLegacy*re-export rename touched 11 call sites and needed a 4threact-native-draggable-flatlistpatch.Result: send-message, same scenario on a heavy account:
Cost: pause re-runs effects on resume — mount-effect/cleanup idioms need ref guards (3 fixed on web); Reanimated exit animations flicker under pause on web (stopgap: disabled on Expense listing). Pause logic is now duplicated across two stack implementations.
PoC scope: 3 of the 15 v7 react-navigation patches re-evaluated/ported, no TypeScript fixes after the navigation bump (typecheck deliberately skipped), and no native regression sweep yet — the effect-lifetime failure classes and the RNGH 3 gesture call sites were only verified on web.
Fixed Issues
$ #97081
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari