Skip to content

spec(a11y): Slider adopts APG Slider; horizontal arrows follow the track's direction - #7463

Merged
cixzhang merged 6 commits into
mainfrom
spec/slider-adoption
Oct 13, 2026
Merged

cixzhang merged 6 commits into
mainfrom
spec/slider-adoption

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

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-020 FR15/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:Slider AR1 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

  • R1 (proposal/history tense): no — AR1 and DEC-2 state what the thumb does.
  • R2 (research in the record): no.
  • R3 (cells naming a PR, issue, or commit): no.
  • R4 (rejected alternative outside its decision or longer than one line): no — one line inside DEC-2.
  • R5 (# digits, /pull/, /issues/ as standing content): none.
  • R6 (answered open question still listing options): none added (OQ1 is unchanged).
  • Prettier and pnpm check:knowledge: clean.

…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.
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 13, 2026 6:51pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 13, 2026, 7:57 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 13, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec fe7aa08

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

View Storybook for this PR · View Sandbox for this PR

Current run: The current change has no visual or preview-producing scope. Visual checks are not applicable; preview links are not shown.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 without disabledMessage is not focusable and End stops at 99 for min={0} max={100} step={3}.

[Automated review]

Comment thread packages/core/src/Slider/Slider.spec.md Outdated
Comment on lines 115 to 116
range-thumb naming, description/status association, keyboard behavior, disabled
behavior, or value-tooltip behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Slider/Slider.spec.md Outdated
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Slider/Slider.spec.md Outdated
Comment on lines +126 to +127
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Slider/Slider.spec.md Outdated
| 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` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 2f59355

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 13, 2026
…he off-grid endpoint recorded as a gap; DEC-1 precedence sentence scoped
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 176b96e

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 13, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 reaches max and 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]

Comment thread packages/core/src/Slider/Slider.spec.md Outdated

- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.”

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 1f8d2cb

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 13, 2026
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 15b1fa7

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 13, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]

@cixzhang
cixzhang merged commit 1395445 into main Oct 13, 2026
48 checks passed
@github-actions
github-actions Bot deleted the spec/slider-adoption branch October 14, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 15b1fa72 Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant