Coming from here
Background
Navigating to a report from the Chat Switcher is slower than expected. There is a noticeable lag (~500ms) between the time the user clicks on a report and the OpenReport action is triggered.
Problem
It is cause because of the call onRouterClose() inside SearchRouter, which is executed immediately upon report click. This function closes a modal that’s mounted at the top level in AuthScreen, leading to re-renders and delays before the report is actually opened.
Solution
- Deferring onRouterClose() Execution
- Instead of calling onRouterClose() immediately, we delay its execution until after we start navigating to new report. This reduces contention in UI updates and avoids blocking navigation.
- Refactoring SearchRouterContextWe can wrap the function in useCallback to avoid unnecesary rerenders when day are called. They are called when onRouterClose function is invoked.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021933531487223741644
- Upwork Job ID: 1933531487223741644
- Last Price Increase: 2025-06-13
Issue Owner
Current Issue Owner: @adelekennedy
Coming from here
Background
Navigating to a report from the Chat Switcher is slower than expected. There is a noticeable lag (~500ms) between the time the user clicks on a report and the OpenReport action is triggered.
Problem
It is cause because of the call onRouterClose() inside SearchRouter, which is executed immediately upon report click. This function closes a modal that’s mounted at the top level in AuthScreen, leading to re-renders and delays before the report is actually opened.
Solution
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @adelekennedy