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! |
| ); | ||
| } | ||
|
|
||
| if (reportID === '') { |
There was a problem hiding this comment.
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.
i think it's fine. we're showing old state while the report is being fetched
There was a problem hiding this comment.
@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.
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 |
| const shouldShowBorderBottom = !isTaskReport || !props.isSmallScreenWidth; | ||
| const shouldDisableDetailPage = ReportUtils.shouldDisableDetailPage(props.report); | ||
|
|
||
| const isLoading = !(props.report && title); |
There was a problem hiding this comment.
| const isLoading = !(props.report && title); | |
| const isLoading = !props.report || !title; |
Actually, there's no case of !props.report. !title should be enough condition
| function ReportHeaderSkeletonView(props) { | ||
| return ( | ||
| <View style={[styles.appContentHeader]}> | ||
| <View style={[styles.appContentHeader, styles.borderBottom]}> |
There was a problem hiding this comment.
| <View style={[styles.appContentHeader, styles.borderBottom]}> | |
| <View style={[styles.appContentHeader]}> |
| > | ||
| <View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}> | ||
| <View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && !isLoading && styles.pl5]}> | ||
| {props.isSmallScreenWidth && ( |
|
@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 |
| style={[styles.appContentHeader, shouldShowBorderBottom && styles.borderBottom]} | ||
| dataSet={{dragArea: true}} | ||
| > | ||
| <View style={[styles.appContentHeaderTitle, !props.isSmallScreenWidth && styles.pl5]}> |
There was a problem hiding this comment.
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 |
|
@hayata-suenaga all yours! |
hayata-suenaga
left a comment
There was a problem hiding this comment.
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 🚀
|
| const shouldShowBorderBottom = !isTaskReport || !props.isSmallScreenWidth; | ||
| const shouldDisableDetailPage = ReportUtils.shouldDisableDetailPage(props.report); | ||
|
|
||
| const isLoading = !props.report || !title; |
There was a problem hiding this comment.
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
MacOS: Desktop