-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Refactor table view report loading state #62363
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
Refactor table view report loading state #62363
Conversation
@DylanDylann 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] |
@SzymczakJ I also wanted to confirm, will these changes prevent the bug we have where we quickly see the report empty state folder illustration? For example, this shouldn't be happening but it currently does on staging: CleanShot.2025-05-20.at.15.35.29.mp4 |
🚧 @trjExpensify has triggered a test app build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
@mountiny did you imply this issue and this PR is fixing that, or is that just for transaction thread reports? 🤔 |
It might help with this case too but hard to say without testing them both together |
src/components/MoneyReportHeader.tsx
Outdated
@@ -280,7 +281,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea | |||
const isSubmitterSameAsNextApprover = isReportOwner(moneyRequestReport) && nextApproverAccountID === moneyRequestReport?.ownerAccountID; | |||
const optimisticNextStep = isSubmitterSameAsNextApprover && policy?.preventSelfApproval ? buildOptimisticNextStepForPreventSelfApprovalsEnabled() : nextStep; | |||
|
|||
const shouldShowNextStep = isFromPaidPolicy && !!optimisticNextStep?.message?.length && !shouldShowStatusBar; | |||
const shouldShowNextStep = isFromPaidPolicy && !shouldShowStatusBar; |
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.
@SzymczakJ shouldShowNextStep is also used for isMoreContentShown and shouldAddGapToContents. Does this change impact on it?
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, from what I know(this knowledge comes from @trjExpensify) we are always showing the next steps in expense Reports(this kind of reports always has MoneyReportHeader
) and never(at least for now) for the invoice reports(this is the only other report type that uses MoneyReportHeader
).
I've added !isInvoiceReport
check to reflect it.
So when the shouldShowNextStep
is true, the isMoreContentShown
is also true, and "more content" is either skeleton or real next steps and we don't need to worry about optimisticNextStep?.message?.length.
src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
entering={FadeIn} | ||
exiting={FadeOut} | ||
> | ||
{hasComments || isLoadingReportActions ? translate('common.comments') : ''} |
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.
Why do we need to hasComments condition?
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.
Previously, we didn't show the comments string when there were no comments, so this condition comes from the past.
@shawnborton I think this bug will be handled here |
Ah that's great to hear, cc @martasudol to confirm! |
#62276 merged so we could retest once main is merged here too |
🚧 @mountiny has triggered a test app build. You can view the workflow run here. |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
@SzymczakJ Could you please remove
Ref: #62276 (comment) |
The rest seems fine |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-05-22.at.12.28.53.movAndroid: mWeb ChromeScreen.Recording.2025-05-22.at.12.27.30.moviOS: HybridAppScreen.Recording.2025-05-22.at.12.31.20.moviOS: mWeb SafariScreen.Recording.2025-05-22.at.12.30.36.movMacOS: Chrome / SafariScreen.Recording.2025-05-22.at.12.24.12.movMacOS: DesktopScreen.Recording.2025-05-22.at.12.25.47.mov |
All the PR comments fixed @DylanDylann |
@SzymczakJ Failed test, please |
544351d
to
c554e97
Compare
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.
LGTM
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.
2 small things
</SkeletonViewContentLoader> | ||
</View> | ||
); | ||
} |
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.
displayName
<ReportActionsSkeletonView possibleVisibleContentItems={3} /> | ||
</Animated.View> | ||
); | ||
} |
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.
Display name
✋ 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/mountiny in version: 9.1.51-0 🚀
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.1.51-6 🚀
|
Explanation of Change
This PR adds loading skeleton for Next steps and Report Actions in ReportScreen and SearchMoneyRequestReportPage
Fixed Issues
$ #62198
PROPOSAL:
Tests
Go to report that hasn't been accessed in a long time(you can also clear onyx data to achieve that) and make sure that the loading skeleton hasn't changed:

Go to report that is already loaded(and it's transactions) and it's report actions hasn't been loaded yet, make sure that loading skeleton for report actions is shown.

Make sure that the above loading state doesn't flash too often(once every 2 seconds is often) and lookout for "jumpy" UI.
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectioncanBeMissing
param foruseOnyx
toggleReport
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
loading.od.zero.mov
same.report.akcje.mov
tylko.3.rzedy.wytlumaczenie.mov
MacOS: Desktop