Skip to content

Conversation

@mdo
Copy link
Contributor

@mdo mdo commented Jan 7, 2026

Small QoL maybe for docs—expand the sidebar all the way so no headings are lost. Also adds a little scroll into view action for links further down the page so folks don't think there's not an active sidebar link.

@mdo mdo requested review from amadeus and Copilot January 7, 2026 21:12
@vercel
Copy link

vercel bot commented Jan 7, 2026

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

Project Deployment Review Updated (UTC)
pierrejs-diff-demo Ready Ready Preview Jan 8, 2026 0:04am
pierrejs-docs Ready Ready Preview Jan 8, 2026 0:04am
pierrejs-solid-diff-demo Ready Ready Preview Jan 8, 2026 0:04am

Copy link

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 improves the documentation sidebar user experience by ensuring all headings are visible (removing the tocIgnore filter) and automatically scrolling the active sidebar link into view so users can always see which section is currently active.

  • Removes the tocIgnore filtering logic to show all headings in the sidebar
  • Adds automatic scrolling of the active sidebar link into the center of the viewport
  • Implements a ref to the nav element to enable programmatic scrolling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

);

if (activeLink instanceof HTMLElement) {
activeLink.scrollIntoView({ block: 'center', behavior: 'smooth' });
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The scrollIntoView with smooth behavior may cause unwanted scrolling animations in the sidebar every time the user scrolls through the page and the active heading changes. This could be distracting or jarring for users, especially when scrolling quickly through multiple sections. Consider either removing the smooth behavior (using 'auto' instead) or adding a check to only scroll when the active link is outside the visible area of the sidebar.

Suggested change
activeLink.scrollIntoView({ block: 'center', behavior: 'smooth' });
activeLink.scrollIntoView({ block: 'center', behavior: 'auto' });

Copilot uses AI. Check for mistakes.
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