Skip to content

fix: replace router.push with Link for static navigation in UserDropdown#983

Merged
MODSetter merged 1 commit intoMODSetter:devfrom
LikiosSedo:fix/user-dropdown-link
Mar 26, 2026
Merged

fix: replace router.push with Link for static navigation in UserDropdown#983
MODSetter merged 1 commit intoMODSetter:devfrom
LikiosSedo:fix/user-dropdown-link

Conversation

@LikiosSedo
Copy link
Contributor

@LikiosSedo LikiosSedo commented Mar 26, 2026

Summary

  • Replace onClick={() => router.push(...)} with <Link> + asChild for the API Key menu item
  • Enables route prefetching and follows Next.js best practices
  • Remove unused useRouter import

Test plan

  • Verify API Key menu item still navigates correctly
  • Verify dropdown closes after navigation

Closes #937

High-level PR Summary

This PR refactors the UserDropdown component to use Next.js Link component with asChild instead of router.push() for navigating to the API Key page. This change enables route prefetching, follows Next.js best practices for static navigation, and removes the now-unused useRouter import.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/components/UserDropdown.tsx

Need help? Join our Discord

Analyze latest changes

Enables route prefetching and follows Next.js best practices.
Removes unused useRouter import.
@vercel
Copy link

vercel bot commented Mar 26, 2026

@LikiosSedo is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on 0583ad5..f764067

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

surfsense_web/components/UserDropdown.tsx

@MODSetter MODSetter merged commit 6336b0f into MODSetter:dev Mar 26, 2026
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants