Repository navigation
spec(a11y): Slider adopts APG Slider; horizontal arrows follow the track's direction - #7463
Conversation
…ack's direction AR1 and DEC-2: role slider per thumb with name, value properties, aria-orientation and aria-disabled; arrows step, horizontal arrows follow the painted track (ArrowLeft increases under RTL), PageUp/PageDown step by ten, Home/End to the bounds, range thumbs never cross.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec fe7aa08 |
PR Analysis ReportView Storybook for this PR · View Sandbox for this PR
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval needs a maintainer to confirm AR1 and DEC-2 as the governing Slider spec for this addition — the APG Slider pattern per thumb and reversed horizontal arrows under RTL — because the specs on main do not state it yet. What must be settled is whether this contract becomes current now, while main's Slider still raises the value on ArrowRight under RTL and the adoption rule and evidence it cites are not on main, or only after they land. Independently of that decision, the record needs these fixes:
- The accessibility, compatibility and public-concepts sections still say keyboard behavior and runtime are unchanged, which contradicts AR1.
- AR1 cites
spec:AST-020/FR15, which does not exist on main yet. - The AR1 verification row names a Slider accessibility contract and an RTL arrow test that are not in the repository, and the current suite has no Page Up/Down, End or Up/Down assertions.
- AR1 says every thumb is a Tab stop and End reaches
max, but a disabled thumb withoutdisabledMessageis not focusable and End stops at 99 formin={0} max={100} step={3}.
[Automated review]
| range-thumb naming, description/status association, keyboard behavior, disabled | ||
| behavior, or value-tooltip behavior. |
There was a problem hiding this comment.
This sentence now contradicts AR1 just below, which contracts name, value, keyboard and disabled behavior and reverses the RTL arrows. The Compatibility lines (“Released default preserved: yes”, “runtime … remain unchanged”) and Public concepts (“without adding or changing … behavior”) have the same problem. Consider scoping them to the DEC-1 theming target and stating AR1's RTL change in Compatibility.
| range-thumb naming, description/status association, keyboard behavior, disabled | ||
| behavior, or value-tooltip behavior. | ||
|
|
||
| - **AR1 — Slider adopts the APG Slider pattern** (`spec:AST-020/FR15`), each |
There was a problem hiding this comment.
spec:AST-020/FR15 is not on main yet; AST-020 currently ends at FR14 and DEC-3. If this lands first, the citation resolves to nothing. Cite a current claim (FR2 already lets a component contract record the APG pattern it adopts) or land this after the AST-020 change.
| thumb as one composite control: every thumb is `role="slider"` with an | ||
| accessible name (a range names each thumb), `aria-valuemin`, `aria-valuemax`, | ||
| `aria-valuenow`, `aria-valuetext` when a formatter changes the spoken value, | ||
| `aria-orientation`, and `aria-disabled` when disabled; it is a Tab stop. |
There was a problem hiding this comment.
As written every thumb is a Tab stop, but a disabled thumb without disabledMessage gets tabIndex={-1} (Slider.tsx, covered by the “remains non-focusable when disabled without a reason” test). Suggest: “an enabled thumb is a Tab stop; a disabled thumb stays focusable only with disabledMessage.”
| accessible name (a range names each thumb), `aria-valuemin`, `aria-valuemax`, | ||
| `aria-valuenow`, `aria-valuetext` when a formatter changes the spoken value, | ||
| `aria-orientation`, and `aria-disabled` when disabled; it is a Tab stop. | ||
| ArrowUp and ArrowDown step by `step`; on a horizontal track the horizontal |
There was a problem hiding this comment.
This doesn't say which of ArrowUp/ArrowDown increases, and AR1 doesn't cover ArrowLeft/ArrowRight on a vertical track (today they lower and raise the value). Suggest: “ArrowUp increases and ArrowDown decreases; on a vertical track ArrowRight increases and ArrowLeft decreases.” DEC-2's “the vertical arrows and Up/Down” would then read clearly too.
| decreases; PageUp and PageDown step by ten steps; Home and End move to `min` | ||
| and `max`. In a range, a thumb never crosses the other past the minimum |
There was a problem hiding this comment.
End is snapped to the step grid before clamping, so with min={0} max={100} step={3} it lands on 99 while aria-valuemax is 100 (the case #6399 addresses). Either record that as a known gap or settle the endpoint rule with that fix; today it isn't shipped behavior.
| | Contract | Verification | Representative states | Mutation or failure expectation | Audit section | | ||
| | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | | ||
| | FR1 | `Slider.test.tsx` structure, range, and marks suites | Single, range, horizontal, vertical, marks | Removing or misaligning stable parts breaks existing role, position, or mark assertions. | `audit:Slider/anatomy` | | ||
| | AR1 | Slider accessibility contract (`internal/a11y-spec`) bound to Slider, in jsdom and Chromium; `Slider.test.tsx` keyboard suites incl. the RTL arrow case | Single and range; horizontal LTR and RTL; vertical; disabled; formatted value | A thumb loses its role, name or value properties; an arrow, Page, Home or End key stops stepping or steps against the mirrored track; a range thumb crosses the other | `audit:Slider/accessibility` | |
There was a problem hiding this comment.
Neither named check exists yet: there is no slider pattern under internal/a11y-spec, and Slider.test.tsx has no RTL keyboard case and no ArrowUp/ArrowDown, PageUp/PageDown or End assertions. Name only evidence present at this head and record the rest as known gaps (as the FR4 row does), or add the evidence and list it in verified_by first.
… with AR1; Tab stop and End stated as shipped (disabled-message thumbs, step-aligned End)
|
/approve-spec 2f59355 |
…he off-grid endpoint recorded as a gap; DEC-1 precedence sentence scoped
|
/approve-spec 176b96e |
There was a problem hiding this comment.
Requesting changes: the owner's approval settles AR1, ORD1 and DEC-2 as the Slider spec, but the record needs one fix and one landing condition.
- ORD1 (line 107) snaps and clamps every key result, which is exactly what stops End at 99 for
min={0} max={100} step={3}, while AR1 (lines 130–133) says End reachesmaxand calls that 99 an implementation gap; scope ORD1 to the arrow and Page keys so the End rule is stated once. - AR1 cites
spec:AST-020/FR15, which is not on main yet, so land this after #7458 or cite FR2 until then.
[Automated review]
|
|
||
| - No new value, snapping, geometry, interaction, or styling precedence rule is | ||
| introduced. | ||
| - ORD1: a key result snaps to the nearest step, then clamps to the bounds. |
There was a problem hiding this comment.
ORD1 applies snap-then-clamp to every key result, End included, and that is exactly what produces the 99 that AR1 (lines 130–133) calls an implementation gap: End's result max (100) snaps to 99 for step=3, and clamping keeps 99. As written the record both requires and disowns that value, so a fix that makes End reach max, as #6399 does, satisfies AR1 but breaks ORD1. Suggest scoping ORD1 to the stepping keys, for example: “ORD1: an arrow or Page key result snaps to the nearest step, then clamps to the bounds; Home and End set min and max.”
…; Home and End go to the bounds
|
/approve-spec 1f8d2cb |
|
/approve-spec 15b1fa7 |
There was a problem hiding this comment.
Recommending approval: the owner's decision and exact-revision approval settle AR1, ORD1 and DEC-2 as the Slider spec, spec:AST-020 FR15 is on main, and AR1's End implementation-gap sentence now matches the shipped behavior exactly (End gives 99 for max={100} step={3} but reaches 101 for max={101} step={3}). Until #7461 lands, the RTL arrow clause runs ahead of the shipped Slider, and the RTL, Page, End and Up/Down tests stay pending as the verification row records.
[Automated review]
Exact decision needed
Whether Slider adopts the APG Slider pattern —
role="slider"per thumb with its name,aria-valuemin/max/now/valuetext,aria-orientation,aria-disabled; arrows step, PageUp/PageDown by ten steps, Home/End to the bounds; two-thumb ranges never cross — and records that on a horizontal track the horizontal arrows follow the track's direction, so under RTL ArrowLeft increases and ArrowRight decreases.User impact
A keyboard or screen-reader user on a Slider gets what the pattern promises — a named thumb that announces its value and bounds, and keys that step, page and jump — and on a right-to-left page the horizontal arrows move the thumb the way it travels on screen. Every part except the RTL arrow direction is shipped today; the RTL direction is a behaviour fix the owner called a defect, in #7461 (red-armed test, patch Changeset).
Existing authority searched
component:Slider(current; its Accessibility section named the name, value, range-thumb naming, description association, keyboard and disabled behaviour as untouched by the anatomy decision but recorded no pattern adoption),spec:AST-020FR15/DEC-4 (adoption rule; the full keyboard model applies because a thumb already acts as one composite control) in #7458, APG Slider pattern as published (Right/Up increase, Left/Down decrease, Page keys, Home/End; the APG notes a horizontal slider's direction may be reversed to match the visual layout), the pointer path's RTL mapping already in the component. No record decided the adoption before.Decision
Owner decision, 2026-10-13: adopt, and patch the RTL defect.
component:SliderAR1 names every adopted part and the direction rule; DEC-2 records why the horizontal arrows follow the painted track and the rejected shapes. Verification map gains an AR1 row bound to the Slider accessibility contract in jsdom and Chromium, LTR and RTL, with the RTL arrow case named.The record is
current, so this needs the owner's approval.Delta
packages/core/src/Slider/Slider.spec.md: AR1, verification row, DEC-2.Writing rubric results
#digits,/pull/,/issues/as standing content): none.pnpm check:knowledge: clean.