Repository navigation
test(templates): axe every concept, and measure gradient plates in pixels - #394
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds a dedicated ChangesTemplate accessibility coverage
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/e2e/templates-a11y.e2e.spec.ts (1)
89-92: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winSettled-transform check misses 3D identity matrices.
Only
'none'and the 2D identity'matrix(1, 0, 0, 1, 0, 0)'count as settled. If a concept's@media (prefers-reduced-motion: reduce)net resolves to a 3D transform (e.g. viatranslate3d/transform3dshorthand, which Chromium reports asmatrix3d(...)), this would misreport a genuinely settled element as unsettled and fail the suite for the wrong reason.♻️ Broaden the identity check
const settledTransform = - style.transform === 'none' || style.transform === 'matrix(1, 0, 0, 1, 0, 0)' + style.transform === 'none' || + style.transform === 'matrix(1, 0, 0, 1, 0, 0)' || + style.transform === 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/e2e/templates-a11y.e2e.spec.ts` around lines 89 - 92, Update the settledTransform check in the accessibility wait logic to also recognize Chromium’s 3D identity transform matrix as settled, alongside 'none' and the existing 2D identity matrix. Keep the opacity requirement and current continuation behavior unchanged.tests/e2e/support/painted-contrast.ts (1)
88-117: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
skippedNoGlyphPixelsis a bare count;skippedUnresolvedgets a per-selector list.Every other skip category that can hide a real failure (
unresolvedSelectors) keeps enough detail to know which node was dropped and why. A candidate that yields zero glyph pixels (channel collision with the sentinel, or coverage below the floor) only bumps a counter — there's no way to tell which selector it was without re-instrumenting. Given the PR's explicit goal of never treating "unmeasurable" as "passed," recording the dropped selectors here too would make this failure mode as debuggable as the unresolved one.♻️ Sketch
/* Nodes whose box held no glyph pixels (text painted by a child element, or clipped away) — nothing to measure, so nothing is claimed about them. */ skippedNoGlyphPixels: number + /* Selectors of nodes that fell into skippedNoGlyphPixels, for the same + reason unresolvedSelectors exists — a skip should never hide which node + it applied to. */ + skippedNoGlyphPixelsSelectors: string[]const scored = scoreCandidate(candidate, glyphs, plate) if (!scored) { report.skippedNoGlyphPixels += 1 + report.skippedNoGlyphPixelsSelectors.push(candidate.selector) continue }Also applies to: 562-572
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/e2e/support/painted-contrast.ts` around lines 88 - 117, Extend PaintedContrastReport and the reporting logic that increments skippedNoGlyphPixels to retain the selectors for every node dropped because no glyph pixels were found. Add a dedicated selector list for this category, populate it at the same decision points as the count, and preserve the existing skippedUnresolved selector tracking separately.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/e2e/support/painted-contrast.ts`:
- Around line 88-117: Extend PaintedContrastReport and the reporting logic that
increments skippedNoGlyphPixels to retain the selectors for every node dropped
because no glyph pixels were found. Add a dedicated selector list for this
category, populate it at the same decision points as the count, and preserve the
existing skippedUnresolved selector tracking separately.
In `@tests/e2e/templates-a11y.e2e.spec.ts`:
- Around line 89-92: Update the settledTransform check in the accessibility wait
logic to also recognize Chromium’s 3D identity transform matrix as settled,
alongside 'none' and the existing 2D identity matrix. Keep the opacity
requirement and current continuation behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d6f93e60-9e40-4f6e-80c0-7ca059156b3a
📒 Files selected for processing (7)
CONTRIBUTING.mdtests/e2e/support/painted-contrast.tstests/e2e/templates-a11y.e2e.spec.tstests/e2e/templates.e2e.spec.tstests/int/e2e-runner.int.spec.tstests/int/painted-contrast.int.spec.tstools/run-e2e.ts
…xels The accessibility sweep in templates.e2e.spec.ts was pinned to templateShowcases[0], so only one concept's scoped theme and hand-tuned contrast was ever checked. Move it to its own isolated Playwright batch covering the gallery plus every concept's detail page and full preview at 1280 and 390, data-driven from the registry so a new concept is covered on registration. Two hazards the widened sweep has to handle: Un-settled reveals. Straight after goto, in-view sections are mid-fade and axe reads ~13%-opacity ink as a serious contrast violation. Run under reducedMotion, where the CSS nets pin the final frame before hydration, and assert it rather than trust it: any [data-template-section] or data-*-reveal element still mid-transition fails the run by name, so a future concept that ships a reveal without its prefers-reduced-motion net cannot reintroduce flake quietly. Gradient plates. axe cannot resolve a gradient or image background, so it reports text over one as `incomplete`, never as a violation — 13 to 72 unjudged nodes per page, including every hero plate. tests/e2e/support/ painted-contrast.ts scores exactly those pairings against painted pixels: it repaints all ink in a sentinel colour, captures, repaints it transparent, captures again, solves per-pixel glyph coverage from the two, then composites the authored colour at its real opacity over the background the plate capture shows underneath. What it cannot score — gradient-filled ink, cross-frame nodes, the fixed preview-exit pill — is counted and logged, never silently passed. Three things it took mutation testing to get right, all recorded in the module comment: a plain ink-on/ink-off diff mask thins out exactly when contrast is low, so a real failure read as "nothing to measure"; the ink override has to be inline !important or an author `!important` colour outranks it and the node looks identical in both captures; and translucent ink has to be composited, because text-foreground/70 is not the colour the browser paints. Injected colour, alpha, and ancestor-opacity regressions are each caught at 1.10-1.50:1 while axe still reports zero violations. Co-Authored-By: Claude Opus 5 <[email protected]>
94911c5 to
b980b99
Compare
|
Deployment failed with the following error: |
…r adoption, template a11y (#409) Brings main level with dev (137 commits). Headline items: - the component wall no longer crops blocks: per-breakpoint zoom pins the twins' inner layout width at 1280px (#392), and the 640-1023px band gets a 256px frame plus a widened fade (#399). Production was cutting content-quote, content-feature-media and content-feature-split by 88/79/78px on a tablet; measured on the live site, not inferred. Three viewport tests now assert the fit so a curated-at-one-width regression cannot recur silently. - prettier is adopted: config matched to the house style (#402), the tree formatted, and format:check gated in test:release and the CI lint step (#408). - template a11y and layout fixes (#394, #398, #404), consent gate split by provider (#400), axe now waits for the consent banner (#405), CodeQL double-escaping fix (#391). Tree is identical to dev by construction: branched from dev, reparented onto main, so the diff is exactly the main..dev delta with no squash-divergence conflicts.
…e days Triaged every bot review on the 60 PRs merged since 2026-07-24. Copilot was quota-limited on all of them and Codex's one finding (#340 Linux baselines) was handled by #342, so everything actionable is CodeRabbit's. Most of its findings were already closed by #378/#380 or superseded by later work; two were false positives. These five were still open and worth taking. - frontend.e2e: pin the tablet wall fade (#399). The 2.75rem override IS that PR, and nothing asserted it — the existing fade check runs at 390px, outside the 640-1023px query, so deleting the rule stayed green, and the overrun ceiling is deliberately loose enough (60px) to swallow the 44px residue too. Asserted exactly, because matching the residue is the point. - templates-a11y: accept the 3D identity as settled (#394). A reveal written with translate3d, or carrying a translateZ(0) compositor hint, serialises as matrix3d — the check saw only the 2D identity and would have failed the gate for a reveal sitting exactly where it belongs. - painted-contrast: name the no-glyph-pixel skips (#394). unresolvedSelectors already exists so a skip cannot hide which node it dropped; this is the other way an unmeasurable node leaves the run, and it was a bare count. - ComponentWall: fix the zoom comment (#396). It claimed every card shows true desktop proportions at every size. zoom pins the 1280px layout width, not the breakpoint — frontend.e2e's own comment says as much — and that claim is exactly what would mislead the next person curating frame heights. - CONTRIBUTING: document the changed-vs-all snapshot trap (#375). A bare --update-snapshots skips baselines whose diff lands under tolerance, which is the same stale-baseline half-mint the section warns about, minus the missing file that would have revealed it. visual-baselines.yml explains this at length; the local instructions did not. Skipped, with reasons: tokenising the wall fade heights and the mask-image black stops (#399/#396/#370) — the token rule scans component utilities, not globals.css, which defines tokens and carries raw lengths throughout, and a mask's black is an alpha keyword rather than a colour; fading only confirmed-overflow cards (#396) — the valve exists for content that has not changed yet; moving privacy copy into site.ts (#372) — real per AGENTS.md, but about/blog/brand-guide hold local copy too, so this belongs in one deliberate pass; subset-aware blog visual validation (#375) — outputRoot defaults to the repo, so a --slug render is incremental against committed assets and the full-catalog gate is the correct final check. Verified: lint, tsc, the three affected int specs, and both e2e specs green (frontend 44 passed, templates-a11y 43 passed) in production mode. Co-Authored-By: Claude Opus 5 <[email protected]>
…e days (#411) Triaged every bot review on the 60 PRs merged since 2026-07-24. Copilot was quota-limited on all of them and Codex's one finding (#340 Linux baselines) was handled by #342, so everything actionable is CodeRabbit's. Most of its findings were already closed by #378/#380 or superseded by later work; two were false positives. These five were still open and worth taking. - frontend.e2e: pin the tablet wall fade (#399). The 2.75rem override IS that PR, and nothing asserted it — the existing fade check runs at 390px, outside the 640-1023px query, so deleting the rule stayed green, and the overrun ceiling is deliberately loose enough (60px) to swallow the 44px residue too. Asserted exactly, because matching the residue is the point. - templates-a11y: accept the 3D identity as settled (#394). A reveal written with translate3d, or carrying a translateZ(0) compositor hint, serialises as matrix3d — the check saw only the 2D identity and would have failed the gate for a reveal sitting exactly where it belongs. - painted-contrast: name the no-glyph-pixel skips (#394). unresolvedSelectors already exists so a skip cannot hide which node it dropped; this is the other way an unmeasurable node leaves the run, and it was a bare count. - ComponentWall: fix the zoom comment (#396). It claimed every card shows true desktop proportions at every size. zoom pins the 1280px layout width, not the breakpoint — frontend.e2e's own comment says as much — and that claim is exactly what would mislead the next person curating frame heights. - CONTRIBUTING: document the changed-vs-all snapshot trap (#375). A bare --update-snapshots skips baselines whose diff lands under tolerance, which is the same stale-baseline half-mint the section warns about, minus the missing file that would have revealed it. visual-baselines.yml explains this at length; the local instructions did not. Skipped, with reasons: tokenising the wall fade heights and the mask-image black stops (#399/#396/#370) — the token rule scans component utilities, not globals.css, which defines tokens and carries raw lengths throughout, and a mask's black is an alpha keyword rather than a colour; fading only confirmed-overflow cards (#396) — the valve exists for content that has not changed yet; moving privacy copy into site.ts (#372) — real per AGENTS.md, but about/blog/brand-guide hold local copy too, so this belongs in one deliberate pass; subset-aware blog visual validation (#375) — outputRoot defaults to the repo, so a --slug render is incremental against committed assets and the full-catalog gate is the correct final check. Verified: lint, tsc, the three affected int specs, and both e2e specs green (frontend 44 passed, templates-a11y 43 passed) in production mode. Co-authored-by: Claude Opus 5 <[email protected]>
Why
tests/e2e/templates.e2e.spec.tsran its accessibility describe block againsttemplateShowcases[0]only. With ten concepts in the gallery — each with its own scoped theme, palette, and hand-tuned contrast — nine of ten had no automated a11y coverage. Every concept was verified by its author at build time; nothing stopped a regression after that.What
tests/e2e/templates-a11y.e2e.spec.ts— 43 tests: the gallery plus every concept's detail page and full preview at 1280 and 390. Data-driven fromsrc/lib/templates/registry, so a new concept is covered the moment it is registered.templates-a11yintools/run-e2e.ts), the waytemplates-visualis isolated, and pinned in both places intests/int/e2e-runner.int.spec.ts. ~54s in the gate.tests/e2e/support/painted-contrast.ts— the contrast check axe cannot make (below).tests/int/painted-contrast.int.spec.ts— the WCAG maths and the report contract.templates.e2e.spec.ts, leaving a pointer comment.CONTRIBUTING.mdgains a short section on the two hazards, so the next person extending this suite does not rediscover them.The two hazards, handled
1. Un-settled reveals. Straight after
goto, in-view sections driven byTemplateSectionReveal(and the per-concept reveals layered on top) are mid-fade, and axe reads ~13%-opacity ink as a serious colour-contrast violation. The suite runs underreducedMotion: 'reduce', where the CSS nets pin the final frame before hydration — and then asserts it rather than trusting it: any[data-template-section]ordata-*-revealelement still mid-transition fails the run by name. A future concept that ships a reveal attribute without its@media (prefers-reduced-motion: reduce)net cannot quietly reintroduce flake. This is load-bearing: without reduced motion the same pages produce serious violations on agency-studio and nonprofit-cause, and up to 38 unsettled elements.2. Gradient plates. axe cannot resolve a gradient or image background, so it reports text over one as
incomplete, never as aviolation— 13 to 72 unjudged nodes per page here, including every hero plate. A green axe run proves nothing about them. The preview sweeps hand that list to the painted-contrast helper, which repaints all ink in a sentinel colour, captures, repaints it transparent, captures again, solves per-pixel glyph coverage from the pair, then composites the authored colour at its real opacity over the background the plate capture shows underneath. What it cannot score — gradient-filled ink, cross-frame nodes, theposition: fixedpreview-exit pill — is counted and logged, never silently passed. Every run prints how many pairings it scored and what it could not, so "green" is never mistaken for "everything was checked".Three things mutation testing caught
All recorded in the module comment, because each looked fine and was not:
!important; an author rule like.hero-title { color: … !important }outranks any*selector and leaves the node identical in both captures.text-foreground/70is not the colour the browser paints, and the templates usetext-*/NNin 27 places. Taking it at face value flatters every translucent run.Injected colour, alpha, and ancestor-
opacityregressions are each caught at 1.10–1.50:1 while axe still reports zero blocking violations.Findings worth a look (no action in this PR)
tools/templates/capture.tsalready does for posters.Verification
pnpm test:releaseon this branch: green, batches 40 / 69 / 102 / 43 / 130, int 379 passed. (One earlier run failed onENOSPC— the dev box's disk, not the code.)🤖 Generated with Claude Code
Summary by CodeRabbit
Accessibility
Documentation
Testing