Skip to content

Fix the Knowledge Base pages: widget styling, collapsed nav, marker escape - #1038

Merged
MDA2AV merged 1 commit into
mainfrom
kb-sidebar-collapse
Jul 24, 2026
Merged

Fix the Knowledge Base pages: widget styling, collapsed nav, marker escape#1038
MDA2AV merged 1 commit into
mainfrom
kb-sidebar-collapse

Conversation

@MDA2AV

@MDA2AV MDA2AV commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Three things were wrong with the Knowledge Base pages since #1026. All visible on every doc page.

1. The type-rules widget was broken on all 27 implementation pages

_doc_html() emits the same markup the board used — .type-rules-tab, .type-rules-panel, .tr-sq — but the rules that hide inactive panels only ever existed in the board's inline stylesheet. On the static pages all three panels rendered stacked, so every implementation page showed the Standard, Tuned and Engine rules one after another, with tab buttons that appeared to do nothing.

Same for the tabs widget (.doc-tabset / .doc-tab / .doc-tabpanel).

Found by listing every class the generated pages actually emit and checking each against docs.css: nine widget classes unstyled, all nine present in the board's CSS. The only remaining unstyled classes are .language-* code-fence hints and bare .active — unstyled everywhere, including the board.

2. The sidebar rendered the entire tree expanded

126 links in a 250px column with its own scrollbar, where the board shows a collapsible accordion. Now <details>/<summary>, open only along the path to the current page: ~30 visible links instead of 126. Chosen over JavaScript because these pages exist to be crawled — the nav stays usable with scripting off and search engines still see every link.

3. The disclosure marker rendered as garbage

_docs_css() is a plain triple-quoted string, not a raw one, so Python read the \25 in "\25B8" as an octal escape (0x15) and left B8 as text — the stylesheet literally contained 22 15 42 38 22. Now a literal . Scanned the whole generated stylesheet for other control characters: none.

The underlying cause

The widget markup and the widget styling live in different files, in different languages, with nothing tying them together — the board's inline <style> versus a Python string. Copying the rules fixes today's breakage; sharing one stylesheet between the board and the static pages would prevent the next one, and is worth doing as a follow-up.

Verified by regenerating all 126 pages and rendering them from a local server so /docs/docs.css resolves as in production.

🤖 Generated with Claude Code

Every doc page rendered the whole tree expanded: 126 links in a 250px column
with its own scrollbar, where the board next door shows a collapsible
accordion. Getting anywhere in the Knowledge Base meant scrolling past every
other page in the site.

The nav is now <details>/<summary>, open only along the path to the page you
are on — so the baseline validation page shows Test Profiles > H/1.1 >
Isolated > Baseline expanded and the other 40-odd sections closed, about 30
visible links instead of 126. <details> was chosen over JavaScript because
these pages exist to be crawled: the markup stays navigable with scripting
off, and search engines still see every link.

Also fixes the disclosure marker, which was rendering as a control character
followed by "B8". _docs_css() is a plain triple-quoted string, not a raw one,
so Python read the \25 in "\25B8" as an octal escape (0x15) and left "B8" as
text — visible as garbage next to every collapsed section. It is now the
literal character, which has no escaping ambiguity. Checked the generated
stylesheet for any other control characters: none.
@MDA2AV
MDA2AV force-pushed the kb-sidebar-collapse branch from e00bce7 to 49d01ee Compare July 24, 2026 21:45
@MDA2AV
MDA2AV merged commit 6398294 into main Jul 24, 2026
@MDA2AV
MDA2AV deleted the kb-sidebar-collapse branch July 24, 2026 21:54
@MDA2AV MDA2AV changed the title Collapse the Knowledge Base sidebar to the current page Fix the Knowledge Base pages: widget styling, collapsed nav, marker escape Jul 24, 2026
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