feat: add active section highlighting and auto-scroll to sidebar - #8331
Open
Pranav-IIITM wants to merge 4 commits into
Open
feat: add active section highlighting and auto-scroll to sidebar#8331Pranav-IIITM wants to merge 4 commits into
Pranav-IIITM wants to merge 4 commits into
Conversation
Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #8323
The sidebar previously gave no visual indication of which section was currently in view, and did not auto-scroll or auto-expand to keep the active item visible. This PR adds active-section tracking, highlighting and auto-scroll to the sidebar so users can stay oriented while reading long docs pages.
What kind of change does this PR introduce?
Feature (
feat) — adds active section highlighting and auto-scroll behavior to the sidebar navigation.Recording.2026-08-16.120618.mp4
Did you add tests for your changes?
Yes — added unit tests in
src/components/SidebarItem/SidebarItem.test.jsxcovering active anchor behavior.Does this PR introduce a breaking change?
No.
SidebarItemgains a new optionalactiveAnchorprop; existing usages without it are unaffected.If relevant, what needs to be documented once your changes are merged or what have you already documented?
No external/user-facing documentation changes are needed — this is an internal UI behavior improvement to the existing sidebar component. No new public API or config was introduced.
Use of AI
Not used