Highlight the current page in the sidebar and scroll it into view - #1265
Merged
Merged
Conversation
Every category above the current page turned orange too, and the current page used the same grey background as a hovered item, so the page you were on was the hardest entry to spot. The categories above it now keep the normal text colour in semibold, and only the current page is orange: an orange-tinted background with orange text that is 4.8:1 against it in light mode (the old orange on grey was 1.86:1) and 7.3:1 in dark mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sidebar never scrolled on its own, so a page deep in a long section opened with its entry out of sight: Text to Splats sat 1,334px down an 840px sidebar. A client module now centres the current entry after each navigation, but only when it isn't already in view, so clicking a visible entry never moves the list and hash changes are ignored. It handles the mobile drawer too, which is rendered while closed and so opens on the current page. Categories animate open and closed, and auto-collapse can fold a category above the entry, so the module keeps checking for a second after each navigation and stops as soon as the reader scrolls, taps or types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Makes the current page easy to find in the User Manual sidebar. Only the current page is highlighted now, and the sidebar scrolls to it after each navigation. Follows #1264.
What changed
Current page highlight (
src/css/custom.scss)#a84300on the tint (4.8:1; the old orange on grey was 1.86:1). In dark mode it's the existing#ffb47a(7.3:1).Scroll to the current page (
src/client-modules/reveal-current-page.js, registered indocusaurus.config.js)Why
Every category above the current page turned orange along with the page itself, and the current page used the same grey background as a hovered item. The page you were on was the hardest entry to spot. The sidebar also never scrolled on its own, so arriving on a deep page from search or a link left its entry out of sight. Text to Splats, for example, sat 1,334 px down an 840 px sidebar.
Testing
npm run buildsucceeds for en and ja with no warningsnpm run lintis clean, andnpm testpasses (52 tests)<pc-entity>and Editor › Editor Interface › Project Settings › Rendering centre the entry. The Welcome page doesn't scroll<pc-entity>(a client-side navigation) brings the entry into viewNotes for review
clientModulesin the same place indocusaurus.config.js. Whichever PR merges second will conflict there. Resolve it by keeping both sets of modules in one list: twoclientModuleskeys would silently drop one set.I confirm I have read the contributing guidelines.
🤖 Generated with Claude Code