-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Empty report chat view #59804
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
Empty report chat view #59804
Conversation
# Conflicts: # src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx # src/components/Search/index.tsx # src/components/SelectionList/Search/ReportListItem.tsx
I set the right and left padding to be the same as in the child (12 instead of 16 as in Figma). This is because we’re not using the new row component here yet — that will be done in a separate PR — and I wanted things to be aligned with the children. I explained more about it here. As for the top and bottom padding, I'm already working on the fixes. |
Sounds good, keep me posted! |
src/components/ReportActionItem/MoneyRequestReportPreview/EmptyRequestReport.tsx
Outdated
Show resolved
Hide resolved
src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
Outdated
Show resolved
Hide resolved
src/components/ReportActionItem/MoneyRequestReportPreview/EmptyRequestReport.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍 I only left minor comments and nitpicks
</View> | ||
<Button | ||
success | ||
text="PLACEHOLDER BUTTON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we need to update this text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so — after merging the header buttons, there will be a primary button here, and this is just a placeholder that I'll remove later.
import useTheme from '@hooks/useTheme'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
||
function EmptyRequestReport() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB but I wanted to propose a different name, reasons:
Report
has some special meaning and just plain word report means usually a full-screen report view, or report-data.- we shouldn't use the name
RequestReport
because there is no such thing. There isMoneyRequestReport
, but if we cut out the "money" part then it gets confusing
My suggestions:
EmptyMoneyRequestReportPreview
MoneyRequestReportPreviewSkeleton
EmptyReportPreview
or anything similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm already taking care of the changes
<DelegateNoAccessModal | ||
isNoDelegateAccessMenuVisible={isNoDelegateAccessMenuVisible} | ||
onClose={() => setIsNoDelegateAccessMenuVisible(false)} | ||
{transactions.length === 0 && <EmptyRequestReport />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nitpick, but since empty report preview is an important case, I suggest we extract the check to a const:
const shouldShowEmptyPlaceholder = transactions.length === 0
import type * as OnyxTypes from '@src/types/onyx'; | ||
import ActionCell from './ActionCell'; | ||
|
||
type MoneyReportHeaderProps<TItem extends ListItem> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this name is a mistake?
type MoneyReportHeaderProps<TItem extends ListItem> = { | |
type ReportListItemHeaderProps<TItem extends ListItem> = { |
src/libs/Permissions.ts
Outdated
@@ -51,7 +51,7 @@ function canUseCustomRules(betas: OnyxEntry<Beta[]>): boolean { | |||
} | |||
|
|||
function canUseTableReportView(betas: OnyxEntry<Beta[]>): boolean { | |||
return !!betas?.includes(CONST.BETAS.TABLE_REPORT_VIEW) || canUseAllBetas(betas); | |||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove me! :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch 🦉
@@ -11,6 +11,10 @@ export default { | |||
margin: 0, | |||
}, | |||
|
|||
m1: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to add this value for literally only a single new case of margins? I think we can come up with something better :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be useful in the future as well. We don’t have m1:4 defined anywhere, but this kind of spacing scale does appear sometimes in mockups. If we never add it to our spacing system, we’ll always end up hardcoding it directly in styled components. It seems quite reasonable to include it in the spacing scale. We also discussed this with @SzymczakJ during his review.
@@ -518,8 +518,7 @@ function getReportSections(data: OnyxTypes.SearchResults['data'], metadata: Onyx | |||
} | |||
} | |||
|
|||
// Filter out reports with no transactions to prevent the wrong number of the selected options | |||
return Object.values(reportIDToTransactions).filter((report) => report.transactions.length); | |||
return Object.values(reportIDToTransactions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh so many fond memories of many many hours spent catching these pesky reports without any transactions.
Remember @luacmartins? :D
I'm quite happy we're now making "empty" reports a first class citizen 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About time 😄
|
||
type CellProps = { | ||
showTooltip: boolean; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
type ReportCellProps = { | ||
reportItem: ReportListItemType; | ||
} & CellProps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need both CellProps
and ReportCellProps
- this is a leftover, can be simplified
@sumo-slonik don't forget to clean up changes to |
I reused the component responsible for the header that appears in the report preview header. I'll fix it so that it looks like in the mockups. |
Let us know when we're ready for a test build, eager to start testing this one out! |
# Conflicts: # src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx # src/components/SelectionList/Search/ReportListItem.tsx
Ready for a test build yet? |
I'm still working on the fixes for the report title — I should open the PR today and it should be ready for the test build.
Currently, I'm using the same logic for displaying avatars as in the report preview itself. I'm also adding some small changes to how the title is displayed. |
@sumo-slonik failed test |
Test failed after 360min, seems like a random CI bug or timeout and unrelated to code changes. |
For the breadcrumbs, I merged it coz' of trouble Carlos was having here: https://expensify.slack.com/archives/C07NMDKEFMH/p1746717739207839?thread_ts=1745948047.201979&cid=C07NMDKEFMH |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Dang Tommy's commit stats gonna go thru the roof now |
Performance Comparison Report 📊 (1/12)Significant Changes To Duration
Show details
|
Performance Comparison Report 📊 (10/12)Meaningless Changes To Duration (9/11)Show entries
Show details
|
Performance Comparison Report 📊 (11/12)Meaningless Changes To Duration (10/11)Show entries
Show details
|
Performance Comparison Report 📊 (12/12)Meaningless Changes To Duration (11/11)Show entries
Show details
|
Performance Comparison Report 📊 (2/12)Meaningless Changes To Duration (1/11)Show entries
Show details
|
Performance Comparison Report 📊 (3/12)Meaningless Changes To Duration (2/11)Show entries
Show details
|
Performance Comparison Report 📊 (4/12)Meaningless Changes To Duration (3/11)Show entries
Show details
|
Performance Comparison Report 📊 (5/12)Meaningless Changes To Duration (4/11)Show entries
Show details
|
Performance Comparison Report 📊 (6/12)Meaningless Changes To Duration (5/11)Show entries
Show details
|
Performance Comparison Report 📊 (7/12)Meaningless Changes To Duration (6/11)Show entries
Show details
|
Performance Comparison Report 📊 (8/12)Meaningless Changes To Duration (7/11)Show entries
Show details
|
Performance Comparison Report 📊 (9/12)Meaningless Changes To Duration (8/11)Show entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
![]() @sumo-slonik I am getting policy expense chat in results. Can you please look into this? |
@shubham1206agra can you list the steps to reproduce, please? Thanks! ![]() |
Sure
|
Explanation of Change
Fixed Issues
$ #59502
PROPOSAL:
Tests
Offline tests
Unnesesary
QA Steps
Same as test
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2025-04-08.at.16.14.54.mov
Android: mWeb Chrome
mobile.android.mov
iOS: Native
Screen.Recording.2025-04-08.at.15.29.23.mov
iOS: mWeb Safari
ios.mobile.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
Uploading desktop.mov…