[CP Staging] Revert "Refactor ReanimatedModal/index.tsx to follow Rules of React and compile with React Compiler" (#90358)#90522
Conversation
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
…d set-state-in-effect violations
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.3.73-4 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a revert of internal modal animation/transition logic ( |
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.3.73-4 🚀
Bundle Size Analysis (Sentry): |
|
thanks for handling @abzokhattab @Beamanator |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.73-4 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 9.3.74-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are needed for this PR. This is a revert of a prior internal refactor to |
Explanation of Change
Reverts the merge commit
0348dd515ec(PR #90358).PR #90358 refactored
ReanimatedModal/index.tsxto eliminateisVisibleStateand deriveisTransitioningdirectly. The refactor introduced a regression: the modal content is now removed from the React tree in the same render thatisVisiblebecomesfalse. This causes a window — between React's commit and Reanimated's exit-animation interception — where the transparentModalwrapper is still mounted but has no children, exposing the underlying UI through it.The original code avoided this by using
isVisibleState(a state variable initialized fromisVisible) whose update was deferred to auseEffect. This guaranteed the content stayed mounted for the first render afterisVisible → false, giving Reanimated's dummy-clone mechanism time to intercept the unmount and start the exit animation before any visible frame was painted with an empty modal.Fixed Issues
$ #90510
$ #90438
$ #90463
$ #90442
$ #90527
$ #90450
Tests
Offline tests
Not applicable — modal open/close behavior is not network-dependent.
QA Steps
#90510 — Search RHP close flash (web):
#90438 — Distance RHP animates correctly after changing distance rate:
5. Go to Workspace Settings > Distance Rates
6. Tap Settings > Unit and select a different rate
7. Verify the RHP animates in and out correctly (no freeze or missing animation)
#90442 — Delete actions work immediately after closing a modal (Android):
8. Open any expense report and tap More > Delete > Delete
9. Verify the delete confirmation modal appears without delay and the expense is removed
10. Repeat for other delete flows: saved search, category, tag, distance rate — all should respond immediately
#90463 — Import spreadsheet modal appears after dismissing an upgrade modal (Android):
11. Go to Workspace Settings > Tags, enable tags, add one
12. Tap More > Import spreadsheet > Multi-level of tags > Upgrade > Got it Thanks
13. Tap Switch Tag Levels
14. Verify the Import spreadsheet modal appears correctly with a Choose file button
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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