-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix LHN flickers and scroll position restoring #55486
Fix LHN flickers and scroll position restoring #55486
Conversation
@rezkiy37 It looks pretty cool so far. Can you resolve the linting and mark this as ready for review? |
@hungvu193, hi! |
Yes. You got assigned to the issue already. Please go ahead 😄 |
@hungvu193 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] |
@rezkiy37 on mWeb Chrome, there's an empty view display for a while before LHN displays. It looks like it display the first index of LHN first then scroll to the current position. Screen.Recording.2025-01-24.at.10.10.42.mov |
It happens also on Desktop and Chrome Screen.Recording.2025-01-24.at.10.29.45.mov |
…/53605-lhn-flickers
@hungvu193, I am thinking about the next fix for web-based platforms. The app uses the
What if apply Moreover, the current behavior does not restore the position at all. So the user has to do it manually. Video
Example.mp4WDYT? |
It looks weird to me 😄. I think that's fine to keep current behavior on web (stay at top) if we can't fix the empty issue. Screen.Recording.2025-01-26.at.00.28.01.mov |
@hungvu193, well. I will apply the current changes for native platforms only for now. Also, I can work on a follow-up to find a web solution. |
Thank you 😁 |
@hungvu193, done 🙂 Video
Web.mp4IOS.mp4 |
Ty. Look good to me. I'll complete the checklist today 🤞 |
…/53605-lhn-flickers
I've synced it up. |
import variables from '@styles/variables'; | ||
import type UseEstimatedListSize from './types'; | ||
|
||
const useEstimatedListSize: UseEstimatedListSize = () => { |
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 list is this referring to? The LHN? Or any list?
Also, can we add some comments explaining what this is and when one might use 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.
The LHN. Working 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.
Also, are there any tests we can add related to this change? |
No, I don't think so. |
…/53605-lhn-flickers
I've run the Reassure test 3 times and it has failed every time. Can you look into it further @rezkiy37 |
@puneetlath, I just needed to mock the newly added hook in the test file. It works properly now. The tests have been passed. It is ready to merge 🙂 |
🚀 Deployed to staging by https://github.com/puneetlath in version: 9.0.94-0 🚀
|
This PR is failing because of issue #56323 |
@IuliiaHerets, this PR is not failing on the web because it fixes only native platforms. |
@rezkiy37 Ok, thanks for letting me know |
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.94-25 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.94-25 🚀
|
Explanation of Change
The PR enhances LHN (FlashList) performance. Especially when the user switches between tabs. It allows FlashList to avoid auto-measuring by setting the static estimated list size.
Fixed Issues
$ #53605
PROPOSAL: #53605 (comment)
Tests
Offline tests
Same as "Tests".
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as "Tests".
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
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.mp4
Android: mWeb Chrome
Android.Chrome.mp4
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.Safari.mp4
MacOS: Chrome / Safari
Chrome.mp4
MacOS: Desktop
Desktop.mp4