Skip to content

[Due for payment 2025-03-05] [Due for payment 2025-02-18] [HOLD for payment 2025-02-04] Tweaks to the Create Expense Flow #52981

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

Closed
trjExpensify opened this issue Nov 22, 2024 · 81 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production NewFeature Something to build that is a new item. Weekly KSv2

Comments

@trjExpensify
Copy link
Contributor

trjExpensify commented Nov 22, 2024

Coming from here.

Background: We're experimenting with an A/B test of a combined "Create expense" flow to see if we improve the decision juncture between "Submit expense" and "Track expense" out the gate. We've seen in Fullstory that submitters are still getting wrong-footed on this page choosing the "Just track it (don't submit it!)" option row. All the while, the workspace settings actually determine whether an expense created is submitted on creation, or if it’s added to a draft report to be submitted later, either manually or automatically with scheduled submit.

Problem: When submitters choose the "Just track it (don't submit it!)" on this page, they end up creating non-reimbursable expenses in the selfDM, which leads to confusion and having no recourse to getting paid back.

Solution: Let's make a couple of tweaks to the Create expense flow, as follows:

Participant selector screen

  • Title it "Choose recipient"
  • Remove the "Just track it (don't submit it)" option row
  • Add a section for "Workspaces" at the top (if you're a member of a workspace). Your primary workspace should be in the top position. That should be followed by a section for "Personal", which has your selfDM. Then followed by the existing "Recents" (if you have any that aren't already above in workspaces/selfDM) and "Contacts" sections.

Confirmation page screen

  • Title it "Confirm details"
  • Update the confirmation button to read: "Create $amount expense"

image

CC: @danielrvidal @JmillsExpensify @Expensify/design

New addition from @dubielzyk-expensify to add as a follow-up

In the participant selector, switch out the second line of each workspace row (which currently reads Workspace) to be the displayName of the approver ("submitsTo") instead. Use the primaryLogin as a fallback if no displayName is set.

image
Issue OwnerCurrent Issue Owner: @trjExpensify
Copy link

melvin-bot bot commented Nov 22, 2024

Triggered auto assignment to @alexpensify (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 22, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Nov 23, 2024

Edited by proposal-police: This proposal was edited at 2024-11-23 15:51:56 UTC.

Proposal

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

Tweaks to the Create Expense Flow

What is the root cause of that problem?

New feature

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

  1. Create a new translation for Choose recipient and Confirm details

  2. Participant selector screen

Title it "Choose recipient"

  • Change headerTitle to Choose recipient or only change to it on the default case and the if action === CONST.IOU.ACTION.SUBMIT

const headerTitle = useMemo(() => {

Remove the "Just track it (don't submit it)" option row

  • Remove shouldDisplayTrackExpenseButton and onTrackExpensePress props in MoneyRequestParticipantsSelector and all variables and functions related with these props

onTrackExpensePress={trackExpense}
iouType={iouType}
action={action}
shouldDisplayTrackExpenseButton={shouldDisplayTrackExpenseButton}

Add a section for "Workspaces" at the top (if you're a member of a workspace). Your primary workspace should be in the top position. That should be followed by a section for "Personal", which has your selfDM. Then followed by the existing "Recents" (if you have any that aren't already above in workspaces/selfDM) and "Contacts" sections.

  • Introduce two new params in getOptions and getFilteredOptions function shouldSeparateSelfDMChat, shouldSeparateWorkspaceChat. The default value is false. In getOptions, if it's true we will return recent workspace chats/selfDM chats in a separate variable

    • Pass two params above as true here
  • Update filterOptions to implement the splice and search logic for recentWorkspaceChats like recentReports

function filterOptions(options: Options, searchInputValue: string, config?: FilterOptionsConfig): Options {

  • Merge recentWorkspaceChats and recentReports options when we call formatSectionsFromSearchTerm here or we can introduce a new param recentWorkspaceChats in this function

const formatResults = OptionsListUtils.formatSectionsFromSearchTerm(
debouncedSearchTerm,
participants.map((participant) => ({...participant, reportID: participant.reportID ?? '-1'})),
chatOptions.recentReports,
chatOptions.personalDetails,
personalDetails,

  • Add a workspace section from recentWorkspaceChats and personal section from selfDMChat above the recent section here

  • Pick isSelfDM field here, and if isSelfDM is true we will not call onFinish function.
  • In this function we will call trackExpense function if the first option is selfDM
const firstParticipant = val.at(0);

         if (firstParticipant?.isSelfDM) {
             trackExpense();
             return;
         }

const addParticipant = useCallback(

  1. Confirmation page screen

Title it "Confirm details"

  • Change the headerTitle to Confirm details or only do it in the case Track/submit expense

const headerTitle = useMemo(() => {

Update the confirmation button to read: "Create $amount expense"

  • Create a new translation for Create ${amount} expense and use this translation here and here

Optional: For changing the title and the submit button, we can only do this if canUseCombinedTrackSubmit is true

What alternative solutions did you explore? (Optional)

Result

Screen.Recording.2024-11-23.at.22.46.08.mov

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 23, 2024
@grgia
Copy link
Contributor

grgia commented Nov 25, 2024

I reached out to Fábio about taking this 💬

@trjExpensify trjExpensify added the Planning Changes still in the thought process label Nov 25, 2024
@trjExpensify trjExpensify changed the title Tweaks to the Create Expense Flow [Hold] Tweaks to the Create Expense Flow Nov 25, 2024
@trjExpensify
Copy link
Contributor Author

Popped on planning for a sec, discussing here.

@melvin-bot melvin-bot bot added the Overdue label Nov 28, 2024
@trjExpensify
Copy link
Contributor Author

No change, thread likely picked up next week at this point.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 28, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

@trjExpensify, @grgia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@trjExpensify
Copy link
Contributor Author

Anu is back today, bumped the thread.

@melvin-bot melvin-bot bot removed the Overdue label Dec 3, 2024
@JmillsExpensify
Copy link

Nice, I'd like to get this one moving again. I'm still concerned that the original Create Expense test isn't testing what we need to test (e.g. whether they would like to submit now or later, which is different than whether they don't want to submit to anyone. ever).

@grgia
Copy link
Contributor

grgia commented Dec 3, 2024

@JmillsExpensify @trjExpensify could you ping me when this is ready to be picked up again by an engineer

@trjExpensify
Copy link
Contributor Author

Yep, will do.

@grgia grgia changed the title [Hold] Tweaks to the Create Expense Flow Tweaks to the Create Expense Flow Dec 4, 2024
@JKobrynski
Copy link
Contributor

Hi, I'm Julian from Callstack - expert agency - and I would like to work on this issue.

Copy link

melvin-bot bot commented Feb 11, 2025

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@JKobrynski] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

Copy link

melvin-bot bot commented Feb 18, 2025

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

@mananjadhav
Copy link
Collaborator

Just adding for tracking: There are 3 payments pending on this one for the PR reviews done. 2 PRs linked in this issue and 1 from here

@mananjadhav
Copy link
Collaborator

mananjadhav commented Feb 18, 2025

There was one related issue #55661 (comment) which we decided not to treat as regression and include in the original scope.

There's this one edge case #56507 left out related to the subtitle change. This can be treated as regression to the subtitle PR #55863.

@trjExpensify
Copy link
Contributor Author

Okay cool, so that's $625 total due then, right?

@trjExpensify
Copy link
Contributor Author

trjExpensify commented Feb 19, 2025

Payment summary as follows:

Go ahead and request! I've created a regression test request for the submitsTo subtitle inclusion. Thanks!

@github-project-automation github-project-automation bot moved this from Second Cohort - HIGH to Done in [#whatsnext] #migrate Feb 19, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in [#whatsnext] #convert Feb 19, 2025
@mananjadhav
Copy link
Collaborator

mananjadhav commented Feb 19, 2025

Thanks for the summary @trjExpensify. I was going to request if we could pay this in full.

The regression case was a very edge case and though surfaced with the PR, but it's because the Options list doesn't refresh. Hence, I didn't have a way to compare it with the production behavior too.

@trjExpensify
Copy link
Contributor Author

Oh right, then I misinterpreted you here:

There's this one edge case #56507 left out related to the subtitle change. This can be treated as regression to the subtitle PR #55863.

@grgia what do you think about the below wrt to the regression?

The regression case was a very edge case and thought surfaced with the PR, but it's because the Options list doesn't refresh. Hence, I didn't have a way to compare it with the production behavior too.

@mananjadhav
Copy link
Collaborator

Yeah I didn't think about it while writing the comment. I realized when I was reviewing the PR.

@mananjadhav
Copy link
Collaborator

@grgia Can you please check the previous conversations?

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Feb 26, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-02-18] [HOLD for payment 2025-02-04] Tweaks to the Create Expense Flow [Due for payment 2025-03-05] [Due for payment 2025-02-18] [HOLD for payment 2025-02-04] Tweaks to the Create Expense Flow Feb 26, 2025
Copy link

melvin-bot bot commented Feb 26, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 26, 2025
Copy link

melvin-bot bot commented Feb 26, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.5-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-03-05. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Feb 26, 2025

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@grgia
Copy link
Contributor

grgia commented Feb 26, 2025

@trjExpensify I agree with @mananjadhav

@trjExpensify
Copy link
Contributor Author

#52981 (comment) - cool amended payment summary to $750.

@garrettmknight
Copy link
Contributor

$750 approved for @mananjadhav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production NewFeature Something to build that is a new item. Weekly KSv2
Projects
Development

No branches or pull requests

9 participants