Repository navigation
Make handbook diagrams legible in both themes and annotate screenshots - #10
Merged
Merged
Conversation
Sequence diagrams: Mermaid measured text with its default font while drawing DejaVu, so labels overflowed and lifelines struck through them. Match the measuring font, halo message labels, group steps into labelled phase bands, drop mirrored actors and trim margins so both diagrams fit the content column at 1:1. All diagram colours now come from docs/assets/diagrams/palette.json. Hand-drawn SVGs use var(--token) only, carry an in-image legend, and scripts/render_diagrams.py writes a -dark variant of every diagram. Pages embed both with #gh-light-mode-only/#gh-dark-mode-only, which GitHub and the Material theme toggle both honour; the handbook CSS no longer stretches diagrams or paints them white. Screenshots: raw captures move to screenshots/raw/ (excluded from the build) and scripts/annotate_screenshots.py draws callouts on the copies the pages embed. The branding reference gets its own annotated copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sodre
added a commit
that referenced
this pull request
Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/assets/screenshots/approval-branding.png # docs/assets/screenshots/approval-selected.png # docs/assets/screenshots/approval-unselected.png # docs/assets/screenshots/branding-alternate.png # docs/assets/screenshots/pairing-browser.png # docs/assets/screenshots/pairing-companion.png # docs/assets/screenshots/raw/approval-selected.png # docs/assets/screenshots/raw/approval-unselected.png # docs/assets/screenshots/raw/branding-alternate.png # docs/assets/screenshots/raw/pairing-browser.png # docs/assets/screenshots/raw/pairing-companion.png # docs/assets/screenshots/raw/scope-wildcard.png # docs/assets/screenshots/raw/widget.png # docs/assets/screenshots/scope-wildcard.png # docs/assets/screenshots/widget.png # docs/develop.md # docs/reference/widget.md # scripts/annotate_screenshots.py
sodre
added a commit
that referenced
this pull request
Nov 18, 2026
From the review of #10: - Reject every colour that bypasses palette.json: short and long hex, rgb()/hsl() and friends, and named colours in fill, stroke and other paint properties, in hand-drawn SVGs, .mmd sources and theme.json. - Name palette tokens as {token} in theme.json and .mmd bands and resolve them per mode, instead of reverse-matching hex. Light values no longer have to be unique, so surface is plain #ffffff again. - Turn off Mermaid's default band drop shadow, which glowed in dark mode. - Insert palette blocks with a function, not a regex template. - Make --hand and --mermaid mutually exclusive. - Embed light/dark diagram pairs without link wrappers, so the hidden variant no longer leaves an empty, focusable link. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The handbook's visuals had readability problems:
access-endswas stretched to roughly 1.5× body-text size.What changed
Sequence diagrams (
first-request,access-ends)trebuchet ms) but drew it in DejaVu. Setting the top-levelfontFamilyandfontSizefixes the sizing.One palette, light and dark
docs/assets/diagrams/palette.jsonholds every diagram colour. Hand-drawn SVGs reference it only throughvar(--token), and the script rejects stray hex values.scripts/render_diagrams.pyregenerates each light SVG's palette block and writes a-dark.svg. For Mermaid it derives a dark theme by swapping tokens.#gh-light-mode-only/#gh-dark-mode-only. GitHub and Material's theme toggle both honour these suffixes.handbook.cssno longer forcesdisplay: block(it was overriding Material's hide rule),width: 100%or a white background on diagrams.Screenshots
docs/assets/screenshots/raw/, which the build excludes.scripts/annotate_screenshots.py(Pillow) draws callouts onto the copies the pages embed.approval-branding.pnginstead of reusingapproval-selected.png.develop.mddocuments both scripts.Verification
mkdocs build --strictwith the pinnedrequirements-docs.txt; it exits 0.prefers-color-scheme: lightanddark. Exactly one variant shows per theme.Follow-ups (separate PRs)
🤖 Generated with Claude Code