feat(docs): fix prose contrast and personalize image-pull docs (BUNYIP-407) #409
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-407-docs-contrast-personalize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Closes BUNYIP-407. Two docs improvements on the public
/docspages.1. Prose contrast (WCAG AA)
.docs-articlehad no explicit text color, so rendered doc prose inherited the surrounding container color and blended into the background. It now pinscolor: hsl(var(--foreground))(the high-contrast body token). Light theme foreground120 22% 16%on background120 21% 96%and dark theme foreground120 21% 96%on background120 8% 9%both clear the AA 4.5:1 target comfortably.2. Personalized image-pull docs
The
docker loginstep indownloading-apps.mdnow shows--username <username>. A signed-in reader sees their own Bunyip account email (the docker login username) substituted in place of the placeholder and highlighted via a new.docs-fillclass. A?raw=1toggle reverts to the generic placeholder view, with a link to switch either direction. Signed-out rendering is unchanged: personalization is gated on a present user.The substitution runs on the already-rendered, HTML-escaped output and builds the highlighted value through Maud, so a crafted username cannot inject markup.
Tests
personalize_docs_escapes_crafted_username- a<script>username is HTML-escaped, not injected.personalize_docs_substitutes_and_highlights- placeholder replaced and wrapped in.docs-fill.downloading_apps_carries_username_placeholder- guards the doc against drifting away from the substitution token.just check-containeris green (fmt + clippy -D warnings + build + full workspace tests).Verification
c.user.is_some(), so the page renders exactly as before (only the CSS contrast change applies).🤖 Generated with Claude Code
https://claude.ai/code/session_01LerAorB26HGHLfjC9iDUbd
The rendered `/docs/{slug}` prose had no explicit text color, so it inherited whatever the surrounding container used and read as low-contrast against the page background. Pin `.docs-article` to `hsl(var(--foreground))`, the high-contrast body token, so prose meets WCAG AA (4.5:1) in both the light and dark themes. Personalize the image-pull guide for a signed-in reader: the `docker login` command now carries a `--username <username>` placeholder, and a signed-in reader sees their own Bunyip account email (which is the docker login username) substituted in and highlighted via a new `.docs-fill` class. A `?raw=1` toggle reverts to the generic placeholder view, and the page offers a link to switch either way. Signed-out rendering is unchanged: personalization is gated on a present user. The substituted username is HTML-escaped through Maud before splicing into the already-rendered HTML, so a crafted username cannot inject markup; a test covers this. Additional tests assert the doc still carries the placeholder token and that substitution highlights the value. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LerAorB26HGHLfjC9iDUbd