Skip to content

fix: table of contents on interactive sites, border layer, llms.txt groups - #49

Merged
Shewart merged 4 commits into
mainfrom
fix/toc-interactive
Oct 21, 2026
Merged

Shewart merged 4 commits into
mainfrom
fix/toc-interactive

Conversation

@Shewart

@Shewart Shewart commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Table of contents on interactive sites

With <Routes @rendermode="InteractiveServer" /> (shellui.dev, shelldocs.shellui.dev, shellicons.shellui.dev), the "On this page" highlight stopped moving once the circuit started, and clicking an entry went to the home page.

  • Highlight. The circuit replaced the prerendered TOC and headings, so the scroll-spy watched detached elements. shelldocs.js now re-attaches it when a render replaces the list or headings, or when data-toc-ids changes on navigation.
  • Links. TOC links were bare #id, which resolves against <base href> to the home page. They now carry the page's base-relative path (docs/theming#dark-mode), which also works under --base-href.
  • Same-page clicks. TOC links and [x](#id) links in content scroll in place and keep the full path in the address bar, before Blazor's router sees the click. A trailing slash (static hosts serve /docs/x/) doesn't count as another page.
  • Page bottom. The last short sections can't scroll up into the scroll-spy band, so at the bottom of the page the last heading on screen is active.

Sites with their own toc.js workaround can drop it after upgrading.

Also

  • Border utilities. The universal border-color: var(--border) rule in shelldocs-theme.css was unlayered, so it beat Tailwind's border-* utilities in previews and home pages. It's in @layer base now.
  • llms.txt groups. Top-level pages on both sides of a folder gave two "## Pages" headings. Each group is listed once, in first-seen order.
  • Page menu chat links. With SiteUrl set, the Claude / ChatGPT prompts name the published page, also when an export is previewed locally.

Checked

  • Every commit builds in Release with 0 warnings and passes on its own (392 / 393 / 394 / 394 tests); new: TableOfContentsTests, ThemeCssTests, two in LlmsTxtTests.
  • Example site, InteractiveServer:
    • six seconds after load the scroll-spy is still attached and follows the scroll
    • a TOC click and a bare #id link stay on the page
    • after sidebar navigation the TOC links and ids belong to the new page
  • Export built with --base-href /sub/, served under /sub/:
    • a TOC click scrolls in the same document; the URL is /sub/docs/theming/#dark-mode
    • the last heading becomes active at the bottom
  • In the browser, a layered border-destructive utility now wins over the base rule, and plain elements keep --border.

Under <Routes @rendermode="InteractiveServer" /> the circuit replaced the
prerendered TOC and headings, so the scroll-spy watched detached elements
and the highlight stopped moving. TOC links were bare #id, which resolves
against <base href> to the home page.

- TOC links carry the page's base-relative path (docs/setup#install)
- the scroll-spy re-attaches when a render replaces the list or headings,
  or changes data-toc-ids on navigation
- same-page links (#id in content too) scroll in place and keep the path
- at the bottom of the page the last heading on screen is active
The unlayered *, *::before, *::after rule in shelldocs-theme.css beat Tailwind's border-colour utilities (@layer utilities) in previews and home pages, so border-destructive rendered as --border. It's in @layer base now.
Top-level pages on both sides of a folder gave two "## Pages" groups; groups are now listed once, in first-seen order. The page menu's chat prompts used the visitor's origin, so an export previewed on localhost named a localhost URL; with SiteUrl set they name the published page.
@Shewart
Shewart merged commit ef97314 into main Oct 21, 2026
1 check passed
@Shewart
Shewart deleted the fix/toc-interactive branch October 21, 2026 14:05
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