Skip to content

[$250] Reports - On removing expense, "to" field briefly appears and disappears in reports page. #62558

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

Open
3 of 8 tasks
jponikarchuk opened this issue May 22, 2025 · 13 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@jponikarchuk
Copy link

jponikarchuk commented May 22, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: V9.1.49-4
Reproducible in staging?: Yes
Reproducible in production?: Unable to check, new feature
If this was caught during regression testing, add the test name, ID and link from TestRail: N
Email or phone of affected tester (no customers): Applausetester [email protected]
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13 phone
App Component: User Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Login with new expensifail account
  3. Tap fab - create a new workspace
  4. Create a manual expense entering merchant
  5. Create another workspace
  6. Create a manual expense entering merchant
  7. Go to profile and set a display name
  8. Go to reports
  9. Select all expenses and "move expense" to first report
  10. Again select all expenses and "move expense" to second report

Expected Result:

On re-moving expense, "to" field must not briefly appear and disappear in reports page.

Actual Result:

On re-moving expense, "to" field briefly appears and disappears in reports page.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021925532511970505418
  • Upwork Job ID: 1925532511970505418
  • Last Price Increase: 2025-05-22
Issue OwnerCurrent Issue Owner: @
@jponikarchuk jponikarchuk added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added the Daily KSv2 label May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

Triggered auto assignment to @pecanoro (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented May 22, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 22, 2025
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@JoshIri360
Copy link
Contributor

Proposal

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

When re-moving an expense between reports, the "to" field (recipient information) briefly appears and then disappears on the reports page, creating a flickering effect.

What is the root cause of that problem?

The root cause was that the logic for displaying the recipient information in the ExpenseItemHeaderNarrow component did not correctly account for scenarios where the "from" and "to" participants of an expense movement are the same. The UI would momentarily try to display recipient details even when the expense was essentially being moved by the same user, causing the brief appearance and disappearance of the "to" field.

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

To solve this, we introduced a new utility function shouldShowRecipientForExpenseMovement in IOUUtils.ts. This function checks if the accountID of the participantFrom and participantTo are different.

In ExpenseItemHeaderNarrow.tsx, we now use this function in conjunction with isCorrectSearchUserName to determine shouldDisplayArrowIcon. This flag now correctly controls whether the recipient information (the "to" field) and the connecting arrow icon are displayed. Specifically, the "to" field and arrow are only shown if the "from" and "to" participants are different individuals.

Additionally, the shouldShowToRecipient prop for UserInfoCellsWithArrow is now directly tied to the shouldDisplayArrowIcon state, ensuring consistency.

This separates business logic from presentation and ensures consistent behavior across the application.

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

N/A

What alternative solutions did you explore?

N/A

@pecanoro pecanoro added External Added to denote the issue can be worked on by a contributor Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment labels May 22, 2025
@melvin-bot melvin-bot bot changed the title Reports - On removing expense, "to" field briefly appears and disappears in reports page. [$250] Reports - On removing expense, "to" field briefly appears and disappears in reports page. May 22, 2025
@pecanoro pecanoro removed the Hourly KSv2 label May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021925532511970505418

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 22, 2025
Copy link

melvin-bot bot commented May 22, 2025

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

@pecanoro
Copy link
Contributor

Demoting since it's a minor visual glitch

@bernhardoj
Copy link
Contributor

Proposal

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

To field is shown briefly when moving expense.

What is the root cause of that problem?

I can't perform the exact test step as QA because move report is not allowed between workspaces. I can repro it by having 2 report in the same workspace chat, with 1 report is empty. When we create a new money request, shouldShowBlankTo is true because the report state is still OPEN, so "To" field will be empty..

const shouldShowBlankTo = isOpenExpenseReport(report);
const policy = data[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];
const from = data.personalDetailsList?.[transactionItem.accountID];
const to = transactionItem.managerID && !shouldShowBlankTo ? data.personalDetailsList?.[transactionItem.managerID] : emptyPersonalDetails;

But after moving the expense to the empty report, shouldShowBlankTo becomes false. It's because the report is undefined. The empty report isn't included on the search result data. Only after the BE response, we get the data.

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

We can return true for shouldShowBlankTo if report is undefined.

const shouldShowBlankTo = !report || isOpenExpenseReport(report);

(if report is undefined, then we can't know if we should show "To" or not, so it's better to not show it)

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

N/A

@melvin-bot melvin-bot bot added the Overdue label May 25, 2025
@pecanoro
Copy link
Contributor

@ishpaul777 Did you have a moment to review the proposals?

@ishpaul777
Copy link
Contributor

Sure @pecanoro i'll review in 1 hour

@melvin-bot melvin-bot bot removed the Overdue label May 26, 2025
@ishpaul777
Copy link
Contributor

i could not reproduce the issue with steps from QA but from steps in @bernhardoj, when moving expense the in same workspace chat to new empty report, "->" briefly appears, @bernhardoj proposal fixes that and looks good to me

video

before after
Screen.Recording.2025-05-26.at.7.54.08.PM.mov
Screen.Recording.2025-05-26.at.7.58.17.PM.mov

🎀 👀 🎀

Copy link

melvin-bot bot commented May 26, 2025

Current assignee @pecanoro is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants