Skip to content

[Due for payment 2026-07-17] [$250] New Feature : Allow inviting new users in the Add approval workflow flow #61625

Closed

Description

@JmillsExpensify

Description:

We recently observed that users repeatedly attempted to assign a card during setup, only to realize they first needed to invite the person via the Members tab. The same friction occurs in the Add approval workflow case.

Proposal:

We should allow users to invite new members directly within Add approval workflow. This makes the setup process more seamless and reduces context switching. The full flow should be.

Image

Image

Image

Image

Image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021920256850804652435
  • Upwork Job ID: 1920256850804652435
  • Last Price Increase: 2025-05-21
  • Automatic offers:
    • MobileMage | Contributor | 107700538
    • twilight2294 | Contributor | 109270897
Issue OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 7, 2025
  2. changed the title [-]New Feature : Allow inviting new users in the `Add approval workflow` flow[/-] [+][$250] New Feature : Allow inviting new users in the `Add approval workflow` flow[/+] on May 7, 2025
  3. melvin-bot commented on May 7, 2025

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 7, 2025
  5. melvin-bot commented on May 7, 2025

    @melvin-bot

    Current assignee @JmillsExpensify is eligible for the NewFeature assigner, not assigning anyone new.

  6. melvin-bot commented on May 7, 2025

    @melvin-bot

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

  7. MobileMage commented on May 8, 2025

    @MobileMage
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-05-13 17:13:38 UTC.

    Proposal

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

    Users setting up an approval workflow couldn't invite new people directly from the "Expenses From" step if they weren't already workspace members. This forced a disruptive detour to the "Members" tab to invite them first.

    What is the root cause of that problem?

    1. The "Expenses From" page (WorkspaceWorkflowsApprovalsExpensesFromPage.tsx) lacked integrated search and invitation capabilities for non-workspace members.
    2. The selection of a new user (to be invited) as the "Expenses From" person wasn't persisted in the draft workflow before navigating to the invitation message screen. This caused the selection to be lost upon returning to the workflow.

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

    We integrated member search and invite functionality into the "Expenses From" page and adjusted the data flow:

    1. WorkspaceWorkflowsApprovalsExpensesFromPage.tsx:

      • Enhanced to search for existing contacts and new emails/phone numbers, displaying them as selectable options.
      • Crucially, in the nextStep function (when the user proceeds):
        • Persist Selection First: All selected members (existing and new invitees) are immediately saved to the Onyx draft approval workflow using setApprovalWorkflowMembers.
          // In nextStep callback:
          + const membersToSet: Member[] = selectedMembers.map(...); // map to Member type
          + setApprovalWorkflowMembers(membersToSet);
        • Identify & Prepare Invites: If any selected members are new, their details are prepared for invitation using setWorkspaceInviteMembersDraft.
          // Still in nextStep, after setApprovalWorkflowMembers:
          + const membersRequiringInvite = selectedMembers.filter(...); // find new users
          + if (membersRequiringInvite.length > 0) {
          +    const invitedEmailsToAccountIDs = membersRequiringInvite.reduce(...); // build ID map
          +    setWorkspaceInviteMembersDraft(route.params.policyID, invitedEmailsToAccountIDs);
          +    Navigation.navigate(ROUTES.WORKSPACE_INVITE_MESSAGE...);
          +    return;
          + }
        • Navigate: Users are then navigated either to the invite message page (if new members) or directly to the approver selection step.
    2. WorkspaceInviteMessagePage.tsx:

      • After successfully sending an invitation (via addMembersToWorkspace):
        • It now checks if the flow originated from the approval workflow setup (using route.params.backTo).
        • If so, it navigates the user directly to the next step in the workflow (approver selection page) instead of a generic page.
          // In sendInvitation, after addMembersToWorkspace and clearing drafts:
          + const isFromWorkflowsApprovalsFlow = (route.params.backTo as string)?.includes('workflows/approvals');
          + if (isFromWorkflowsApprovalsFlow) {
          +   Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS_APPROVALS_APPROVER.getRoute(route.params.policyID, 0));
          +   return;
          + }

    This ensures the "Expenses From" choice is always saved before any detours, and the user is seamlessly guided through the invitation and back to the workflow.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We can write an automated test that simulates the workflow approval process by mocking an empty workspace, searching for a non-existent member, and selecting them from the results. The test will verify that the navigation correctly proceeds to the invite message page, and after sending the invitation, confirms that the user is redirected to the approver selection page. This follows the testing patterns established in PolicyUtilsTest.ts, where we verify workspace-related functionality through similar state management and navigation verification.

    What alternative solutions did you explore? (Optional)

    None.

    Preview

    output.mp4
  8. bradyrose commented on May 8, 2025

    @bradyrose

    Withdrawing this proposal to comply with Expensify’s one-proposal-at-a-time policy.
    Hope to circle back if it’s still open later. Thanks!

  9. 214 remaining items

  10. hoangzinh commented on Jul 15, 2026

    @hoangzinh
    Contributor

    @JmillsExpensify feature is deployed to Prod. But we still have 2 follow-up issues #61625 (comment)

  11. JmillsExpensify commented on Jul 15, 2026

    @JmillsExpensify
    ContributorAuthor

    Nice. Given that those are documented separately, should we close this issue?

  12. hoangzinh commented on Jul 16, 2026

    @hoangzinh
    Contributor

    Given 1 of the follow-up issue has been closed. Another one is the BE issue. I think we're ready for payment, then close. Here is MelvinBot payment review #61625 (comment)

  13. melvin-bot commented on Jul 17, 2026

    @melvin-bot

    Current assignee @mallenexpensify is eligible for the Awaiting Payment assigner, not assigning anyone new.

  14. changed the title [-][$250] New Feature : Allow inviting new users in the `Add approval workflow` flow[/-] [+][Due for payment 2026-07-17] [$250] New Feature : Allow inviting new users in the `Add approval workflow` flow[/+] on Jul 17, 2026
  15. JmillsExpensify commented on Jul 17, 2026

    @JmillsExpensify
    ContributorAuthor

    Added the appropriate label.

  16. mallenexpensify commented on Jul 21, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @twilight2294 paid $250 via Upwork
    Contributor+: @hoangzinh due $250 via NewDot

    @hoangzinh what's @MobileMage due here? I see they're assigned. Paying $250 to you and @twilight2294 for sticking with this and getting it over the finish line.

  17. hoangzinh commented on Jul 21, 2026

    @hoangzinh
    Contributor

    @MobileMage was first assigned, but they were busy and couldn't push this to finish line #64727 (comment)

  18. laurenreidexpensify commented on Jul 23, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @hoangzinh

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 contributorNewFeatureSomething to build that is a new item.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions