fix: show existing reports while loading#25159
fix: show existing reports while loading#25159aldo-expensify merged 19 commits intoExpensify:mainfrom
Conversation
|
@narefyev91 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] |
|
Sorry @s-alves10 that this process has not been very smooth, I have been caught in higher priority issues without being able to give this proper time I tested your PR for
and seems to be fixing both. Can you update with and resolve conflicts so we can give review this and continue? 🙏 |
|
Conflicts were removed. Please check |
|
@s-alves10 thanks! @narefyev91 can you review and complete checklist 🙏 ? |
| const reportIDsRef = useRef(null); | ||
| const isLoading = SessionUtils.didUserLogInDuringSession() && isLoadingReportData; | ||
| const optionListItems = useMemo(() => { | ||
| const reportIDs = SidebarUtils.getOrderedReportIDs(currentReportID, chatReports, betas, policies, priorityMode, allReportActions); | ||
| if (deepEqual(reportIDsRef.current, reportIDs)) { | ||
| return reportIDsRef.current; | ||
| } | ||
| reportIDsRef.current = reportIDs; | ||
| return reportIDs; | ||
| }, [allReportActions, betas, chatReports, currentReportID, policies, priorityMode]); | ||
|
|
||
| const isLoading = SessionUtils.didUserLogInDuringSession() && isLoadingReportData; | ||
| if (isLoading && !reportIDsRef.current && !currentReportID) { | ||
| reportIDsRef.current = reportIDs; | ||
| } | ||
| if (!isLoading) { | ||
| reportIDsRef.current = reportIDs; | ||
| } | ||
| return reportIDsRef.current || []; | ||
| }, [allReportActions, betas, chatReports, currentReportID, policies, priorityMode, isLoading]); |
There was a problem hiding this comment.
@s-alves10 can you add some comments trying to say why we using this ref and notes on each of the cases you have there?
It is just not very easy to understand why we have this complexity
|
Tested: still fixing the issues after conflicts resolved Screen.Recording.2023-08-24.at.3.05.30.PM.mov |
| }; | ||
|
|
||
| const defaultProps = { | ||
| style: [styles.flex1], |
There was a problem hiding this comment.
you can just use style: {styles.flex1}
|
@s-alves10 can you please sync you fork and branch with latest main |
|
Interesting that on latest main and changes from you branch - i get this one web - @s-alves10 can you check that code is still working? web.mov |
What's wrong with that? I think it's working fine |
Hmm should it not show current opened chat at the top? during loading? |
|
Please let me know the expected behavior. Did I misunderstand #23735? |
I think it is just not explicitly said, but I think the expected should be the same for mobile and desktop/web. I don't see why we should have different behaviour. The expected behaviour is: Show the loaded report + skeleton until we have loaded all reports. |
Please take a look |
|
@s-alves10 you got conflicts :( |
| }, [allReportActions, betas, chatReports, currentReportID, policies, priorityMode]); | ||
|
|
||
| const isLoading = SessionUtils.didUserLogInDuringSession() && isLoadingReportData; | ||
| // We need to update existing reports only once while loading because they are updated several times during loading and causes this reguression: https://github.com/Expensify/App/issues/24596#issuecomment-1681679531 |
There was a problem hiding this comment.
| // We need to update existing reports only once while loading because they are updated several times during loading and causes this reguression: https://github.com/Expensify/App/issues/24596#issuecomment-1681679531 | |
| // We need to update existing reports only once while loading because they are updated several times during loading and causes this regression: https://github.com/Expensify/App/issues/24596#issuecomment-1681679531 |
src/pages/iou/WaypointEditor.js
Outdated
| /** Recent waypoints array */ | ||
| recentWaypoints: PropTypes.arrayOf(PropTypes.object), | ||
|
|
There was a problem hiding this comment.
Bad conflicts resolution?
There was a problem hiding this comment.
It was the source of lint error. I resolved the conflicts
There was a problem hiding this comment.
Will you take a look again?
| if ((isLoading && !reportIDsRef.current) || (_.isEmpty(reportIDsRef.current) && currentReportID)) { | ||
| reportIDsRef.current = reportIDs; | ||
| } | ||
| if (!isLoading) { |
There was a problem hiding this comment.
i think you can move this to 78 line too like if (long condition || !isLoading)
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid-web.movMobile Web - Safariios-web.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
narefyev91
left a comment
There was a problem hiding this comment.
LGTM! Now we have fully consistency between all platforms
🎀 👀 🎀 C+ reviewed
|
Thanks! |
|
✋ 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/aldo-expensify in version: 1.3.59-0 🚀
|
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 1.3.60-0 🚀
|
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 1.3.60-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.59-5 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.60-3 🚀
|
Details
Show existing reports in LHN while loading all reports
Fixed Issues
$ #24596
PROPOSAL: #24596 (comment)
Tests
Offline tests
This can't be tested in offline mode
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 */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)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
Web
24596_mac_chrome.mp4
Mobile Web - Chrome
24596_android_chrome.mp4
Mobile Web - Safari
24596_ios_safari.mp4
Desktop
24596_mac_desktop.mp4
iOS
24596_ios_native.mp4
Android
24596_android_native.mp4