Skip to content

Fix docs table of contents scrolling - #1078

Merged
tannerlinsley merged 1 commit into
mainfrom
agent/fix-docs-toc-links
Jul 30, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
agent/fix-docs-toc-links

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 30, 2026 •

Copy link
Copy Markdown
Member

Fixes #937.

The docs TOC configured resetScroll={false} on same-page hash links. TanStack Router returns early from scroll restoration when that flag is set, so the following hashScrollIntoView behavior never runs.

This removes the conflicting flag and lets the existing smooth hash scrolling work.

Impact: “On this page” links navigate to their target headings again.

Validation: pnpm test (TypeScript, lint, 115 unit tests: 114 passed, 1 skipped).

Risk: Low. The change only restores the router’s default scroll handling for TOC hash links.

Summary by CodeRabbit

  • Bug Fixes
    • Improved table-of-contents navigation with smooth scrolling when selecting a heading.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b47e934-c3af-4fb6-ae9c-031425411390

📥 Commits

Reviewing files that changed from the base of the PR and between d78b090 and 67be2c1.

📒 Files selected for processing (1)
  • src/components/Toc.tsx
💤 Files with no reviewable changes (1)
  • src/components/Toc.tsx

📝 Walkthrough

Walkthrough

The TOC heading links now smooth-scroll to hash targets by using hashScrollIntoView, replacing the previous resetScroll={false} configuration.

Changes

TOC hash navigation

Layer / File(s) Summary
Smooth hash navigation
src/components/Toc.tsx
TOC links remove resetScroll={false} and configure smooth hash-target scrolling with hashScrollIntoView={{ behavior: 'smooth' }}.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: restoring docs table-of-contents hash scrolling.
Linked Issues check ✅ Passed The change addresses the linked issue by restoring same-page heading navigation.
Out of Scope Changes check ✅ Passed The PR is narrowly scoped to Toc scroll behavior and introduces no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 agent/fix-docs-toc-links

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 67be2c1 Commit Preview URL

Branch Preview URL
Jul 30 2026, 12:09 PM

@tannerlinsley
tannerlinsley merged commit cca5c9b into main Jul 30, 2026
7 checks passed
@tannerlinsley
tannerlinsley deleted the agent/fix-docs-toc-links branch July 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"On this page" links don't work

1 participant