Skip to content

feat(v3.17.0): WCAG AA contrast verification + sw.js cache auto-bump#96

Merged
vnykmshr merged 6 commits into
mainfrom
feat/v3.17.0
May 18, 2026
Merged

feat(v3.17.0): WCAG AA contrast verification + sw.js cache auto-bump#96
vnykmshr merged 6 commits into
mainfrom
feat/v3.17.0

Conversation

@vnykmshr
Copy link
Copy Markdown
Collaborator

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_VERSION is now auto-injected at server startup from build version — operators no longer track manual bumps. Plus hygiene: prependCard innerHTMLcreateElement, 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

  • C1 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 in sw_test.go
  • C2 feat(a11y): lift --color-primary to AA 4.5:1 across 4 outlier contexts — preset bumps in main.css + minimal.css dark-block --theme-primary lift. Cascade was inert because --theme-primary was set on :root unconditionally, defeating the var(--theme-primary, #60a5fa) fallback chain
  • C3 refactor(web): replace prependCard innerHTML with createElement chains — already escape-safe; hygiene swap for grep-ability; escapeHTML helper deleted with last callers
  • C4 chore(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 drop
  • C5 docs(changelog): v3.17.0 release notes

Test plan

  • make lint && make test-race green
  • make coverage 63.7% (CI threshold 45%)
  • Playwright contrast re-audit: all 10 contexts ≥4.5:1
  • curl /sw.js (no STATIC_PATH) → embedded body with CACHE_VERSION = 'dev' substituted; placeholder count = 0
  • curl /sw.js (with STATIC_PATH overlay) → raw operator bytes verbatim, no substitution
  • curl / → 0 references to articles.css or msapplication-navbutton-color
  • Playwright prependCard simulation: both branches render hostile content as textContent (no script/img injection)
  • Post-merge: SW cache names show markgo-precache-v3.17.0 in DevTools after deploy

vnykmshr added 5 commits May 18, 2026 22:05
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.
@vnykmshr
Copy link
Copy Markdown
Collaborator Author

Code review

No 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.
@vnykmshr vnykmshr merged commit 8a21e32 into main May 18, 2026
6 checks passed
@vnykmshr vnykmshr deleted the feat/v3.17.0 branch May 18, 2026 16:45
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.

audit-finding: <link rel="modulepreload"> opportunities audit-finding: innerHTML on draft card rendering in compose-sheet.js

1 participant