feat(v3.17.0): WCAG AA contrast verification + sw.js cache auto-bump#96
Merged
Conversation
Closes #91. Embedded sw.js ships __MARKGO_CACHE_VERSION__ placeholder substituted once at startup with `swCacheVersion(constants.AppVersion)` (strips leading v, "dev" fallback). Operator STATIC_PATH overlay sw.js serves raw — operator owns their cache version, bypasses auto-bump. Build invariant: missing placeholder fails server startup.
Closes #90. Verified WCAG AA across 5 presets × 2 modes (10 contexts); fixed 4 outliers where --color-primary failed 4.5:1 against bg-primary: ocean light 3.68 → 5.36 (cyan-600 → cyan-700) forest light 3.77 → 5.48 (emerald-600 → emerald-700) sunset light 3.56 → 5.18 (orange-600 → orange-700) default dark 3.45 → 7.02 (blue-600 → blue-400 via minimal.css) minimal.css default-dark lift: --theme-primary was set on :root only, so main.css's `var(--theme-primary, #60a5fa)` fallback never triggered in dark mode. Adding it to minimal.css's dark blocks closes the chain.
Closes #85. Two innerHTML string-concat assignments → inline DOM construction with textContent for user content. Hygiene swap, not a security fix — the prior code escaped via a helper. Removing escapeHTML along with its last callers (no dead code).
…-color Closes #86, #93. articles.css was a 5-line header-comment-only file referenced from base.html — layout for /writing/ comes from components.css. msapplication-navbutton-color is an IE/Edge legacy meta tag (MDN deprecated; no modern browser honors it). Audit-doc claim of stale vnykmshr.github.io URLs in Apple favicons was verified false — zero hits across the repo. #93 narrows to the 1-line legacy-meta drop.
Collaborator
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…nt fallback Mirrors overlayFS.Open's contract (overlay.go:41-46) and CLAUDE.md brand-logo template-overlay pattern. ENOENT stays silent (operator chose not to override); non-ENOENT errors and IsDir misconfig now emit slog.Warn before falling through to embedded. Regression test asserts the warning fires.
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.
Summary
WCAG AA sweep across 5 color presets × 2 modes found 4 link-color contexts failing 4.5:1; all lifted to passing (ocean light 3.68→5.36, forest light 3.77→5.48, sunset light 3.56→5.18, default dark 3.45→7.02). Service worker
CACHE_VERSIONis now auto-injected at server startup from build version — operators no longer track manual bumps. Plus hygiene: prependCardinnerHTML→createElement, vestigial articles.css delete, msapplication-navbutton-color drop.Closes #85, #86, #90, #91, #93. Triage cycle also closed #88, #89, #92, #94, #95 as wontfix (calm-design conflict / no signal / fragile mechanism).
Changes
feat(serve): inject sw.js CACHE_VERSION at startup from build version— embedded__MARKGO_CACHE_VERSION__placeholder substituted once at startup; STATIC_PATH overlay serves raw bytes (operator owns their cache version); fail-loud on missing placeholder; 3 unit + 3 integration tests insw_test.gofeat(a11y): lift --color-primary to AA 4.5:1 across 4 outlier contexts— preset bumps in main.css + minimal.css dark-block--theme-primarylift. Cascade was inert because--theme-primarywas set on:rootunconditionally, defeating thevar(--theme-primary, #60a5fa)fallback chainrefactor(web): replace prependCard innerHTML with createElement chains— already escape-safe; hygiene swap for grep-ability;escapeHTMLhelper deleted with last callerschore(web): delete vestigial articles.css and msapplication-navbutton-color— audit-doc claim of stale vnykmshr.github.io URLs verified false (zero hits across repo); audit-finding: <meta> proliferation audit in base.html (62 tags) #93 narrows to 1-line legacy-meta dropdocs(changelog): v3.17.0 release notesTest plan
make lint && make test-racegreenmake coverage63.7% (CI threshold 45%)curl /sw.js(no STATIC_PATH) → embedded body withCACHE_VERSION = 'dev'substituted; placeholder count = 0curl /sw.js(with STATIC_PATH overlay) → raw operator bytes verbatim, no substitutioncurl /→ 0 references toarticles.cssormsapplication-navbutton-colormarkgo-precache-v3.17.0in DevTools after deploy