Skip to content

#251 — per-theme AA token repair + universal 8-theme AA matrix guard - #273

Merged
cmbays merged 1 commit into
mainfrom
render-251-aa-token-palette
Jun 12, 2026
Merged

cmbays merged 1 commit into
mainfrom
render-251-aa-token-palette

Conversation

@cmbays

@cmbays cmbays commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Repairs every (theme × token) pair the #264 adversarial verification measured below WCAG AA 4.5:1, at token level in templates/partials/tokens.css (the #206 deepening pattern — since #264 the tokens live in one place, so the report and explore pages repair simultaneously), and ships the universal 8-theme AA contrast-matrix headless guard so this class of regression is caught mechanically, not by audit.

Two surgical companions the guard pins:

Latte/rosepine muted and the latte accent adopt the themes' own deeper steps already established by the #198/#227 scoped stand-ins (Catppuccin subtext1 #5c5f77, latte blue #1a5cdd, rosepine #5d5780). All other shifts are minimal lightness-only moves (hue/saturation kept). Light and Dark are untouched — they already passed everywhere.

Before → after AA matrix (measured live in headless Chromium, effective composited backdrops)

Theme Surface Before After
solarized accent nav link on --bg 3.41 5.00
solarized diff add-sigil + on composited add-row 2.81 4.61
solarized diff rem-sigil - 3.77 4.57
solarized removed-line word-emphasis 3.53 4.59
solarized muted (.code-filename / badge, worst-of) 4.33–4.50 4.75
latte accent nav link on --bg 4.34 5.13
latte accent-hover on --bg-alt 2.62 4.55
latte muted on --bg / --surface-2 4.06–4.37 5.14–5.53
latte removed-line word-emphasis 4.08 4.56
rosepine muted on --bg (degrade/hint copy) 3.53 4.82
rosepine row-count badge (muted on --surface-2) 3.77 5.15
rosepine accent nav link on --bg 4.40 4.59
rosepine accent-hover on --bg 2.47 4.56
rosepine removed-line word-emphasis 3.80 4.58
tokyo row-count badge (muted on --surface-2) 4.41 4.58
tokyo added-line word-emphasis 3.27 4.60
tokyo removed-line word-emphasis 4.22 4.61
gruvbox row-count badge (muted on --surface-2) 4.17 4.59
gruvbox diff rem-sigil 4.36 4.55
gruvbox added-line word-emphasis 3.81 4.56
dracula diff rem-sigil 4.47 4.56
dracula added-line word-emphasis 4.05 4.64

Full post-repair sweep: 8 themes × 9 report surfaces = 72 cells, all ≥ 4.55 (plus the extended explore dag/tests sweeps).

The guard

report_aa_token_palette_matrix_on_every_theme (tests/headless_toggle.rs) renders one PR-diff report carrying every #251 surface and, per theme:

  • measures effective composited colors — the backdrop walk collects every painted fill up to the first opaque one and alpha-composites top-down (the dark themes' rgba row/word tints are composited, never skipped);
  • kills transitions/animations before any read; asserts checkVisibility() on every target (drawers opened first); pins the unified diff layout so the measured sigil/word instances are the painted ones;
  • pins an opacity-dimming guard: any self-or-ancestor computed opacity < 1 on a measured surface fails loudly (the polish: latte suppress-chip 4.37 sub-AA + suppressed-row opacity vs AA (design decision) #227 rule);
  • injects a bare <a> probe on <body> to exercise the shipped a { color: var(--accent) } chassis rule — the exact combo the C3 matrix measured on the explore nav;
  • pins .ds-num aria-hidden parity with the unified .diff-gutter.

The explore twins (explore_dag_page_themes_correctly_on_every_theme, explore_tests_page_themes_correctly_on_every_theme) are extended with the C3 combos: muted-on-bg (counts/hint/test-shape), accent-nav-on-bg, and muted-on-surface-2 (the row-count badge — the matrix's worst muted offender, 3.77 on rosepine pre-repair).

RED-proof

With ONLY templates/partials/tokens.css reverted (git stash push -- templates/partials/tokens.css) and the guard code in place:

  • the report guard FAILED with 24 sub-AA cells reproducing the measured C3 matrix verbatim — solarized/accent-link-on-bg = 3.41, solarized/diff-add-sigil = 2.81, rosepine/muted-hint-on-bg = 3.53, latte/row-count-badge-muted = 4.06, tokyo/diff-add-word = 3.27, gruvbox/diff-rem-sigil = 4.36, dracula/diff-add-word = 4.05, …
  • the explore sweeps FAILED on the same pairs — [tests.html] rosepine/row-count-badge-muted-on-surface2 = 3.77, tokyo … = 4.41, gruvbox … = 4.17, [dag.html] solarized/nav-link-on-bg = 3.41, …

After git stash pop: all three guards PASS (worst cell 4.55). The guard demonstrably measures the painted, composited values it claims to.

Golden regeneration audit

All four example-report-check rows regenerated with the exact ci.yml recipes (jaffle-shop, playground, diff-showcase via report; explore via explore --out-dir), over the merged tree including #272's fixture changes. git diff --text -U0 -- examples/ audit: all 349 changed lines are token-value CSS, the #251 comment blocks, the sigil opacity removal, and the .ds-num aria-hidden parity — zero structural HTML drift. No root_path/username strings in any regenerated artifact (regenerated from committed synthetic fixtures only).

The render_integration insta snapshot was regenerated for the same inlined-CSS/JS changes (same audit, same result).

Gates (run directly, all green)

  • cargo fmt --check ✓
  • cargo clippy --all-targets --locked -- -D warnings ✓
  • cargo nextest run — 1276 passed ✓
  • cargo test --test bdd — 163 scenarios / 1044 steps passed ✓
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --locked ✓
  • cargo deny check ✓
  • full headless suite --ignored: headless_toggle 72/72, headless_zero_egress 10/10 ✓

Closes #251

🤖 Generated with Claude Code


Open in Stage

…matrix guard

Repair every (theme x token) pair the #264 adversarial verification
measured sub-AA, at TOKEN level in templates/partials/tokens.css (the
#206 deepening pattern; since #264 the tokens live in one place so the
report and explore pages repair simultaneously):

- --text-muted deepened on solarized/latte/rosepine/gruvbox, lightened
  on tokyo (worst-of bg/bg-alt/surface/surface-2/code-header-bg/code-bg
  now 4.58-5.31); latte/rosepine adopt the established #198/#227
  scoped stand-ins (Catppuccin subtext1 #5c5f77, rosepine #5d5780)
- --accent / --accent-hover deepened on solarized/latte/rosepine
  (worst-of bg/bg-alt/surface now 4.55-4.77)
- --code-add/rem-sigil per-theme repairs (solarized 2.81 -> 4.61) and
  .diff-sigil opacity dimming removed (the #227 composited-opacity
  rule: tokens carry the full painted ratio)
- --code-add/rem-word: dark themes' tint alphas lowered, light themes'
  rem-word hexes lightened (body text on composited word now >= 4.56)
- split-view .ds-num cells gain aria-hidden parity with the unified
  .diff-gutter (decorative positional metadata, the #178 idiom)

Guards (tests/headless_toggle.rs): a universal 8-theme AA matrix sweep
on the report (9 surfaces x 8 themes, effective alpha-composited
backdrops, transitions killed, checkVisibility-asserted, opacity-dimming
pin, injected accent-link probe) + the explore dag/tests sweeps extended
with the C3 combos (muted-on-bg, accent-nav-on-bg, muted-on-surface-2).
RED-proven: with tokens.css reverted the guards fail on exactly the
measured C3 matrix pairs; with the repair they pass at >= 4.55.

Goldens regenerated via the example-report-check recipes (jaffle-shop,
playground, diff-showcase, explore) — only token-value CSS + the sigil/
aria-hidden changes appear, zero structural HTML drift, no path leaks.

Closes #251

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cmbays, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 55 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1b0ebeff-9b23-460f-b6c0-cdb628c4513c

📥 Commits

Reviewing files that changed from the base of the PR and between 17b1367 and efd0d50.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/render_integration__rendered_chrome_jaffle_shop.snap is excluded by !**/*.snap
📒 Files selected for processing (9)
  • examples/diff-showcase-report.html
  • examples/explore/dag.html
  • examples/explore/tests.html
  • examples/jaffle-shop-report.html
  • examples/playground-report.html
  • templates/interaction.js
  • templates/partials/tokens.css
  • templates/report.css
  • tests/headless_toggle.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch render-251-aa-token-palette

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ghost

ghost commented Jun 12, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 5 individual chapters for you:

Title
1 Deepen theme tokens for WCAG AA compliance
2 Remove sigil opacity and add accessibility metadata
3 Implement universal AA contrast-matrix guard
4 Propagate theme repairs to example reports
5 Other changes
Open in Stage

Chapters generated by Stage for commit efd0d50 on Jun 12, 2026 2:58am UTC.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements per-theme WCAG AA contrast ratio repairs (>= 4.5:1) across several themes (Tokyo, Solarized, Gruvbox, Latte, Rose Pine) by adjusting color tokens, removing opacity dimming on diff sigils, and adding accessibility attributes (aria-hidden="true") to split-view line numbers. It also introduces a comprehensive headless browser test sweep to verify these contrast ratios programmatically. The reviewer feedback suggests that when parsing the results of the headless contrast sweep, unexpected or malformed shapes should fail loudly using .expect() instead of being gracefully tolerated with unwrap_or('?').

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/headless_toggle.rs
@github-actions

Copy link
Copy Markdown
Contributor

📄 Rendered report preview

All golden examples regenerated cleanly.

🟡 Golden examples

Committed to examples/ and byte-identity gated — the canonical reports contributors and consumers browse. Stable across PRs.

Report View Download
playground-report.html ▶ Open ↗ ⬇ Download
jaffle-shop-report.html ▶ Open ↗ ⬇ Download
diff-showcase-report.html ▶ Open ↗ ⬇ Download

🐶 Live dogfood preview

This PR doesn't touch dbt-project/, so there's no live dogfood preview.

▶ Open ↗ opens the report in your browser in one click —
published to this repo's GitHub Pages under /pr-273/.
⬇ Download fetches the same self-contained HTML as a workflow
artifact (auth-gated; works fully offline). Either way the report
makes zero external resource requests.

The Pages preview may take ~1 min to update after this comment
posts. On PRs from forks the Open link is unavailable (read-only
token) — use Download.

Alternative: GitHub CLI
# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27391567592 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.html

Posted by report-preview.yml for efd0d5053e5903f8873f4ac9a567ff90f810e8b6. Affordance only — never blocks merge.

@cmbays
cmbays merged commit a10964b into main Jun 12, 2026
33 checks passed
@cmbays
cmbays deleted the render-251-aa-token-palette branch June 12, 2026 03:05
github-actions Bot added a commit that referenced this pull request Jun 12, 2026
@cmbays

cmbays commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Overnight orchestration wrap-up

Merged as a10964b (squash) under Christopher's overnight authority — CI fully green, push verified (origin == head efd0d50), 1 review thread dispositioned (Gemini fail-loud suggestion rejected with probe evidence: the unwrap_or(\"?\") is diagnostic-string-only; pass/fail is gated by the 8×9 cell-count assert + ratio > 0.0, a malformed fg/bg emits ratio −1 which trips loudly, and an .expect mid-loop would abort before the aggregated failure list is built — matching the assert_explore_page_themes precedent from #264). Issue #251 auto-closed ✔.

What shipped: 22 per-theme token repairs (solarized/latte/rosepine/tokyo/gruvbox/dracula), the #227 composited-opacity removal pinned, split-view aria-hidden parity, and the universal 8-theme × 9-surface AA matrix guard with alpha-composited effective backdrops. RED-proof reproduced the C3 matrix verbatim (24 failing cells with old tokens; worst cell 4.55 after repair).

Lineage note: built by a recovery agent after the original builder died on an API error — the WIP guard draft was intact but token repairs had never been written; they were derived fresh and verified against the C3 matrix.

🤖 Generated with Claude Code

cmbays added a commit that referenced this pull request Jun 12, 2026
The all-theme 50% accent mix for .ov-tooltip .ov-key lands 3.69:1 on
latte's #4c4f69 tooltip fill (WCAG AA floor 4.5:1) — the accent-family
dark-fill surface the #273 token matrix never measured. Add the
latte-scoped 35% stand-in (the symmetric twin of #233 D4's .ct-key
repair; measured 4.76 PASS, 40% still fails at 4.38) and extend the AA
guard family with ov_tooltip_ov_key_meets_aa_contrast_on_every_theme:
canvas-normalized color-mix fg, alpha-composited effective backdrop,
transition kill, checkVisibility hygiene, through the real showOvTip
reveal path. RED-proven: the guard fails latte = 3.69 on the unfixed
CSS. Goldens regenerated per the example-report-check recipes (the
only delta is the new rule); jaffle chrome snapshot re-accepted.

Closes #238

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

design: shared block-diff palette + muted-text surfaces sub-AA on latte/rosepine/solarized (measured)

1 participant