Skip to content

[Report Creation UI] Expense - No expense report preview when open report is empty #59702

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
8 tasks done
IuliiaHerets opened this issue Apr 5, 2025 · 18 comments
Closed
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Apr 5, 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: 9.1.23-6
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

Precondition:
Log in to the Expensifail account; the account doesn't have a WS.

  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Open FAB.
  4. Click Create report.
  5. Go to workspace chat.

Expected Result:

The open report with no expense will have a preview.

Actual Result:

The open report with no expense does not have preview at all. It is displayed as an empty message.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6793622_1743870580534.20250406_002649.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021909341283890063579
  • Upwork Job ID: 1909341283890063579
  • Last Price Increase: 2025-04-07
  • Automatic offers:
    • DylanDylann | Reviewer | 106832194
Issue OwnerCurrent Issue Owner: @akinwale
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Apr 5, 2025
Copy link

melvin-bot bot commented Apr 5, 2025

Triggered auto assignment to @lydiabarclay (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.

@ahmdshrif
Copy link
Contributor

Proposal

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

When a user creates a new expense report in the Expensify app but hasn't added any transactions yet, the Money Request Report Preview component displays an empty state without any visual feedback or guidance. This creates a confusing user experience as users may not understand whether the component is working correctly or if they need to take additional actions. Currently, the rendering condition checks for transactions.length > 0, which doesn't properly handle the empty state scenario.

What is the root cause of that problem?

The root cause is in the MoneyRequestReportPreviewContent.tsx file where the component's rendering logic only considers if transactions exist (transactions.length > 0) but doesn't provide an alternative view when transactions are absent. The component immediately returns without rendering anything meaningful when there are no transactions. Additionally, the localized string for indicating "No expenses yet" is missing from the language files.

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

  1. Modify the initial rendering condition in MoneyRequestReportPreviewContent.tsx from transactions.length > 0 to transactions.length >= 0 so the component always renders.
  2. Add a conditional rendering block inside the component that:
    • Shows the transaction list when transactions exist
    • Shows a placeholder with "No expenses yet" message when transactions are empty
  3. Add a new localized string iou.noExpensesYet with the value "No expenses yet" to the en.ts and es.ts files under the existing iou section.
  4. Style the placeholder to match the design language of the application

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

  1. Test rendering the component with an empty transactions array and verify the "No expenses yet" message appears.
  2. Test rendering the component with transactions and verify the transaction list appears correctly.
  3. Test that the component handles undefined/null transaction data gracefully.

What alternative solutions did you explore? (Optional)

@ahmdshrif
Copy link
Contributor

Before Fix After Fix
Before After

@lydiabarclay
Copy link

@dannymcclain question: when we're adding a whole new design element here (as it seems to me, I could be wrong) - is it best practice to get design's opinion before pr?

@lydiabarclay lydiabarclay added the External Added to denote the issue can be worked on by a contributor label Apr 7, 2025
@melvin-bot melvin-bot bot changed the title Expense - No expense report preview when open report is empty [$250] Expense - No expense report preview when open report is empty Apr 7, 2025
Copy link

melvin-bot bot commented Apr 7, 2025

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

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

melvin-bot bot commented Apr 7, 2025

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

@dannymcclain
Copy link
Contributor

@lydiabarclay yeah always feel free to tag the design team: @Expensify/design and we'll check it out as soon as we can!

@lydiabarclay
Copy link

@Expensify/design could y'all take a look at that new element proposal in the screenshots above? Ty!

@daledah
Copy link
Contributor

daledah commented Apr 7, 2025

Proposal

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

The open report with no expense does not have preview at all. It is displayed as an empty message.

What is the root cause of that problem?

We are not covering the case of no transaction in the MoneyRequestReportPreview component

<MoneyRequestReportPreview
// eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style
iouReportID={getIOUReportIDFromReportActionPreview(action) as string}
policyID={report?.policyID}
chatReportID={reportID}
action={action}
contextMenuAnchor={popoverAnchorRef.current}
isHovered={hovered}
isWhisper={isWhisper}
checkIfContextMenuActive={toggleContextMenuFromActiveReportAction}
onPaymentOptionsShow={() => setIsPaymentMethodPopoverActive(true)}
onPaymentOptionsHide={() => setIsPaymentMethodPopoverActive(false)}
/>

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

In case there is no expense then we will use `ReportPreview to render it by updating this condition

    else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && canUseTableReportView && action?.childMoneyRequestCount > 0)

} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && canUseTableReportView) {

Image

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

None

What alternative solutions did you explore? (Optional)

NA

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@dubielzyk-expensify
Copy link
Contributor

I thought we wanted the empty state to look like this? I'm sure @shawnborton knows the correct mock.

Image

@shawnborton
Copy link
Contributor

Yeah, we're currently working on implementing the empty state, so we can probably close this one out.

@shawnborton
Copy link
Contributor

Internal Slack link here - we can follow along there I think for updates, as I don't think we have a PR up for it quite yet.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 8, 2025
Copy link

melvin-bot bot commented Apr 8, 2025

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Apr 8, 2025

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mountiny mountiny moved this to Second Cohort - CRITICAL in [#whatsnext] #migrate Apr 8, 2025
@mountiny mountiny changed the title [$250] Expense - No expense report preview when open report is empty [Report Creation UI] Expense - No expense report preview when open report is empty Apr 8, 2025
@mountiny
Copy link
Contributor

mountiny commented Apr 8, 2025

Added it to the correct project and @sumo-slonik is working on that with dedicated c+

@sumo-slonik do you have an update about this one

@sumo-slonik
Copy link
Contributor

sumo-slonik commented Apr 8, 2025

Draft PR is ready, I am now working on fixing minor bugs

@dannymcclain
Copy link
Contributor

Thanks design team! I was thinking we probably already had this case covered but wasn't sure where it was at.

@lydiabarclay
Copy link

Thank everyone, I'll close this one.

@github-project-automation github-project-automation bot moved this from Second Cohort - CRITICAL to Done in [#whatsnext] #migrate Apr 8, 2025
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 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests