fix(dev): collapse the docs rail, drop its scrollbar, highlight code - #44
Merged
Conversation
The docs site shipped a fully-expanded rail nested inside two scroll containers and rendered every snippet as plain text. - Groups are Collapsible, collapsed by default; the current route's group auto-expands, scrolls itself into view and persists in sessionStorage. - The rail is the only scroller in the aside and paints a transparent thumb, so the page bar is the only visible one. - highlight.js (dev-only) feeds the DS CodeBlock `children` slot; the theme maps to semantic tokens that clear 4.5:1 on bg-card in both themes.
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.
Three UX complaints on the deployed docs site (ds.agentage.io).
dev/+e2e/only — nosrc/componentschanges.1. Double scrollbar on the left
The rail nested two scroll containers: the shell
<aside>(overflow-y-auto) aroundDocSidebar's ownsticky max-h-screen overflow-y-autoinner div. Both painted a bar from the global::-webkit-scrollbarstyling inbase.css, right next to the page bar..docs-rail, so the DocSidebar demo keeps its own).scrollbar-width: thin+ a transparent thumb that only appears on hover/focus-within, with matching::-webkit-scrollbaroverrides since Chromium prefers the pseudo-elements once they exist.2. Left navigation is not collapsed
DocsNav(new,dev/components/docs-nav.tsx) dogfoods the DSCollapsiblecompound API:aria-expanded/aria-controlsfor free.scrollToponly, never the page).sessionStorage.With groups collapsed the rail fits the viewport, which is what mostly removes complaint 1; the thin-scrollbar fix covers the long-group case.
3. Code is not highlighted
highlight.jsas a devDependency (dev/is not published - the library'sdependenciesare untouched), four languages registered, fed through the DSCodeBlockchildrenslot so the chrome stays DS. All import snippets, the getting-started and theming snippets, and the CodeBlock demo are highlighted.The theme maps hljs classes to semantic tokens only. Every one clears 4.5:1 on
--color-cardin both themes (dark / light):muted-foreground4.66 / 4.76,primary-emphasis9.32 / 5.45,success8.41 / 5.43,warning6.82 / 5.43,info5.21 / 5.47,destructive4.91 / 5.67.Verification
npm run verifygreen (434 unit tests).mcr.microsoft.com/playwright:v1.62.1-noble, 43/43 - the axe WCAG A/AA sweep passes over all 8 categories, every component page and/,/install,/themingin both themes with the new highlight colours.component-pageandcategory-indexonly (the two full-page shots that include the rail).