Skip to content

Fix header link redirects #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 27, 2025
Merged

Fix header link redirects #57

merged 4 commits into from
Jun 27, 2025

Conversation

rezrah
Copy link
Collaborator

@rezrah rezrah commented Jun 27, 2025

Towards https://github.com/github/primer/issues/5379

Errors on primer.style indicate that using the Next Link component is triggering a prefetch of the reverse-proxied urls, which are failing.

Screenshot 2025-06-27 at 14 37 14

This PR switches from Link to <a> to prevent the prefetch, while making minimal user-facing changes. These links don't need prefetching.

To test this feature resolves the parent Issue, we'll need to ship to production on Primer Brand and verify.

@rezrah rezrah marked this pull request as ready for review June 27, 2025 13:43
@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 13:43
@rezrah rezrah requested a review from a team as a code owner June 27, 2025 13:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses header link redirect issues by replacing the Next.js Link component with native anchor tags.

  • Replaced the Next.js Link component with an tag for the site title.
  • Updated header navigation links to use native anchor tags.
Comments suppressed due to low confidence (2)

packages/theme/components/layout/header/Header.tsx:60

  • Replacing the Next.js Link component with a native anchor tag will disable client-side routing, potentially leading to full page reloads. Confirm that this change is intended to achieve the desired redirect behavior.
        <a href="/" className={styles.Header__siteTitle}>

packages/theme/components/layout/header/Header.tsx:75

  • Ensure that using native anchor tags for header navigation links does not unintentionally bypass Next.js client-side navigation, as this may affect performance due to full page reloads.
              <a

@rezrah rezrah merged commit 8384b3e into main Jun 27, 2025
8 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