You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Low Risk
Localized UI scroll behavior in the site sidebar hook with unit tests; no auth, data, or API changes.
Overview
Extends useScrollToElement so that, after the existing saved scroll restore, it can scroll the sidebar to keep the current page’s link in view when a pathname is passed.
On mount/route change it finds the matching a[href] (comparing both usePathname() and window.location.pathname for locale-prefixed URLs). If the active item is outside the sidebar viewport, it scrolls to center it; if it’s already visible, it does nothing. WithSidebar now passes pathname into the hook.
Unit tests cover off-screen centering (expected scrollTop: 720) and the no-scroll-when-visible case.
Reviewed by Cursor Bugbot for commit bc1941c. Bugbot is set up for automated code reviews on this repo. Configure here.
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
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.
Description
Validation
git diff --checkpnpm format,pnpm test, andpnpm buildwere not run because dependencies are not included in the bundle environmentRelated Issues
Fixes #8828.
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.