Skip to content

ENG-3461: add unstyled mode to RouterLink, replace all remaining NextLink usages#7946

Merged
gilluminate merged 5 commits intomainfrom
gill/ENG-3461/routerlink-unstyled
Apr 16, 2026
Merged

ENG-3461: add unstyled mode to RouterLink, replace all remaining NextLink usages#7946
gilluminate merged 5 commits intomainfrom
gill/ENG-3461/routerlink-unstyled

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented Apr 16, 2026

Ticket ENG-3461

Description Of Changes

Followup to #7942. Extends RouterLink with an unstyled prop and migrates all 22 remaining files that imported next/link directly, so RouterLink.tsx is now the sole file importing from next/link.

The unstyled prop delegates to NextLink directly, rendering a plain <a> without Typography.Link styling. This covers wrapping cards, list items, nav links, search results, breadcrumbs, and other non-text content that shouldn't inherit link colors/underlines.

Also forwards className in button mode (previously dropped).

Code Changes

  • RouterLink.tsx: Added unstyled boolean prop with discriminated union types (AnchorProps when unstyled, TypographyLinkProps otherwise). Both button mode and unstyled mode now delegate to NextLink. Added className forwarding in button mode.
  • 22 consumer files: Replaced NextLink, Link from "next/link", <Link as={NextLink}> (Chakra), and <LinkOverlay as={NextLink}> (Chakra) patterns with RouterLink
  • NavSearch test mocks: Added Typography and Button to fidesui mock since NavSearchModal now imports RouterLink
  • configure.tsx: Replaced Chakra LinkBox/LinkOverlay pattern with RouterLink unstyled + Tailwind classes

Steps to Confirm

  1. Verify home page module cards navigate correctly (HomeContent)
  2. Verify sidebar nav links work (MainSideNav)
  3. Verify Cmd+K search modal navigates on result click (NavSearchModal)
  4. Verify breadcrumb links work (NextBreadcrumb)
  5. Verify login page "Forgot password?" link works
  6. Verify DSR Status card "View all requests" and overdue links work
  7. Verify Priority Actions card action rows navigate correctly
  8. Verify account dropdown username link works
  9. Verify configure privacy requests page cards are clickable with hover styling

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Apr 16, 2026 7:12pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Apr 16, 2026 7:12pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.18% (2710/43827) 5.38% (1340/24866) 4.24% (550/12963)
fides-js Coverage: 78%
78.98% (1962/2484) 65.55% (1214/1852) 72.57% (336/463)
privacy-center Coverage: 88%
85.97% (331/385) 81.36% (179/220) 78.87% (56/71)

@gilluminate gilluminate marked this pull request as ready for review April 16, 2026 17:30
@gilluminate gilluminate requested a review from a team as a code owner April 16, 2026 17:30
@gilluminate gilluminate requested review from lucanovera and removed request for a team April 16, 2026 17:30
Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Code Review: ENG-3461 — RouterLink unstyled mode + NextLink migration

This is a clean, well-scoped refactor. The discriminated union type for RouterLinkProps is the right design for distinguishing styled vs. unstyled modes, and the test coverage for the new unstyled mode is thorough. The migration across 22 files is mechanical and consistent.

Summary of findings

Minor / Nit:

  • Double target/rel destructure in RouterLink.tsx — works correctly but can be simplified by moving both to the top-level destructure (see inline comment).
  • Button-child cast to AnchorProps — technically unsound but harmless in practice; the three-mode doc comment is clear enough that this is unlikely to cause issues.

Worth verifying before merge:

  • regulations.tsx — the Chakra color="complimentary.500" on the original link was dropped. Typography.Link has its own default color which may differ; confirm it still matches the design.
  • useSystemFormTabs.tsx — the original textDecor="underline" was dropped. If always-underlined was intentional, the styling needs to be carried forward via className.
  • configure.tsxhover:border-[var(--fidesui-complimentary-500)] is functional but references the CSS variable by its raw name; worth a comment to aid future maintainers.

Overall the architecture is solid and the unstyled mode fills the right gap. The visual-regression notes above are worth a quick design check before merging.

🔬 Codegraph: unavailable


💡 Write /code-review in a comment to re-run this review.

Comment thread clients/admin-ui/src/features/common/nav/RouterLink.tsx Outdated
Comment thread clients/admin-ui/src/pages/settings/regulations.tsx
Comment thread clients/admin-ui/src/features/system/hooks/useSystemFormTabs.tsx
Comment thread clients/admin-ui/src/pages/privacy-requests/configure.tsx
Comment thread clients/admin-ui/src/features/common/nav/RouterLink.tsx
gilluminate and others added 5 commits April 16, 2026 13:05
Extend RouterLink with an `unstyled` prop that delegates to NextLink
directly, rendering a plain <a> without Typography.Link styling. This
covers cards, list items, nav links, and other non-text content.

Also forward className in button mode, and migrate all 22 remaining
files that imported next/link directly. RouterLink.tsx is now the sole
file importing from next/link.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move target and rel into the top-level destructure, eliminating redundant
re-extraction and eslint-disable comments in each rendering branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Code changes look good. The links kept the same styling in all places. Approved!

@gilluminate gilluminate enabled auto-merge April 16, 2026 19:16
@gilluminate gilluminate added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 39520a7 Apr 16, 2026
50 of 51 checks passed
@gilluminate gilluminate deleted the gill/ENG-3461/routerlink-unstyled branch April 16, 2026 19:25
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