Skip to content

ref(rr6): Convert RedirectToProjectModal to hooks#110744

Merged
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/ref-rr6-convert-redirecttoprojectmodal-to-hooks
Mar 16, 2026
Merged

ref(rr6): Convert RedirectToProjectModal to hooks#110744
evanpurkhiser merged 1 commit intomasterfrom
evanpurkhiser/ref-rr6-convert-redirecttoprojectmodal-to-hooks

Conversation

@evanpurkhiser
Copy link
Member

Replace class component + withSentryRouter with function component
using useRoutes, useParams, and useLocation hooks directly.

Co-Authored-By: Claude noreply@anthropic.com

Replace class component + withSentryRouter with function component
using useRoutes, useParams, and useLocation hooks directly.

Co-Authored-By: Claude <noreply@anthropic.com>
@evanpurkhiser evanpurkhiser requested a review from a team March 16, 2026 16:26
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 16, 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.

Fix All in Cursor

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

  • ✅ Fixed: Timer briefly shows "0 seconds" before redirecting
    • Changed redirect condition from timer <= 0 to timer <= 1 to prevent rendering with 0 seconds visible before redirect.

Create PR

Or push these changes by commenting:

@cursor push 24417391d5
Preview (24417391d5)
diff --git a/static/app/components/modals/redirectToProject.tsx b/static/app/components/modals/redirectToProject.tsx
--- a/static/app/components/modals/redirectToProject.tsx
+++ b/static/app/components/modals/redirectToProject.tsx
@@ -36,7 +36,7 @@
   }, []);
 
   useEffect(() => {
-    if (timer <= 0) {
+    if (timer <= 1) {
       testableWindowLocation.assign(newPath);
     }
   }, [timer, newPath]);

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

if (timer <= 0) {
testableWindowLocation.assign(newPath);
}
}, [timer, newPath]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Timer briefly shows "0 seconds" before redirecting

Low Severity

The redirect condition changed from timer <= 1 (old code) to timer <= 0, and the decrement is now unconditional. The old code redirected synchronously inside the interval callback when timer was still 1, so the user never saw "0 seconds." The new code decrements to 0, renders with timer=0 visible in the countdown text ("in 0 seconds…"), and only then fires the redirect via useEffect. This is a subtle behavioral regression for a refactor intended to preserve existing behavior.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

eh, it's fine.

@evanpurkhiser evanpurkhiser merged commit cddab81 into master Mar 16, 2026
63 of 64 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-rr6-convert-redirecttoprojectmodal-to-hooks branch March 16, 2026 19:10
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