Skip to content

[Due for payment 2025-07-14] Improve front end performance of displaying a report from Chat Switcher #64174

@mountiny

Description

@mountiny

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

  1. 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.
  2. 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 OwnerCurrent Issue Owner: @adelekennedy

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions