[No QA] Extract useExportAgainModal hook from MoneyReportHeader#86961
Conversation
|
@abzokhattab 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e91421ec3c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| showConfirmModal({ | ||
| title: translate('workspace.exportAgainModal.title'), | ||
| prompt: translate('workspace.exportAgainModal.description', { | ||
| connectionName: connectedIntegration ?? connectedIntegrationFallback, | ||
| reportName, |
There was a problem hiding this comment.
Prevent duplicate export-again modals on rapid taps
Each call to triggerExportOrConfirm() now immediately invokes showConfirmModal(), and ModalContext.showModal() pushes a new modal onto a stack when no id is supplied. This means rapid repeated taps on export actions can queue multiple identical confirmations, and confirming each can execute export actions multiple times. The previous state-driven flow implicitly deduplicated this by ignoring repeated setState to the same export mode while a modal was pending.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I think it's not a real concern, the modal appears as a blocking overlay instantly, preventing further taps on the underlying button.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@TMisiukiewicz conflicts and a test failing |
|
@rlinoz conflicts resolved, I think tests failed for some CI instability reason, lets check again |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @rlinoz 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, and Web. Happy testing! 🧪🧪
|
Explanation of Change
Extracted the export-again confirmation flow from
MoneyReportHeaderinto a newuseExportAgainModalhook. The hook receives onlyreportIDandpolicyID, fetchesconnectedIntegrationandreportNameinternally, and exposes a singletriggerExportOrConfirm(exportType)function. This replaces the oldsetExportModalStatus → useEffect → showExportAgainModal → confirmExportindirection with a clean, self-contained API. Removed fromMoneyReportHeader:exportModalStatususeState,confirmExport,showExportAgainModal, the useEffect trigger, and theExportTypeimport. Zero behavioral change — part of the ongoing MoneyReportHeader decomposition effort.Fixed Issues
$ #77173
$ #84123
PROPOSAL:
Tests
Pure moving code from one place to another, no tests needed
Offline tests
N/A
QA Steps
Same as tests
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari