Repository navigation
Phase 31 slice H: state checks - #252
Merged
Merged
Conversation
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.
Slice H of Phase 31 (docs/specs/PHASE-31-SPEC.md, FR-H1 to FR-H4): the element states, checked without being drawn. The evaluator now computes, from the scene alone, what the renderer draws for every target's focus ring, active indicator, disabled look and boundary, and judges each against WCAG 1.4.11. The spec's "Slice H — contracts pinned before build" block (R1 to R11) records the contracts, and the "Slice H — as built" block (T1 to T4 and both rounds of fixes) records what changed during the build and verification.
What changes
desktop-app-focus-visible(error). A target's focus ring below 3:1 against the pixels it covers when the target is not focused: the backdrop behind it for the ring drawn outside the box, and a tab's own fill for the ring drawn inside it. Targets that share a ring and a backdrop make one error, withnodeIdsandcount. A target whose backdrop or ring the checker cannot read is listed in one info.desktop-app-state-contrast(warning). An activenav-item's bar or an active line tab's underline below 3:1 against its active fill, at rest or with the hover layer over it.desktop-app-boundary(warning). Atext-inputborder, an uncheckedcheckboxorradiooutline, or an uncheckedtoggletrack below 3:1 against what is behind it. A border that draws nothing (transparent, a misspelt token) counts as invisible. A field whose own fill clears 3:1 passes, because the fill shows its edge.desktop-app-disabled(info). When the state tokens make a disabled target look like its enabled self (within 1.1:1).colorcategory, in each theme the canvas ships. They give the same answer in fast and detailed mode. A dark finding that only repeats the light one (literal colours, which no theme changes) is dropped. A finding on targets inside a component instance says the design system never reaches them.evaluate.tsto a newsrc/color-math.ts, with the backdrop walk the text-contrast check and the state checks now share.parseAlphanow reads a percent alpha:rgba(0, 0, 0, 50%)is 0.5, where it was read as opaque. That is the only verdict change outside the new rules.canvas_evaluatedocstring, a new block indocs/GUIDELINES.md's desktop-app ruleset, four README rule rows and thecolorcategory row, and VISION.md.Decisions worth a look
$focus-ringis picked against the plain surfaces. This is the change-of-contrast reading of WCAG 2.4.13. A canvas that raisesstate.focusfar above Material's 0.10 can hide a tab's ring under its own focus layer without a finding; that is recorded as accepted.tree-rowand the containedtabsshow their active state with a tint and a heavier weight only, so the indicator rule has nothing to measure on them.selectis not in FR-H4, though its border is its only boundary too. Both are follow-ups in VISION.md.apply_presetaftergenerate_design_systemcan leave$accent-tintand$border-strongout of step with the preset's surfaces. The warnings that then appear are true, and the slice D gate applies presets on their own, so it does not cover this case.Testing
test-state-checks.ts(fast, 226 checks) covers each FR-H acceptance with a twin that must fail, every rule's gate on its own, the exact 3.00 and 1.10 thresholds, every target type's colours, the overlay and item backdrops, instances, both themes, the web and mobile exclusions, and a gate. The gate generates every personality × three seeds in both themes, with every target on eachbg-*and*-tintsurface, and expects no finding. A twin breaks the tokens and finds each rule on the surface it was planted on.test-state-model-render.ts(Chrome) renders the targets unthemed and under a generated system in both themes, and compares 127 pixels with the model's colours within 2/255 per channel. The pixels cover rings and what they cover, indicators in rest and hover, every button variant's layers, an authored opacity, disabled tracks and containers, boundaries, a modal's close button and actions, and a translucent ink. A twin shows a model 0.05 off in layer opacity fails the same comparison.npm run test:full: 136/136 on 3295307. Two runs during verification each had one test time out under machine load (load average 7 to 8); both passed when rerun alone.