Fix the Knowledge Base pages: widget styling, collapsed nav, marker escape - #1038
Merged
Conversation
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
force-pushed
the
kb-sidebar-collapse
branch
from
July 24, 2026 21:45
e00bce7 to
49d01ee
Compare
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 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\25in"\25B8"as an octal escape (0x15) and leftB8as text — the stylesheet literally contained22 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.cssresolves as in production.🤖 Generated with Claude Code