Skip to content

feat(ContentToc): scroll list independently and center active link#258

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-64b9f7d
Jul 10, 2026
Merged

feat(ContentToc): scroll list independently and center active link#258
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-64b9f7d

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Syncs upstream nuxt/ui commit 64b9f7dfeat(ContentToc): scroll list independently and center active link (#6697).

What

On desktop the table-of-contents list now scrolls independently of the page, and the active link is kept centered as you scroll through the doc:

  • ContentToc.vue — adds an activeIndex computed and a watch that scrolls the content container directly (not the page) to center the active link when it changes. Applies a scroll shadow via the existing useScrollShadow composable (ref="contentRef" + :style="scrollShadowStyle" on the desktop content div).
  • theme/content/content-toc.tsroot becomes flex flex-col lg:overflow-hidden; the fixed rows (top/bottom/trigger) get lg:shrink-0; the flexing ones (container/content) get lg:min-h-0; and content gets lg:overflow-y-auto so the list scrolls on its own at lg.

Adaptation & deviations

  • b24ui's ContentToc deliberately diverges from upstream (no indicator/highlight machinery — those are @memo not supported), and its sticky/max-h/mobile-overflow-y-auto wrapper styling lives on the docs class prop rather than the theme root. The independent-scroll + centering feature is orthogonal to the indicator, so it ports cleanly on top of that structure.
  • Scrollbar: upstream hides the list scrollbar with scrollbar-none, which b24ui does not define. Used b24ui's own scrollbar-thin scrollbar-transparent idiom (from air-design-tokens/components/scrollbar.css, matching the sidebar and the docs TOC wrapper) instead.
  • Not ported: the [...slug].vue hunk only adds highlight/highlight-variant="circuit", which b24ui explicitly does not support — no change there.

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green. Suite 5309 passed / 6 skipped. 16 ContentToc snapshots updated (class-only: the new flex/overflow/shrink-0/min-h-0/scrollbar classes). scrollShadowStyle is undefined when the list doesn't overflow, so no inline style appears in snapshots.

Ledger: cursor advanced to 64b9f7d; previous entry 1a3a9dc reconciled to PR #257.

🤖 Generated with Claude Code


Generated by Claude Code

…4b9f7d)

Port the desktop TOC enhancement from nuxt/ui: the content list scrolls
independently (root lg:overflow-hidden, content lg:overflow-y-auto) and
the active link is kept centered via an activeIndex watch that scrolls
the content container directly. Adds a scroll shadow via useScrollShadow.

Adapted to b24ui's TOC layout (sticky/max-h stays on the docs class
prop; no indicator/highlight machinery). Uses b24ui's scrollbar-thin
scrollbar-transparent idiom in place of the upstream scrollbar-none
utility, which b24ui does not define.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik IgorShevchik merged commit c723feb into main Jul 10, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the sync/nuxt-64b9f7d branch July 10, 2026 14:10
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.

2 participants