perf: bottom bar switching and search#64995
Conversation
|
@rushatgabhane 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] |
|
cc @mountiny just a friendly ping if we could fast track this one 🙏🏻 |
|
yes, prioritizing this |
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
| const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true}); | ||
| const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false}); | ||
| const [accountID] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false, selector: (onyxSession) => onyxSession?.accountID}); |
There was a problem hiding this comment.
Did we get a 1s improvement in time to render?
The changes look good to me!
I'm wondering if we should make this as a recommendation to prefer selecting data if you need less than ~3 keys from an onyx object that changes a lot (eg: session, account)
There was a problem hiding this comment.
+1, lets make sure we capture these ideas and make them into best practices, better yet, custom eslint rules @adhorodyski
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2025-06-27.at.18.56.24.moviOS: mWeb SafariScreen.Recording.2025-06-27.at.18.39.40.movMacOS: Chrome / SafariScreen.Recording.2025-06-27.at.18.29.52.movScreen.Recording.2025-06-27.at.18.34.06.movMacOS: DesktopScreen.Recording.2025-06-27.at.18.51.48.mov |
mountiny
left a comment
There was a problem hiding this comment.
Thank you @martasudol this is really cool to see such improvement is done from such an innocent change
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
| const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true}); | ||
| const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false}); | ||
| const [accountID] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false, selector: (onyxSession) => onyxSession?.accountID}); |
There was a problem hiding this comment.
+1, lets make sure we capture these ideas and make them into best practices, better yet, custom eslint rules @adhorodyski
|
✋ 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: 9.1.72-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.72-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.72-10 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.73-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.73-0 🚀
|

Explanation of Change
These changes optimize performance of switching between bottom tabs and search action in
Reportstab.Fixed Issues
$#60007
Tests
Reportstab, click on search bar and type something. Also, everything should work the same way from the functional point of view.Offline tests
Same as Tests.
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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: mWeb Chrome
Nagranie.z.ekranu.2025-06-26.o.10.39.52.mov
iOS: Native
Nagranie.z.ekranu.2025-06-26.o.10.23.47.mov
iOS: mWeb Safari
Nagranie.z.ekranu.2025-06-26.o.10.27.46.mov
MacOS: Chrome / Safari
Nagranie.z.ekranu.2025-06-26.o.10.36.07.mov
MacOS: Desktop
Nagranie.z.ekranu.2025-06-26.o.10.36.55.mov