Skip to content

Fix docs router link freeze#990

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/fix-docs-router-link-freeze
Jun 15, 2026
Merged

Fix docs router link freeze#990
tannerlinsley merged 1 commit into
mainfrom
taren/fix-docs-router-link-freeze

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Canonicalizes Router framework docs links emitted from markdown so aliases like /router/latest/docs/framework/react/overview render as /router/latest/docs/overview.
  • Disables TanStack Router intent preloading for markdown links with preload=false instead of falling back to the app default.
  • Avoids repeated generated-path warnings for docs Home links by using the concrete library home path.

Root Cause

Markdown links were passing preload=undefined, which still inherited the router's defaultPreload: intent. The affected Start docs link also targeted Router's framework alias route, which redirects to the canonical Router docs path. Hover/click could enter that client-side redirect/preload path and hang the tab.

Validation

  • Reproduced the pre-fix hang locally from /start/latest/docs/framework/react/guide/routing to the Router overview link.
  • Verified after the change that hover remains responsive and click lands on /router/latest/docs/overview.
  • Ran pnpm test successfully. Existing unrelated lint warnings remain.

Summary by CodeRabbit

  • Refactor
    • Improved navigation path computation in documentation layouts for more reliable routing
    • Enhanced internal link path normalization to ensure consistent navigation across documentation pages
    • Optimized link preloading behavior to improve navigation performance

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e9f00fa-650f-409b-bd23-e7f4e4fe3022

📥 Commits

Reviewing files that changed from the base of the PR and between d9d7401 and 4853ee5.

📒 Files selected for processing (2)
  • src/components/DocsLayout.tsx
  • src/components/markdown/MarkdownLink.tsx

📝 Walkthrough

Walkthrough

DocsLayout gains a precomputed libraryHomePath variable used for the Home sidebar link instead of an inline route string with params. MarkdownLink adds a normalizeRoutableInternalPathname helper that rewrites /router/{version}/docs/… paths to a canonical form, applies it during routable-internal link resolution, and sets preload={false} on both internal and relative links.

Changes

Docs Routing Link Fixes

Layer / File(s) Summary
DocsLayout Home link path computation
src/components/DocsLayout.tsx
Computes libraryHomePath from libraryId and version, and the Home sidebar Link uses this precomputed path instead of an inline TanStack route string with params.
MarkdownLink path normalization and preload fix
src/components/markdown/MarkdownLink.tsx
Adds normalizeRoutableInternalPathname to rewrite /router/{version}/docs/… paths to a canonical form; the routable-internal branch applies this normalization after stripping .md; preload is set to false on both internal and relative links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A path once tangled, now set straight,
The Home link hops to its proper gate.
Normalize, canonicalize, .md stripped bare,
Preload set false with a bunny's care.
Clean routes for all — the warren agrees!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix docs router link freeze' directly and specifically addresses the main objective of the PR, which is fixing a freeze issue with Router docs links in the documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/fix-docs-router-link-freeze

Comment @coderabbitai help to get the list of available commands and usage tips.

@tannerlinsley tannerlinsley marked this pull request as ready for review June 15, 2026 16:04
@tannerlinsley tannerlinsley merged commit 4db8cdf into main Jun 15, 2026
5 of 6 checks passed
@tannerlinsley tannerlinsley deleted the taren/fix-docs-router-link-freeze branch June 15, 2026 16:07
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.

1 participant