Repository navigation
perf: stop Inbox rows re-rendering when a right-hand panel opens - #106735
BartekObudzinski wants to merge 1 commit into
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@aimane-chnaif 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] |
|
@MelvinBot test |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🤖 Web test steps verification results: Dev NewDot web coverage was blocked by the available fixture and automation limitations. Native gestures and performance were not tested; failed checks below indicate incomplete verification, not confirmed product defects.
|

Explanation of Change
LHNTooltipContextProviderputuseIsFocused()and a root navigation flag in the same context value that every Inbox row reads. Opening an RHP, such as Create expense, takes focus away from the Inbox. The value changed, so every visible row re-rendered together with everything under it, even though the Inbox is hidden behind the RHP. On native the Inbox tab stays mounted under every RHP, so this cost grows with the number of reports.The context is now split in three:
LHNTooltipContextkeeps the onboarding data the rows show.LHNTooltipActionsContextholdshideConciergeTooltipandgetIsScreenFocused. They are backed by refs, so the value never changes and rows never re-render because of it.Pressableuses them on press and long press.LHNTooltipVisibilityContextholds the focus, navigation and fullscreen flags. Only the row that renders the Concierge tooltip reads it.The provider now calls
useLHNRowProductTrainingTooltiponce instead of once per row. The Concierge LHN tooltip is currently disabled (shouldShowreturns false inTOOLTIPS.ts), so its behavior can't change. The hide path is kept so it still works if the tooltip is turned back on.Performance, iOS simulator (iPhone 18 Pro, DEV build), heavy account, Create expense opened from the Inbox through the actions menu with Manual as the last tab, 6 interleaved blocks of 6 opens after warmup:
In the commit that mounts the page, the Inbox list goes from about 21ms of render time to 0.4ms.
Fixed Issues
$ #106767
PROPOSAL:
Tests
Offline tests
Same as tests while offline. The change only affects rendering, with no API calls.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
iOS: Native
Long press and tap on Inbox rows: VIDEO_TO_UPLOAD
iOS: mWeb Safari
MacOS: Chrome / Safari