Repository navigation
[Batch 4] Add dismiss action to DecisionModalWrapper and migrate domain close-account and company cards modals - #104531
Conversation
…ccount and company cards modals to useDecisionModal Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
I created this PR from an upstream branch because I don't have push access to your fork. To take ownership of this branch and push updates, run: Then you can close this PR and open a new one from your fork. |
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.
|
|
🤖 Web test steps verification results: The PR's Tests section is still a TODO, so I tested against the acceptance criteria in the linked issue. I couldn't reach any of the three changed modals. The test account has no domain and no company card feed, and creating either one requires an emailed "Validate your account" code that I can't read.
To test the main flows, use an account that is an admin of a verified private domain and has a connected company card feed. |
|
@MelvinBot |
|
I updated the PR description. It now has Tests, Offline tests, and QA steps, and I checked the author checklist items I can vouch for. Test cases added
Still unchecked: you need to do these manually
The two earlier Melvin test runs couldn't reach these modals. The test account has no verified domain and no direct card feed. You'll need an account with both to run the steps. Items checked as not applicable
|
|
@MelvinBot |
…nModalsBatch4 Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com> # Conflicts: # src/pages/domain/Members/DomainMemberDetailsPage.tsx # src/pages/workspace/companyCards/WorkspaceCompanyCardsPage.tsx
|
I fixed the merge conflicts. I merged Both conflicts were in React imports:
Checks after the merge
|
|
@MelvinBot |
|
I marked this PR as ready for review. The author checklist still has unchecked items that need manual testing, such as the all-platform runs, screenshots, and console checks. Complete them before review, or the |
|
@ZhenjaHorbach 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] |
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. |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
|
@MelvinBot |
…nModalsBatch4 Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com> # Conflicts: # src/pages/domain/Members/DomainMemberDetailsPage.tsx
…nModalsBatch4 Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
@roryabraham 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] |
|
Fixed the conflicts by merging The only conflict was in
Typecheck, lint, and the PR's 4 Jest suites (34 tests) pass locally. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-10-30.at.14.48.50.movAndroid: mWeb ChromeScreen.Recording.2026-10-30.at.14.48.50.moviOS: HybridAppScreen.Recording.2026-10-30.at.14.40.39.moviOS: mWeb SafariScreen.Recording.2026-10-30.at.14.37.59.movMacOS: Chrome / SafariScreen.Recording.2026-10-30.at.14.19.12.mov |
|
LGTM! |
|
🚧 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.27-0 🚀
|
|
No help site update needed. This PR moves the domain "Close account" and company cards "Offline" modals to the shared decision modal and fixes dismissing the close-account modal so it no longer counts as a safe close, with the same labels and options, so no help article sentence becomes incorrect. |
|
Deploy Blocker #105646 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.5.27-2 🚀
Bundle Size Analysis (Sentry): |





Explanation of Change
Batch 4 of the move to the global
useDecisionModal. It covers the three modals listed in the issue.Step 1: dismiss result in
DecisionModalWrapperModalActions.DISMISSand an opt-inshouldReportDismissprop onDecisionModalWrapper.DISMISS. Without it, they still resolve withCLOSE, so existingshowDecisionModalcallers behave the same.Domain "Close account" modals (
DomainMemberDetailsPage,DomainMembersPage)DecisionModaland theisModalVisible/shouldForceCloseAccountstate. Each page now runs one async flow:shouldReportDismiss: true).DISMISS, do nothing.Company cards "Offline" modal (
WorkspaceCompanyCardsPage)useAssignCardnow takes anonOfflineAssigncallback instead of thesetShouldShowOfflineModalstate setter.showDecisionModal.Tests
tests/unit/components/DecisionModalWrapperTest.tsx: a default dismiss resolvesCLOSE, an opt-in dismiss resolvesDISMISS, and the buttons still resolveCONFIRM/CLOSE.tests/ui/DomainMemberDetailsPageTest.tsx: dismiss does nothing, safe close and force close callcloseUserAccountwith the right flag, and cancelling the confirm modal reopens the decision modal.tests/ui/WorkspaceCompanyCardsPageSelectionModeTest.tsx:onOfflineAssignshows the offline alert.tests/unit/hooks/useAssignCard.test.ts: updated to the newonOfflineAssignprop.AI Tests
npm teston the 4 changed suites (34 tests) plusModalContextCloseByIDTest,DecisionModalTest,useExportActionsTest, anduseSearchBulkActionsExportTest(74 tests)npm run typechecknpm run lint-changed(no findings)npm run fmt(oxfmt)npm run react-compiler-compliance-check check <changed src files>(no errors).check-changedandspell-changedcould not run in the sandbox becausegit merge-basefailed.npm run lint, the fullnpm test, and the Storybook smoke test. CI will run them.Fixed Issues
$ #102978
PROPOSAL:
Tests
Prerequisites
Domain member details: Close account
Domain members list: bulk Close accounts
13. On the Members page, select 2 members.
14. Open the selection dropdown and click "Close accounts".
15. Verify a "Close accounts" modal opens with "Force close accounts" and "Close accounts safely" buttons.
16. Press Escape. Verify the modal closes, no confirm modal opens, and both members stay selected.
17. Click "Close accounts" again, then click the backdrop. Verify the same result as step 16.
18. Click "Close accounts", then click "Force close accounts". Verify the confirm modal opens.
19. Click "Cancel". Verify the "Close accounts" decision modal opens again.
20. Click "Force close accounts", then confirm. Verify both members are removed from the list and the selection is cleared.
Regression: existing global decision modals
21. Open an expense report, go offline, and use the report header to download a CSV.
22. Verify the "You appear to be offline." modal opens. Press Escape or click the backdrop and verify it closes without errors.
Offline tests
Company cards: assign while offline
Domain: close account while offline
7. Stay offline. Open the domain > Members and click a member.
8. Click "Close account", press Escape, and verify nothing else opens.
9. Click "Close account" > "Close account safely" > "Cancel". Verify the decision modal opens again.
10. Click "Close account safely" and confirm. Verify the member shows as pending deletion (greyed out) in the Members list.
11. Go back online. Verify the member is removed from the list.
QA Steps
Same as Tests and Offline 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.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari