You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: stop Inbox rows re-rendering when a right-hand panel opens #106767
LHNTooltipContextProvider puts useIsFocused() and a root navigation flag in the same context value that every Inbox row reads. When an RHP such as Create expense opens, the Inbox loses focus, the context value changes, and every visible row re-renders with its whole subtree, even though the RHP hides the Inbox. On native the Inbox tab stays mounted under every RHP, so this cost grows with the number of reports.
Solution
Split the context in three. LHNTooltipContext keeps the onboarding data the rows show. LHNTooltipActionsContext holds hideConciergeTooltip and getIsScreenFocused, backed by refs so its value never changes. LHNTooltipVisibilityContext holds the focus, navigation and fullscreen flags, and only the row that renders the Concierge tooltip reads it. The provider also calls useLHNRowProductTrainingTooltip once instead of once per row. On a heavy account in an iOS DEV build, the median time to open Create expense drops from 318 ms to 240.5 ms, and p90 drops from 938 ms to 397 ms.
Activity