Repository navigation
fix(DateInput): the scrolling picker column's rows keep AA contrast; the depth fade uses theme text colours - #9853
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateTimeInput | 168.6 kB (+157 B) · 17.2 kB CSS (+102 B) | — | — · — · — |
| DateInput · Storybook | 148.0 kB (+97 B) · 15.5 kB CSS (+102 B) | 5,042 (+32) | ✓ · ✓ · ✓ |
| PowerSearch | 236.2 kB (+95 B) · 21.8 kB CSS (+94 B) | — | — · — · — |
1 more component
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TimeInput | 132.7 kB (+86 B) · 14.5 kB CSS (+96 B) | — | — · — · — |
Package size: @astryxdesign/core 6.30 MB packed (+670 B); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: core 1 row; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes: the colour fade fixes the mouse wheel column's contrast in every shipped theme, but the new contrast spec also reports the touch column as passing when it is not.
WheelContrast.a11y.chromium.spec.tsrunscore-wheel--touch-minutesthrough a measure that reads onlyopacity, so it passes touch rows thatPickerWheel'smask-imagefade draws at about 2.3–4.1:1. Measure only the scrolling column there and narrow the file header, or fold the mask into the measure.
Two small follow-ups: the comment at PickerWheel.tsx:79-81 still describes the scrolling column's old 0.3 opacity fade, and the new fade comment in Wheel.tsx could keep only its reason.
[Automated review]
| await storybook?.close(); | ||
| }); | ||
|
|
||
| const STORIES = ['core-wheel--minutes', 'core-wheel--touch-minutes']; |
There was a problem hiding this comment.
Blocking: core-wheel--touch-minutes renders PickerWheel, whose rows are faded by the mask-image on its fade layer (PickerWheel.tsx:84-90). rowsBelowAA multiplies only opacity, and axe ignores masks, so these cases pass rows drawn at about 2.3–4.1:1 (the row four out, in 13 of 14 theme × mode cases). Measure only the scrolling column here and narrow the header at lines 8-10, or fold the mask alpha into the measure.
| * The depth cue in colour, on the same timeline. A centred row uses the | ||
| * primary text colour. A row at either end eases halfway to the secondary text | ||
| * colour. That mix meets WCAG AA in every shipped theme. The secondary colour | ||
| * alone does not, and an opacity fade falls below AA. |
There was a problem hiding this comment.
Non-blocking (comment style): the second and third sentences restate the keyframes. Suggested: "Colour keeps every row at WCAG AA, which an opacity fade does not. The ends stop halfway to the secondary text colour, because that colour alone falls below AA in two shipped themes."
…y shipped theme, at rest and still A Chromium spec opens the Core/Wheel minutes story, the scrolling column, in each shipped theme, light and dark, at rest and in the still frame the release audit scans. It runs axe's color-contrast rule, and it measures each row in view itself, from the text colour at its drawn opacity over the backgrounds behind it, because axe reports those rows' backgrounds as unknown inside the scroller. Red: the column fades its rows to 30% opacity, which falls below 4.5:1, and the readout field is white under the theme's text colour in a dark theme.
fa7740c to
236f5ac
Compare
There was a problem hiding this comment.
Requesting changes: the colour fade restores AA contrast for the mouse wheel column in every shipped theme, but it also stops disabled rows from fading.
Wheel.tsx:585leaves disabled rows at full--color-text-disabledat every distance, wheremainfades them to about 0.46–0.73 opacity ascomponent:DateInputDEC-2 has every row fade, so give disabled rows their own scroll-timeline fade and keep a reduced-motion check on a bounded wheel's disabled row, as theWheelRestcase did before it moved to the minutes story.
Small follow-ups: the new comments at Wheel.tsx:174-175 and :192-193 could keep only their reason, and the changeset's "a mouse wheel's rows" reads as the mouse's scroll wheel.
[Automated review]
| {...optionProps(option, index)} | ||
| {...stylex.props( | ||
| styles.item, | ||
| index !== activeIndex && !option.isDisabled && styles.itemFade, |
There was a problem hiding this comment.
Disabled rows skip the fade here and get no other one, so in a bounded sheet they stay at full --color-text-disabled at every distance. On main they fade to about 0.46–0.73 opacity with the rest, and component:DateInput DEC-2 has the column fade its rows. Giving disabled rows their own scroll-timeline fade (for example the old opacity keyframes on their inner span, since WCAG 1.4.3 exempts inactive components) would keep the depth cue there.
| await page.emulateMedia({reducedMotion: 'reduce'}); | ||
| const {hours} = await openHourWheelWithMouse(page); | ||
| await page.goto( | ||
| `${storybook.origin}/iframe.html?id=core-wheel--minutes&viewMode=story`, |
There was a problem hiding this comment.
The previous version of this case checked hour 8 in the bounded TimeInput sheet, a disabled row. On this head that row reports opacity 1 and a constant colour, so the old assertion would fail. Moving to the minutes story drops that coverage; a reduced-motion check on a bounded wheel's disabled row would keep it.
| // themselves out once on the document timeline. Under reduced motion the | ||
| // rows do not tip; the colour fade on the row keeps the depth cue. |
There was a problem hiding this comment.
Non-blocking (comment style): the first half restates the 'none' value. Suggested: "Under reduced motion, the colour fade on the row keeps the depth cue."
| * not move a snap area. The selected row and disabled rows keep their own | ||
| * colours, so only the other rows take it. |
There was a problem hiding this comment.
Non-blocking (comment style): this restates the condition at line 585 without the reason. Suggested: "An animated colour outranks the selected and disabled colours. Those rows do not take this fade."
…the depth fade uses theme text colours The scrolling column faded its rows to 30% opacity toward the ends of its view() timeline, so every row but the centred one fell below 4.5:1. In the still frame the release audit scans, every animation ends, so the selected row fell to 1.9:1 too. The fade now runs on the row's colour: the primary text colour at the centre, easing halfway to the secondary text colour at the ends. That mix meets AA in every shipped theme; the secondary colour alone does not in two. The tip stays on the inner element, and the selected and disabled rows keep their own colours. Disabled rows keep main's opacity fade on the same timeline, which WCAG 1.4.3 allows for inactive components. Under Reduce Motion the rows stay flat and keep the colour fade. The story's readout field takes the theme's colours, so a dark theme no longer draws its text on a white fill.
236f5ac to
b42c08d
Compare
There was a problem hiding this comment.
This looks ready to merge: the colour fade keeps every enabled row of the mouse wheel column at WCAG AA in all seven shipped themes, light and dark, at rest and in the audit's still frame, and disabled rows fade again as they do on main.
- Worth a look before merging: in Neutral light the fade now runs from black to about
#0c0c0cacross the visible rows, so the tip alone carries the depth cue there; Chocolate light and Neutral dark keep a visible fade.
[Automated review]
User impact
Mouse users get the scrolling wheel column in the bottom-sheet presentation. Its rows faded by opacity toward the ends, so rows near the ends fell below WCAG AA at rest (neutral light: 3.50:1 four rows out; matcha light: 2.38:1). The release audit's still frame, with every row at 30% opacity, fails.
Problem and solution fit
view()timeline.So the depth cue moves from opacity to theme text colours.
Expected behavior and authority
WCAG 2.2 SC 1.4.3 (AA): 4.5:1 in every shipped theme, light and dark.
Smallest restoration
Wheel.tsx: the row's colour fades from the primary text colour at the centre to halfway toward the secondary one at the ends. Secondary alone fails AA in chocolate light (3.06:1) and matcha light (4.41:1); the mix passes everywhere.Before and after
Desktop
core-wheel--minutes, still frame (rows at their fade end); chocolate is main's lowest theme. Accent:--color-text-accent; mix: the halfway mix.Evidence
WheelContrast.a11y.chromium.spec.ts, axe plus per-row measure of the scrolling column.Scope
Testing
At b42c08d on main 55aaeda:
node .github/scripts/accessibility-audit.js --components Wheel --baseline .github/a11y-baseline.json --fail-on-newon a build with main's Wheel, story and themes: 1 new serious color-contrast node incore-wheel--minutes, and the gate fails. On this head, over Wheel, DateInput, TimeInput and DateTimeInput: 0 violations, and the gate passes.WheelContrast.a11y.chromium.spec.ts(the scrolling column): 7 of 7 fail at the test commit, and 7 of 7 pass at the head.WheelRest.a11y.chromium.spec.ts: 11 of 11, including a disabled row's fade under Reduce Motion, which fails on the previous head.CI=1): 130 passed. Chromium interaction specs for DateInput, TimeInput and DateTimeInput: 22 passed, 2 skipped.check:changesets,check:knowledge,check:repo,check:motion-roles,check:token-docs,sync:exports:checkandverify-exportspass.review:prefinds nothing (377 authored lines).