Consolidate ConfirmModal instances into a global component v3#71169
Consolidate ConfirmModal instances into a global component v3#71169roryabraham merged 26 commits intoExpensify:mainfrom
Conversation
|
@alitoshmatov 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2025-10-09.14.43.29.movAndroid: mWeb Chrome2025-10-09.14.43.29.moviOS: HybridApp2025-10-09.14.39.10.moviOS: mWeb Safari2025-10-09.14.28.43.movMacOS: Chrome / Safari2025-10-09.14.23.19.movMacOS: Desktop2025-10-09.14.23.19.mov |
|
As I can see, we don't have a close animation for the delete report modal 2025-10-07.22.50.13.mov |
I think that there is no close animation on staging, too. |
No 2025-10-09.11.48.05.mov |
|
@ZhenjaHorbach I've pushed commit with exit animations. Should work now |
Now is good |
|
LGTM! |
|
@nlemma I found the probable LOC that affected your story. Please check again but I have one question. Are you sure that you tested on exported expense? Root cause: there was invalid |
|
@sosek108 yes, I'm 100% sure we tested on an exported expense. Do we have a new build to retest this on? |
|
@MarioExpensify could you please trigger adhoc build? |
On the screen attached by you I can see primary button Or maybe there is some other (not related to this PR) issue with exporting capabilities? |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
@nlemma can we get a recheck here? |
|
@MarioExpensify the issue is no longer reproducible. retest.MP4 |
|
I've resolved conflicts related to this PR #73232 |
|
Awesome, let's move forward then! |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.2.47-0 🚀
|
|
@sosek108 @roryabraham can you please explain, how we can create workspace with DEW enabled? |
|
@IuliiaHerets I'm not sure we have a way for you to enable DEW on staging, so for now you can skip that test step I suppose |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.47-1 🚀
|
| if (result.action !== ModalActions.CONFIRM) { | ||
| return; | ||
| } | ||
| Navigation.goBack(route.params?.backTo); |
There was a problem hiding this comment.
backTo param is cleared when switching tab. Should have a fallback here. #74731
| // Money request should be deleted when interactions are done, to not show the not found page before navigating to goBackRoute | ||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| InteractionManager.runAfterInteractions(() => { | ||
| deleteTransactions([transaction.transactionID], duplicateTransactions, duplicateTransactionViolations, currentSearchHash, false); | ||
| removeTransaction(transaction.transactionID); | ||
| }); | ||
| goBackRoute = getNavigationUrlOnMoneyRequestDelete(transaction.transactionID, requestParentReportAction, iouReport, chatIOUReport, isChatIOUReportArchived, false); | ||
| } | ||
|
|
||
| if (goBackRoute) { | ||
| Navigation.setNavigationActionToMicrotaskQueue(() => navigateOnDeleteExpense(goBackRoute)); | ||
| } |
There was a problem hiding this comment.
Coming from #77600: we should navigate before deleting the transaction.
More details: #77600 (comment)
| if (transactions.filter((trans) => trans.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length === selectedTransactionIDs.length) { | ||
| const backToRoute = route.params?.backTo ?? (chatReport?.reportID ? ROUTES.REPORT_WITH_ID.getRoute(chatReport.reportID) : undefined); | ||
| Navigation.goBack(backToRoute); | ||
| } | ||
| handleDeleteTransactions(); |
There was a problem hiding this comment.
The goBack and delete actions are executed simultaneously here. However, due to a race condition between them, the delete action might update the Onyx data faster, causing the empty report state to appear before the navigation completes.
Issue: #74569

@zirgulis
Explanation of Change
Currently the app suffers from component bloat in regards to ConfirmModal instances. Reduce the memory footprint and simplify working with modals by consolidating ConfirmModal instances into a single component instance.
Fixed Issues
$ #68799 (original task)
$ #69730 (deploy blocker)
$ #69711 (deploy blocker)
$ #70726 (deploy blocker)
$ #70728 (deploy blocker)
PROPOSAL:
This PR reintroduces changes from #70111 made by @zirgulis and fixes deploy blockers that were reported.
Tests
These test cases will require you to have several reports with various states: report without expenses; report with one and multiple expenses; report that are exported to integration (eg. NetSuite or Xero).
For each modal please validate:
Cancel payment
More->Cancel paymentCancel paymentDelete report without any expenses (empty)
More->DeleteDelete report with single expense
More->DeleteDelete report with multiple expenses
More->DeleteDelete selected expenses from report
DeleteExport report with templates
Export-> Any export templateExport report again
More->Export->Export to XYZCancelMore->Export->Export to XYZReopen exported report
More->Reopen reportUnapprove exported report
More->UnapproveRedirect to OldDot modal
Offline tests
Same as in Tests
QA Steps
Same as in Tests
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
MacOS: Desktop