Repository navigation
[CP Stg] Settle the Submit via PDF modal promise on dismiss so cleanup runs behind the fading modal - #105222
Conversation
…hind the fading modal Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
🤖 Web test steps verification results: The PR's Tests section is still a TODO, so I followed the repro steps from the linked issue. Steps 1–5 pass. Step 6 is the dismiss timing check that this PR fixes, and I couldn't run it. In the dev environment, the PDF finished generating almost at once. The browser then opened an unreachable download URL (
|
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safariweb.mov |
|
@MelvinBot i've completed my checklist, please complete the author checklist and fill the Test + QA Steps section |
|
@MelvinBot please open this PR |
|
🤖 Android test steps verification results: Steps 1–3 pass, but "Submit via PDF" never appeared, so steps 4–7 (the dismiss timing this PR fixes) couldn't run. The test account was already onboarded and had no workspace, so the tester created a regular one. The app only offers "Submit via PDF" on a Submit-type workspace ( |
|
🤖 I marked this PR as ready for review. The Tests and QA Steps sections still have their TODO placeholders. I can't write those for you because they record manual tests a person ran. Please add your steps before the reviewer starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@MelvinBot please add the test steps as this issue #105206 |
|
I added the test steps from Green loading button&Submit button are shown together briefly after dismissing download modal to the PR's Tests section. QA Steps now says "Same as tests." Steps 1–6 copy the issue's repro, starting from the workspace chat. Step 7 checks that the green loading button is replaced by the Submit button, and the two never show together. I left the Offline tests section empty. |
|
🚧 roryabraham 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! 🧪🧪
|
…miss Settle the Submit via PDF modal promise on dismiss so cleanup runs behind the fading modal (cherry picked from commit be0b357) (cherry-picked to staging by roryabraham)
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.5.24-3 🚀
|
|
No help site update is needed. This PR is a bug fix that only changes animation timing when you dismiss the Generate PDF modal, and the Submit via PDF steps in the Submit-Workspace article remain accurate. |
|
@daledah @roryabraham @MelvinBot ScreenRecording_10-28-2026.17-27-30_1.MP4 |
|
This is expected. The PDF had already finished before your click outside took effect. A click outside cancels Submit via PDF only while the modal still shows the "Please wait while we generate the PDF" spinner. After the PDF is ready, closing the modal any way keeps the report submitted. That includes clicking outside, the X, or Cancel. To test step 7, click outside while the spinner is still showing. Turning on network throttling gives you more time. The green button should go away, the report should go back to draft, and the Submit button should come back. Why
I couldn't record this on web. In the test environment, the PDF finishes almost at once, and the download then leaves the app and ends the session. view run · no recording available |
|
@daledah @roryabraham @MelvinBot Recording.3745.mp4 |
|
I couldn't open the video here, so I can't confirm what it shows. I also couldn't reproduce step 7 on web, because my test workspace never showed the Submit via PDF option. The code points to one cause: the PDF finished before your click outside took effect. A click outside retracts the report only while the "Please wait while we generate the PDF" spinner is still showing. If the PDF is ready, or generation fails, closing the modal counts as done. The report then stays submitted, so the Submit button doesn't come back. The same is true on Two things in your video would confirm this:
Why
|
|
@MelvinBot Report ID is 1113108217796186 and Account email is mnata.utest+1028rr@gmail.com, Report is still in draft status Recording.3746.mp4 |
|
Thanks for the details. The report being back in draft means the cancel worked. The retract ran, and so did the animation cleanup. My best guess is that the Submit button did come back, but with the label "Submit via PDF" instead of "Submit". When you pick Submit via PDF, the app saves it as your preferred submit method for that workspace. Cancelling doesn't reset that preference. The next time the button appears, it shows the saved method. That fits your earlier comment: "Submit via PDF is dismissed only when tap on it." Can you check whether the green button in your video reads "Submit via PDF"? If it does, this behavior is expected and was already on Why
|
|
@MelvinBot reads "Submit via PDF" |
|
Thanks for checking. That means step 7 passes. The green "Submit via PDF" button is the Submit button coming back. It shows "Submit via PDF" because it remembers the last submit method you picked for that workspace. The report went back to draft and the loading button went away, so the cancel worked as intended. The label behavior was already on Why
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.24-8 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.5.25-0 🚀
|
|
No help site update needed. This PR fixes a brief visual overlap of the Submitting animation and the Submit button when you cancel Submit via PDF. It doesn't change any feature, label, or step that a help article describes. |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.25-2 🚀
Bundle Size Analysis (Sentry): |







Explanation of Change
When you cancel Submit via PDF, the app stops the green "Submitting" animation and retracts the report. Decouple the file download modal from report and Expensify Card logic moved that cleanup to after the modal finished hiding. The header then swapped the animated button for the Submit dropdown on a clear screen. The spinner's exit animation kept it visible beside the new button for about 250ms.
This PR adds an optional
shouldResolveOnDismissprop toFileDownloadModalWrapper(defaultfalse). When it's true,handleClosecallsresolveModalwith the dismiss action right after it hides the modal. Callers then run their cleanup while the modal fades out, so the overlay hides the button swap again.closeModalstays inhandleModalHide, so the modal still leaves the stack only after it has finished hiding.closeModalalready handles a promise thatresolveModalhas settled.ReportPDFDownloadModalpassesshouldResolveOnDismiss.ExpensifyCardStatementPDFDownloadModalis unchanged and keeps the after-hide timing.Fixed Issues
$ #105206
PROPOSAL: #105206 (comment)
Tests
Precondition: Complete onboarding with "Submit expenses to my employer".
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.AI Tests
npm run lint-changed,npm run typecheck,npm run spell-changed,react-compiler-compliance-check checkon both changed components.FileDownloadModalWrapperTest,useReportPDFDownloadModalTest,useExpensifyCardStatementPDFDownloadModalTest,useSearchBulkActionsDownloadPDFTest. I added two wrapper tests forshouldResolveOnDismissand updated the hook test to expect resolution on dismiss.prettiernpm script.react-compiler-compliance-check check-changedcouldn't find the base branch in this environment, so I checked the files directly.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari