Skip to content

ref(performance): replace browserHistory with useNavigate in traceWaterfall#109978

Merged
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/ref-performance-replace-browserhistory-with-usenavigate-in-tracewaterfall
Mar 6, 2026
Merged

ref(performance): replace browserHistory with useNavigate in traceWaterfall#109978
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/ref-performance-replace-browserhistory-with-usenavigate-in-tracewaterfall

Conversation

@evanpurkhiser
Copy link
Member

No description provided.

@evanpurkhiser evanpurkhiser requested a review from a team as a code owner March 5, 2026 21:38
@evanpurkhiser evanpurkhiser requested review from a team and removed request for a team March 5, 2026 21:38
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 5, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Missing preventScrollReset causes unwanted scroll on navigation
    • Added preventScrollReset: true to the navigate options at line 294 to prevent unwanted scroll jumps during waterfall row focus changes, matching the behavior of the old browserHistory.replace shim.

Create PR

Or push these changes by commenting:

@cursor push fd99f9649d
Preview (fd99f9649d)
diff --git a/static/app/views/performance/newTraceDetails/traceWaterfall.tsx b/static/app/views/performance/newTraceDetails/traceWaterfall.tsx
--- a/static/app/views/performance/newTraceDetails/traceWaterfall.tsx
+++ b/static/app/views/performance/newTraceDetails/traceWaterfall.tsx
@@ -291,7 +291,7 @@
                 node: nextNodePath,
               },
             },
-            {replace: true}
+            {replace: true, preventScrollReset: true}
           );
           queryStringAnimationTimeoutRef.current = null;
         }, debounce);
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

},
},
});
{replace: true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing preventScrollReset causes unwanted scroll on navigation

Medium Severity

The old browserHistory.replace shim automatically included preventScrollReset: true to replicate react-router 3 behavior (as explicitly commented in browserHistory.tsx). The new navigate call only passes {replace: true}, losing the scroll reset prevention. This can cause the page to scroll unexpectedly when the query string is updated during waterfall row focus changes. The NavigateOptions type already supports preventScrollReset, so it just needs to be added alongside replace.

Fix in Cursor Fix in Web

@evanpurkhiser evanpurkhiser merged commit 0919b65 into master Mar 6, 2026
63 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-performance-replace-browserhistory-with-usenavigate-in-tracewaterfall branch March 6, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants