Fix LHN flickers and scroll position restoring#55486
Fix LHN flickers and scroll position restoring#55486puneetlath merged 19 commits intoExpensify:mainfrom
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 😄 |
…/53605-lhn-flickers
…/53605-lhn-flickers
|
@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.
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.
The LHN. Working on it.
|
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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.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