-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add ReportHeaderSkeletonView to ReportScreen #30367
Add ReportHeaderSkeletonView to ReportScreen #30367
Conversation
@hayata-suenaga 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] |
@adamgrzybowski can you add the test steps please? |
@hayata-suenaga done! |
src/pages/home/ReportScreen.js
Outdated
@@ -214,6 +215,10 @@ function ReportScreen({ | |||
); | |||
} | |||
|
|||
if (reportID === '') { |
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 this condition is enough. While report data is loading, skeleton should also be displayed.
Please check this video:
Screen.Recording.2023-10-26.at.10.23.06.PM.mov
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 it's fine. we're showing old state while the report is being fetched
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.
@rushatgabhane as you see, there's a brief moment when header is empty but report shows skeleton
(around 00:06s)
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 point @situchan
@adamgrzybowski maybe we can add a check isLoading
Hey, thanks for the suggestion 🙇 It should work now |
@hayata-suenaga shall I continue review? |
@situchan yes please 🙇 |
@adamgrzybowski I am still seeing this case To easily reproduce, please logout and login on bad/slow network or HT account |
Comment for the assignment |
@WojtekBoman I apparently cannot assign you as a reviewer. Can you start reviewing on your part? |
@situchan Could you recheck it? Today I merged this branch with main and this bug didn't occur |
@WojtekBoman this is easily reproducible. please join any public room bug2.mov |
@situchan Could you check it with the last fix? |
I gonna review this after @situchan reviews 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.
src/pages/home/HeaderView.js
Outdated
@@ -172,12 +173,14 @@ function HeaderView(props) { | |||
const shouldShowBorderBottom = !isTaskReport || !props.isSmallScreenWidth; | |||
const shouldDisableDetailPage = ReportUtils.shouldDisableDetailPage(props.report); | |||
|
|||
const isLoading = !(props.report && title); |
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.
const isLoading = !(props.report && title); | |
const isLoading = !props.report || !title; |
Actually, there's no case of !props.report
. !title
should be enough condition
@@ -26,7 +26,7 @@ const defaultProps = { | |||
|
|||
function ReportHeaderSkeletonView(props) { | |||
return ( | |||
<View style={[styles.appContentHeader]}> | |||
<View style={[styles.appContentHeader, styles.borderBottom]}> |
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.
<View style={[styles.appContentHeader, styles.borderBottom]}> | |
<View style={[styles.appContentHeader]}> |
src/pages/home/HeaderView.js
Outdated
return ( | ||
<View | ||
style={[styles.appContentHeader, shouldShowBorderBottom && styles.borderBottom]} | ||
dataSet={{dragArea: true}} | ||
> | ||
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}> | ||
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && !isLoading && styles.pl5]}> | ||
{props.isSmallScreenWidth && ( |
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.
@hayata-suenaga I'd like to confirm that it's expected to do nothing when click back button inside skeleton header on mobile. That's original logic here: App/src/components/ReportHeaderSkeletonView.js Lines 31 to 40 in 2b4909d
As seen above, onPress callback does nothing |
src/pages/home/HeaderView.js
Outdated
@@ -175,96 +176,102 @@ function HeaderView(props) { | |||
const shouldShowBorderBottom = !isTaskReport || !props.isSmallScreenWidth; | |||
const shouldDisableDetailPage = ReportUtils.shouldDisableDetailPage(props.report); | |||
|
|||
const isLoading = !props.report || !title; | |||
|
|||
return ( | |||
<View | |||
style={[styles.appContentHeader, shouldShowBorderBottom && styles.borderBottom]} | |||
dataSet={{dragArea: true}} | |||
> | |||
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}> |
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.
Please retest after changes have been made
<View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}> | |
<View style={[styles.appContentHeaderTitle, !isLoading && !props.isSmallScreenWidth && styles.pl5]}> |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
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.
@hayata-suenaga all yours! |
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.
looks good to me 👍
✋ 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 production by https://github.com/luacmartins in version: 1.4.1-13 🚀
|
@@ -175,96 +176,102 @@ function HeaderView(props) { | |||
const shouldShowBorderBottom = !isTaskReport || !props.isSmallScreenWidth; | |||
const shouldDisableDetailPage = ReportUtils.shouldDisableDetailPage(props.report); | |||
|
|||
const isLoading = !props.report || !title; |
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.
We should have checked for report id as well since the report id is used in ReportScreen. Not doing so made the report content show a skeleton view while the header not.
Another reason is that when a user leave a thread we will only clear the report id. We should show the skeleton view in this case. Otherwise the header will show unwanted UI components (Coming from #34820)
Details
This PR fixes a regression described here https://expensify.slack.com/archives/C049HHMV9SM/p1698096936186419.
It's quite simple, so I'm only including screenshots for the web. Tag me if you think we need more.
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
MacOS: Desktop