Hide reports in the LHN having $0 total and in a submitted state#59588
Conversation
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari59588-web-chrome-001.mp4MacOS: Desktop59588-desktop-001.mp4Android: Native59588-android-hybrid-001.mp4Android: mWeb Chrome59588-mweb-chrome-001.mp4iOS: Native59588-ios-hybrid-001.mp4iOS: mWeb Safari59588-mweb-safari-001.mp4 |
|
@Beamanator Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Beamanator
left a comment
There was a problem hiding this comment.
So just to be clear, we want this to not show up for both submitter & approver & admins, each?
If a submitter has the expense report open, will it still not show up in their LHN? It should, i would think.
FYI this mayyyyyy stop happening in @MarioExpensify 's "auto-submit" project since in that proj we will attempt to not create any empty, submitted reports
Yes. We want to hide any report in a clearly invalid state meeting these criterias (which shouldn't happen):
A report in a submitted state with a $0 total and having only the If you still think this should be shown in the LHN, I can modify the check for the case when it's in a focused state.
Great to know! This will be handy 😄 |
tgolen
left a comment
There was a problem hiding this comment.
Is there a unit tests for the LHN that can be updated to cover this case?
I've added one here |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/tgolen in version: 9.1.24-2 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.24-10 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.24-10 🚀
|
|
@tgolen @lakchote Just noticed that payment is due here for C+ review as the implementation is already in production. |
|
|
||
| // Hide empty reports that have only a `CREATED` action, a total of 0, and are in a submitted state | ||
| // These reports should be hidden because they appear empty to users and there is nothing actionable for them to do | ||
| if (report?.total === 0 && report?.stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && report?.statusNum === CONST.REPORT.STATUS_NUM.SUBMITTED && hasOnlyCreatedAction) { |
There was a problem hiding this comment.
We don't want to hide an open report, even if it's empty. This caused a regression here: #67407 (comment)
Explanation of Change
Hide reports in the LHN having $0 total and in a submitted state.
Unfortunately, the issue at hand is hard to reproduce.
With these changes, a report that has
0astotaland is in a submitted state (like the report tied to our issue - see https://github.com/Expensify/Expensify/issues/486568#issuecomment-2770686693) we hide it in the LHN to not pollute it. It should fix our current issue.cc @tgolen
Video test
Screen.Recording.2025-04-03.at.16.49.11.mov
Fixed Issues
Related to #59405
A backend fix is necessary too to fix properly the issue see https://expensify.slack.com/archives/C05LX9D6E07/p1744042642175159?thread_ts=1743438767.995739&cid=C05LX9D6E07
Tests
Prerequisites: having two accounts (one admin, one member) on a workspace
QA Steps
Same as in tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-04-03.at.16.49.11.mov
MacOS: Desktop