Skip to content

fix(navigation): migrate standard HTML links to Next.js Link components for SPA routing#1787

Open
ArshVermaGit wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
ArshVermaGit:main_2
Open

fix(navigation): migrate standard HTML links to Next.js Link components for SPA routing#1787
ArshVermaGit wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
ArshVermaGit:main_2

Conversation

@ArshVermaGit
Copy link
Copy Markdown
Contributor

Description

This PR replaces several standard HTML <a> tags used for internal navigation with next/link components.

Previously, standard anchor tags were forcing full browser page reloads when users navigated between internal pages (e.g., from the public profile to the dashboard settings or compare pages). By upgrading to Next.js <Link> components, we restore proper client-side Single Page Application (SPA) routing.

Resolved Issue

Resolves #1786

Changes Made

  • Routing Optimization: Replaced <a> tags with <Link> components in the following files:
    • src/app/compare/[users]/page.tsx
    • src/app/dashboard/settings/page.tsx
    • src/app/u/[username]/page.tsx
    • src/components/landing/LandingPage.tsx
  • Auth Routes: Used prefetch={false} on specific API route links (e.g., /api/auth/link-github and /api/auth/signin/github) to ensure NextAuth server-side redirects work seamlessly without unwanted client-side prefetching.
  • Linting: Successfully resolved all instances of the @next/next/no-html-link-for-pages ESLint warnings.

Impact

  • Performance: Eliminates unnecessary full-page reloads, drastically reducing perceived latency during internal navigation.
  • User Experience: State is properly preserved during transitions, leading to a much smoother, app-like experience.

Testing

  • Verified that internal links (e.g., "Back to Home", "Settings", "Compare with me") navigate instantly via SPA routing.
  • Verified that GitHub authentication links still correctly redirect to NextAuth API endpoints.
  • Ran npm run lint and confirmed 0 no-html-link-for-pages errors.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@ArshVermaGit is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix labels May 31, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Copy link
Copy Markdown
Contributor Author

@ArshVermaGit ArshVermaGit left a comment

Choose a reason for hiding this comment

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

Hi @Priyanshu-byte-coder ! Issue #1786 has been resolved. Please review the PR and merge it under GSSoC. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Replace standard <a> tags with Next.js <Link> components for internal navigation

1 participant