Skip to content

fix(docs): polish sidebar scroll state#24

Open
vyctorbrzezowski wants to merge 1 commit into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/docs-sidebar-scroll-polish
Open

fix(docs): polish sidebar scroll state#24
vyctorbrzezowski wants to merge 1 commit into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/docs-sidebar-scroll-polish

Conversation

@vyctorbrzezowski
Copy link
Copy Markdown
Contributor

@vyctorbrzezowski vyctorbrzezowski commented Jun 1, 2026

Summary

This polishes the docs site's left sidebar behavior without changing documentation content.

  • Adds a subtle overflow treatment to the desktop sidebar: thin scrollbar, top/bottom fade only when there is more content to scroll, and extra bottom padding so the final links do not sit under the fade.
  • Centers the active sidebar link on initial page load and after PJAX navigation swaps the sidebar state. The old behavior could leave the active page far outside the visible sidebar when landing on a deep nav item.
  • Keeps the sidebar sticky offset consistent across desktop and mid-width layouts, while making the mid-width sidebar a little denser.
  • Keeps the mobile drawer out of the fade-mask treatment.
  • Adds smoke coverage for the new CSS and active-link centering contract.

Behavior notes

The important change is stateful. On a long sidebar, the page content can be correct while the left nav still starts at the top, leaving the active item hidden several screens below the visible rail. This is most noticeable when opening a deep docs URL directly or after client-side navigation updates the active item.

Automated browser check on /tools/kimi-search/, using the same 1024x720 viewport:

  • Before: sidebar scrollTop stayed at 0; the active Kimi search link was at 3535px and not visible inside the sidebar.
  • After: sidebar scrolls to 2764; the active Kimi search link lands around 418px, visible near the middle of the rail.

Visual proof

Same page, viewport, theme, and crop. The screenshots are focused on the sidebar but keep enough page context to show the relationship to the content.

Before After
Before: active Kimi search item is below the visible sidebar rail After: active Kimi search item is visible near the middle of the sidebar rail

Full evidence page: https://scarlet-silence-af4p.here.now/

Validation

  • git diff --check
  • node --check scripts/docs-site/assets.mjs
  • node --check scripts/docs-site/smoke.mjs
  • make docs-check-shell

@vyctorbrzezowski vyctorbrzezowski requested a review from a team as a code owner June 1, 2026 02:45
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