Skip to content

[Due for payment 2026-07-01] [$250] Improve copy on "blocked deletion" modal when workspace has active Expensify Cards #92511

Closed

Description

@melvin-bot

Context

When a user tries to delete a workspace that has Expensify Cards with unsettled/unbilled transactions, a second modal is shown blocking the deletion and asking them to reach out to Concierge. The current copy on this modal is unclear.

This was discussed in the context of #88380.

Required Change

Update the modal copy to:

Title: Delete workspace

Body: Your company still has Expensify Cards. Please reach out to Concierge to remove them.

Notes

  • The modal with the "Delete" button (shown for third-party cards) should remain unchanged — only the secondary/blocked modal needs new copy.
  • The Concierge link in the body should open a Concierge chat.
Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit

Activity

  1. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 3, 2026
  2. melvin-bot commented on Jun 3, 2026

    @melvin-bot
    Author

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (External)

  3. changed the title [-]Improve copy on "blocked deletion" modal when workspace has active Expensify Cards[/-] [+][$250] Improve copy on "blocked deletion" modal when workspace has active Expensify Cards[/+] on Jun 3, 2026
  4. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 3, 2026
  5. melvin-bot commented on Jun 3, 2026

    @melvin-bot
    Author
  6. joekaufmanexpensify commented on Jun 3, 2026

    @joekaufmanexpensify
    Contributor

    Discussed this change here

  7. David-2002065 commented on Jun 3, 2026

    @David-2002065
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user tries to delete a workspace that still has active Expensify Cards (cards with unsettled/unbilled transactions), a second/blocking modal stops the deletion. Its body copy — "Your company still has open Expensify Cards." — is unclear, gives the user no way to act, and has no Concierge link. We want the new copy plus an in‑app link that opens a Concierge chat. The first modal (the one with the actual Delete button, shown for third‑party card feeds) must stay unchanged, and the title (workspace.common.delete = "Delete workspace") is already correct.

    What is the root cause of that problem?

    The blocking error is attached to the policy when deleteWorkspace detects open Expensify Cards, keyed to the deleteOpenExpensifyCardsError translation:

    errors: hasDeleteWorkspaceExpensifyCardsError ? ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.common.deleteOpenExpensifyCardsError') : null,

    It resolves to the terse string:

    deleteOpenExpensifyCardsError: 'Your company still has open Expensify Cards.',

    Both workspace surfaces read it via getLatestErrorMessage(policy) and surface the secondary modal through the imperative useConfirmModal() API, passing the raw string as prompt. In WorkspaceOverviewPage (policyLastErrorMessage):

    if (isOffline && policyLastErrorMessage && hasExpensifyCard) {
    if (isErrorModalShowingRef.current) {
    return;
    }
    isErrorModalShowingRef.current = true;
    showConfirmModal({
    title: translate('workspace.common.delete'),
    prompt: policyLastErrorMessage,
    confirmText: translate('common.buttonConfirm'),
    shouldShowCancelButton: false,
    success: false,
    }).then(() => {

    showConfirmModal({
    title: translate('workspace.common.delete'),
    prompt: policyLastErrorMessage,
    confirmText: translate('common.buttonConfirm'),
    shouldShowCancelButton: false,
    success: false,
    }).then(() => {

    and in WorkspacesListPage (policyToDeleteLatestErrorMessage):

    prevIsPendingDeleteRef.current = isPendingDelete;
    // Handle showing error modal when offline and error occurs
    if (isOffline && policyToDeleteLatestErrorMessage) {
    if (isErrorModalShowingRef.current) {
    return;
    }
    isErrorModalShowingRef.current = true;
    showConfirmModal({
    title: translate('workspace.common.delete'),
    prompt: policyToDeleteLatestErrorMessage,
    confirmText: translate('common.buttonConfirm'),
    cancelText: translate('common.cancel'),
    success: false,
    shouldShowCancelButton: false,
    }).then(() => {

    showConfirmModal({
    title: translate('workspace.common.delete'),
    prompt: policyToDeleteLatestErrorMessage,
    confirmText: translate('common.buttonConfirm'),
    cancelText: translate('common.cancel'),
    success: false,
    shouldShowCancelButton: false,
    }).then(() => {

    Note: this code was recently migrated from a JSX <ConfirmModal prompt={...}> to the imperative showConfirmModal({prompt}) flow via useConfirmModal, so the fix lands at the showConfirmModal call sites, not on a JSX element.

    ConfirmContent only wraps the prompt in <Text> when it is a string; a React node is rendered as‑is. So a plain‑string prompt can never carry an interactive link, even if the translation contained markup:

    {typeof prompt === 'string' ? <Text style={[promptStyles, isCentered ? styles.textAlignCenter : {}]}>{prompt}</Text> : prompt}

    That is the root cause on both fronts: the copy is a bare error string, and as a plain string it cannot host a Concierge link.

    What changes do you think we should make in order to solve the problem?

    Keep the existing error flow (the translation key is still stored as the policy error and read via getLatestErrorMessage) and change only two things — the copy, and how the modal renders it. There is an established precedent for exactly this case in UnshareBankAccount.tsx: render the prompt through RenderHTML with a <concierge-link> tag, which the existing ConciergeLinkRenderer turns into an in‑app Concierge navigation.

    prompt={
    <View style={[styles.renderHTML, styles.flexRow]}>
    <RenderHTML html={translate('walletPage.reachOutForHelp')} />

    1. Update deleteOpenExpensifyCardsError in src/languages/en.ts to the new copy with a <concierge-link> tag:
    deleteOpenExpensifyCardsError: 'Your company still has Expensify Cards. Please <concierge-link>reach out to Concierge</concierge-link> to remove them.',
    1. At the showConfirmModal call sites in both WorkspaceOverviewPage.tsx and WorkspacesListPage.tsx, render the prompt via RenderHTML so the <concierge-link> tag becomes a tappable link instead of literal text:
    showConfirmModal({
      title: translate("workspace.common.delete"),
      prompt: (
        <View style={[styles.renderHTML, styles.flexRow]}>
          <RenderHTML html={policyLastErrorMessage} />
        </View>
      ),
      confirmText: translate("common.buttonConfirm"),
      shouldShowCancelButton: false,
      success: false,
    });

    The same swap applies to the policyToDeleteLatestErrorMessage call sites in WorkspacesListPage.tsx. getLatestErrorMessage is typed to return string (never undefined), so RenderHTML html={...} is type‑safe with no null‑coalescing needed. ConfirmContent renders a React‑node prompt directly (it only wraps strings in <Text>), and the <View style={[styles.renderHTML, styles.flexRow]}> wrapper keeps RenderHTML out of any <Text> ancestor — matching the UnshareBankAccount pattern exactly.

    The <concierge-link> tag is registered to ConciergeLinkRenderer, which calls navigateToConciergeChat on press, satisfying "the Concierge link in the body should open a Concierge chat" with no new wiring:

    'concierge-link': ConciergeLinkRenderer,

    const navigateToConciergeChat = () => {
    navigateToConciergeChatAction(conciergeReportID, introSelected, currentUserAccountID, isSelfTourViewed, betas, false);
    };

    1. Mirror the new copy in the other locale files that carry deleteOpenExpensifyCardsError (es.ts, de.ts, fr.ts, it.ts, ja.ts, nl.ts, pl.ts, pt-BR.ts, zh-hans.ts), wrapping the "reach out to Concierge" phrase in <concierge-link> so the link works in every language.

    The first/primary "Are you sure you want to delete this workspace?" modal (deleteWithCardsConfirmation) is intentionally left untouched, matching the note in the issue.

    What to test: create a workspace with Expensify Cards enabled and at least one unsettled card, then attempt deletion from both Workspace Overview and the Workspaces list. The secondary modal should read "Delete workspace" / "Your company still has Expensify Cards. Please reach out to Concierge to remove them.", and tapping the link should open the in‑app Concierge chat (not an external browser tab). Confirm a workspace with only third‑party card feeds still shows the unchanged primary modal with a working Delete button.

    What alternative solutions did you explore? (Optional)

    • Render the new copy directly as JSX in the modal, bypassing the Onyx error string (gated by hasDeleteWorkspaceExpensifyCardsError). Rejected because the same modal also surfaces other backend‑returned "can't delete" reasons from the DeleteWorkspace API; bypassing the errors flow for this one case would split rendering into two paths and let optimistic vs. backend behavior diverge. Keeping the translation key in the errors object preserves parity.
    • Build the link with a plain <TextLink href={CONST.CONCIERGE_URL}> instead of the <concierge-link> tag. Rejected because TextLink opens the marketing URL in a browser, which fails the "open a Concierge chat" requirement; <concierge-link> resolves to the in‑product Concierge report and reuses navigateToConciergeChat (with introSelected, betas, isSelfTourViewed, etc.) already encapsulated in ConciergeLinkRenderer.
  8. wildan-m commented on Jun 3, 2026

    @wildan-m
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user tries to delete a workspace that still has active Expensify Cards (cards with unsettled/unbilled transactions), a second modal blocks the deletion. The current body copy on that modal — "Your company still has open Expensify Cards." — is unclear and gives the user no way to act on it. We want the modal to show clearer copy and include a link that opens a Concierge chat so the user can have the cards removed. The first modal (the one with the "Delete" button, shown for third-party cards) must remain unchanged.

    What is the root cause of that problem?

    The blocked-deletion modal renders its body directly from the policy's raw Onyx error message, passed to ConfirmModal as a plain-string prompt. That error message is set when the delete request fails with active Expensify Cards:

    errors: hasDeleteWorkspaceExpensifyCardsError ? ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('workspace.common.deleteOpenExpensifyCardsError') : null,

    It resolves to the terse translation workspace.common.deleteOpenExpensifyCardsError:

    deleteOpenExpensifyCardsError: 'Your company still has open Expensify Cards.',

    The error string is then read via getLatestErrorMessage(policy) and passed straight into the modal's prompt as plain text, in the workspace overview page:

    <ConfirmModal
    title={translate('workspace.common.delete')}
    isVisible={isDeleteWorkspaceErrorModalOpen}
    onConfirm={hideDeleteWorkspaceErrorModal}
    onCancel={hideDeleteWorkspaceErrorModal}
    prompt={policyLastErrorMessage}
    confirmText={translate('common.buttonConfirm')}
    shouldShowCancelButton={false}
    success={false}
    />

    and in the workspaces list page:

    <ConfirmModal
    title={translate('workspace.common.delete')}
    isVisible={isDeleteWorkspaceErrorModalOpen}
    onConfirm={hideDeleteWorkspaceErrorModal}
    onCancel={hideDeleteWorkspaceErrorModal}
    prompt={policyToDeleteLatestErrorMessage}

    Two consequences follow: (1) the copy is just the bare error string with no guidance, and (2) because the prompt is rendered as a plain string, there is no mechanism for it to carry an interactive Concierge link. Note the modal title already uses workspace.common.delete, which is "Delete workspace", so the requested title is already correct and needs no change.

    What changes do you think we should make in order to solve the problem?

    1. Update the body copy of the translation key workspace.common.deleteOpenExpensifyCardsError in both src/languages/en.ts and src/languages/es.ts to the requested wording, embedding the app's existing <concierge-link> custom tag around the "reach out to Concierge" text. The new English string becomes: Your company still has Expensify Cards. Please <concierge-link>reach out to Concierge</concierge-link> to remove them. (with the equivalent Spanish translation in es.ts).

    2. In both blocked-deletion modals, render the prompt through RenderHTML instead of passing the raw string, so the <concierge-link> tag is parsed and becomes an interactive link rather than literal text. Concretely, change the prompt={policyLastErrorMessage} line in WorkspaceOverviewPage.tsx and the prompt={policyToDeleteLatestErrorMessage} line in WorkspacesListPage.tsx to wrap the message in a RenderHTML element. ConfirmModal's prompt already accepts a React node, and rendering workspace prompt copy via RenderHTML is an established pattern in the codebase (for example WorkspaceResetBankAccountModal and WorkspaceOverviewSharePage).

    The <concierge-link> tag is already wired to open the in-app Concierge chat through the existing renderer, which calls navigateToConciergeChat on press:

    https://github.com/Expensify/App/blob/dd0f6b462ad71463337e67a523bd5d33e76098aa/src/components/HTMLEngineProvider/HTMLRenderers/ConciergeLinkRenderer.tsx

    so reusing it satisfies the requirement that the link open a Concierge chat, with no new link-handling code. The first "Delete" confirmation modal is left untouched.

    What alternative solutions did you explore? (Optional)

    • Use a plain external anchor pointing at https://www.expensify.com/concierge instead of the <concierge-link> tag. Rejected because the issue specifies the link should open a Concierge chat in the app; an external URL would navigate the user out of the app, whereas <concierge-link> opens the in-app Concierge chat natively.
    • Keep passing the message as a plain translate() string without RenderHTML. Rejected because a plain string cannot carry an interactive link — the <concierge-link> tag would render as literal text.
  9. 30 remaining items

  10. melvin-bot commented on Jun 30, 2026

    @melvin-bot
    Author

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Jun 30, 2026

    @melvin-bot
    Author

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2062167459381598260/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. linhvovan29546 commented on Jul 1, 2026

    @linhvovan29546
    Contributor

    Required Change
    Update the modal copy to:

    I'm not sure we need a regression test for this issue, since the PR overall updates the text.

  13. linhvovan29546 commented on Jul 1, 2026

    @linhvovan29546
    Contributor

    Deploy Blocker #94408 was identified to be related to the PR #92917 that attempted to fix this issue.

    Note: This is not a regression. It's just an edge case where the BE returns the message unchanged.

  14. mallenexpensify commented on Jul 2, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @linhvovan29546 paid $250 via NewDot

  15. mallenexpensify commented on Jul 3, 2026

    @mallenexpensify
    Contributor

    @linhvovan29546 can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022073156033800792499

  16. linhvovan29546 commented on Jul 3, 2026

    @linhvovan29546
    Contributor

    @mallenexpensify I've accepted the offer

  17. mallenexpensify commented on Jul 3, 2026

    @mallenexpensify
    Contributor

    @linhvovan29546 paid, summary updated above. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorImprovementItem broken or needs improvement.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions