Skip to content

Docs: add active sidebar section tracking - #8330

Open
RinshaAk wants to merge 3 commits into
webpack:mainfrom
RinshaAk:docs/active-sidebar-section
Open

Docs: add active sidebar section tracking#8330
RinshaAk wants to merge 3 commits into
webpack:mainfrom
RinshaAk:docs/active-sidebar-section

Conversation

@RinshaAk

Copy link
Copy Markdown
Contributor

Summary

Adds active section tracking to the documentation sidebar.

What changed

  • Track the visible h2/h3 heading with IntersectionObserver.
  • Highlight the corresponding sidebar anchor.
  • Update the active section immediately when a sidebar anchor is clicked.
  • Automatically scroll the active sidebar anchor into view.
  • Reset the active section when navigating to another documentation page.
  • Add aria-current and smooth color transitions for the active anchor.
  • Scope active anchor highlighting to the current page.

Tests

  • ESLint passes for the touched components.
  • Focused Page and SidebarItem tests pass.
  • Updated SidebarItem snapshot.

Notes

The full Jest suite has existing ESM/Jest configuration failures unrelated to this change.

Use of AI

AI assistance was used during development to help debug the implementation, review code changes, and improve tests. All changes were reviewed and tested locally before submission.

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview Aug 13, 2026 3:13pm

Request Review

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