Defer navigation in ConfirmModal onConfirm to prevent screen freeze#85189
Draft
Defer navigation in ConfirmModal onConfirm to prevent screen freeze#85189
Conversation
When ConfirmModal dismisses and navigates simultaneously, the ScreenFreezeWrapper suspends the component tree before the modal's close-transition useEffect can run, leaving the modal overlay blocking all input. Wrapping Navigation.navigate in requestAnimationFrame gives the modal time to start closing before the screen is frozen. Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
7 tasks
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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
When a
ConfirmModalon the More Features page dismisses and navigates simultaneously (e.g., clicking "Go to Expensify Cards" in the workflow warning modal), theScreenFreezeWrapperintroduced by PR #82764 suspends the component tree viauseLayoutEffectbefore theReanimatedModal'suseEffectcan process the visibility change and start the close transition. This leaves the modal overlay blocking all input, making the app appear frozen.This PR wraps the
Navigation.navigate()calls inrequestAnimationFrame()within theonConfirmhandlers of threeConfirmModalinstances that navigate away from the page. This gives the modal time to start its close transition before the screen is frozen — matching the existing fix pattern already applied inAttachmentModalBaseContent.Fixed Issues
$ #85184
PROPOSAL: #85184 (comment)
Tests
Offline tests
This change only affects navigation timing after a modal dismiss. Offline behavior is not affected since the navigation is local (no network calls).
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
No UI changes — navigation timing only.
Android: mWeb Chrome
No UI changes — navigation timing only.
iOS: Native
No UI changes — navigation timing only.
iOS: mWeb Safari
No UI changes — navigation timing only.
MacOS: Chrome / Safari
No UI changes — navigation timing only.