-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add 'Got it' modal when deleting a workspace with existing cards #80456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add 'Got it' modal when deleting a workspace with existing cards #80456
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f495da82dc
ℹ️ 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".
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.
|
…dal-not-displayed-offline
…dal-not-displayed-offline
…dal-not-displayed-offline
…dal-not-displayed-offline
…dal-not-displayed-offline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
App/src/pages/workspace/WorkspacesListPage.tsx
Lines 245 to 249 in 45a3728
| deleteWorkspace({ | |
| policyID: policyIDToDelete, | |
| activePolicyID, | |
| policyName: policyNameToDelete, | |
| lastAccessedWorkspacePolicyID, |
confirmDelete always calls deleteWorkspace(...) before the offline/hasWorkspaceDeleteErrorOffline guard returns, so the delete is still queued and optimistic delete updates (pendingAction DELETE / report archiving) are applied even though the UI immediately shows the offline error. If the request later runs when reconnecting (or if cards are removed), the workspace can be deleted without an explicit retry, or reports can remain archived while offline. Short‑circuit before calling deleteWorkspace or cancel the queued write when showing the offline error modal.
ℹ️ 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".
|
@Pujan92 This PR is ready. |
…dal-not-displayed-offline
…dal-not-displayed-offline
|
@huult why are we showing this failure modal that prevents deleting Expensify Cards in the first place, right after a modal saying that deleting the workspace will remove cards? I thought we supported removing the Expensify Card feed when deleting a workspace? |
|
@joekaufmanexpensify Yes, after you pointed this out, I also agree that it looks odd. Alternatively, we could update the backend to allow deleting the workspace and remove all Expensify Card feeds, as described in the first modal. |
…dal-not-displayed-offline
|
Hm, do you know if that changed recently? We definitely used to support deleting a workspace with Expensify Cards if there are no unbilled transactions. cc @mountiny |
|
@joekaufmanexpensify I’m not sure. I think we should ask the backend team for more details. Screen.Recording.2026-02-04.at.09.29.23.mov |
…dal-not-displayed-offline
|
I dont really clearly remember where we put the line, but I know that there were some restrictions in place when trying to delete workspace. I recommend to make sure to align on the expected results exactly and then we can create Internal issue to look into this and make sure the DeletePolicy flow does that |
…dal-not-displayed-offline
My recollection is that we allowed it if the Expensify Card feed didn't have any unbilled transactions. But you're saying that this isn't possible in any situation right now yeah @huult ? |
…dal-not-displayed-offline
Screen.Recording.2026-02-10.at.16.03.22.mov1 If we only enable the card feature but do not issue or add any cards, the workspace can be deleted. Screen.Recording.2026-02-10.at.16.06.01.mov2 If a company card has been added, the workspace can still be deleted. Screen.Recording.2026-02-10.at.16.38.09.mov3 If a company card has been added and assigned, the workspace can still be deleted. Screen.Recording.2026-02-10.at.17.05.17.mov4 If an expense card has been added and issued, the workspace can still be deleted. Screen.Recording.2026-02-10.at.17.10.42.mov@joekaufmanexpensify Just to double-check: when the card feed connection is broken, deleting the workspace is blocked and we show the error message “Your company still has open Expensify Cards.” However, when a card has been added and issued (and the feed is connected), the workspace can still be deleted like videos above. |
|
Got it. Yeah, it's expected that you can delete the workspace when there are company cards. That's what the warning modal is for. For Expensify Cards, I'd expect that you'd be able to delete the workspace still as long as there are no Expensify Card transactions we haven't billed for yet. And we'd just close the cards if the user did that. It definitely used to work that way, but must've been changed. It'd also be fine with me to just prevent deleting workspace when there are Expensify Cards. But why show the warning modal at all then? If they can't delete the workspace, we should just show an error explaining that right when they try to delete. That warning should also explain how to resolve that, and ideally link them to their concierge chat to get the cards removed. |
|
@joekaufmanexpensify You might be misunderstanding this, because in the cases I listed, the workspace can be deleted. There is only one case where the workspace cannot be deleted: when the card feed connection is broken. In that case, deletion is not allowed. I think we should only show the “Got it” modal when the user is offline and the workspace has a broken card feed connection. |
|
Ah, sorry. I think I got confused about how the videos were posted. Yeah, throwing an error that you can't delete a workspace because there are open Expensify Cards when there's a broken connection error on an unrelated company cards feed doesn't really make sense to me. |
|
@joekaufmanexpensify Yes, I think the same. This error message isn’t correct. We should update the copy to say that the card feed is broken and the workspace can’t be deleted. If so, I think we should also update the error message on the backend. |
…dal-not-displayed-offline
Explanation of Change
Fixed Issues
$ #79022
PROPOSAL: #79022 (comment)
Tests
Same QA step
Offline tests
QA Steps
Preconditions: The workspace has issued an Expensify Card to the member.
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
Screen.Recording.2026-01-29.at.12.01.18.mp4
Android: mWeb Chrome
Screen.Recording.2026-01-29.at.12.02.21.mp4
iOS: Native
Screen.Recording.2026-01-29.at.12.04.27.mp4
iOS: mWeb Safari
Screen.Recording.2026-01-29.at.12.05.52.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-01-29.at.11.58.35.mp4