-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
perf: improve chat switch performance - fixed #38255
perf: improve chat switch performance - fixed #38255
Conversation
Merge pull request Expensify#32336 from callstack-internal/hur/perf/chat-switch perf: improve chat switch performance
C+ Reviewer: please refer to 3 commits on top of original PR for easy review |
as to why:
|
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-19.at.1.45.29.AM.movAndroid: mWeb ChromeScreen.Recording.2024-03-19.at.1.43.57.AM.moviOS: NativeScreen.Recording.2024-03-19.at.1.41.36.AM.moviOS: mWeb SafariScreen.Recording.2024-03-19.at.1.39.34.AM.movMacOS: Chrome / SafariScreen.Recording.2024-03-19.at.1.32.11.AM.movMacOS: DesktopScreen.Recording.2024-03-19.at.1.37.35.AM.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.
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.
Lets be on a look out for the regressions again!
✋ 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: 1.4.55-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.55-0 🚀
|
@@ -1,9 +1,8 @@ | |||
import {FlashList} from '@shopify/flash-list'; |
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.
@jbroma the changes in this file seems to have caused the issue below, only when a request is created offline
Screen.Recording.2024-03-20.at.20.22.43.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 specifically the removal of withCurrentReportID
HOC
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.
Actually it's the removal of currentReportID
from extraData
that's passed to FlashList
. But I get it's necessary so the whole LHN doesn't re-render when we switch focus from a report, right? so how do we fix this, any ideas?
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.
what if we pass currentReportID
in extraData
? 🤔 it won't rerender then right?
const extraData = useMemo(() =>
[reportActions, reports, policy, personalDetails, currentReportID],
[reportActions, reports, policy, personalDetails]);
I guess we can satisfy typescript dependency error by entering exception there right?
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.
but if we leave out from the dependencies it will remain stale, it won't be updated when we switch to another report, no?
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.
The useMemo gets triggered everytime we move from reports right?
Nope, it doesn't, only when those dependencies change and they don't when we're simply switching between reports.
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'll console.log itemFullReport
just to help you bebug more over here
App/src/components/LHNOptionsList/LHNOptionsList.tsx
Lines 52 to 54 in b306886
const renderItem = useCallback( | |
({item: reportID}: RenderItemProps): ReactElement => { | |
const itemFullReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`] ?? null; |
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.
umm makes more sense now:
(Unedited main branch) Added console log
simplescreenrecorder-2024-03-21_03.43.37.mp4
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 can't reproduce this anymore for some reason @GandalfGwaihir, can you?
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.
nvm I just reproduced it again
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.55-3 🚀
|
Details
Original PR got reverted because of issues with ghost draft comments, this PR brings backs the changes from the original PR, and fixes the related issues.
Please refer to original PR for more details.
Fixed Issues
$ #32793
PROPOSAL: #32336 (original PR)
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 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
output.mp4
MacOS: Desktop