Skip to content

[Component Audit] Slider: docs say when onChange and onChangeEnd fire and that a disabled thumb stays focusable - #14207

Draft
cixzhang wants to merge 6 commits into
mainfrom
night-watch-component-audit/Slider/2026-12-02
Draft

cixzhang wants to merge 6 commits into
mainfrom
night-watch-component-audit/Slider/2026-12-02

Conversation

@cixzhang

@cixzhang cixzhang commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Scope

Components: Slider

User impact

  • The onChange docs said it fires "during drag" and the onChangeEnd docs said "when drag ends". They now say onChange fires on each value step: through a drag and a finger's coast, at once on a mouse press on the track, from the lift of a finger's or a pen's tap on the track, and on each key step; and that onChangeEnd fires once when an interaction ends: a pointer release or a cancelled drag (after a finger's coast or a track tap's spring settles, or at a press that stops it), or a completed key step, while a finger's or a pen's touch on the track that sets no value, a finger's or a pen's press the browser cancels before it moves, and a drag that disabling cancels before the value moves report nothing (FR7). English, Chinese, dense docs and JSDoc.
  • The disabledMessage docs said the reason "keeps the thumb focusable via aria-disabled", as if a disabled thumb without a reason left the tab order. Every disabled thumb stays a Tab stop with aria-disabled; the docs now say so. The Chinese docs translate this entry and list the missing width prop; the dense docs describe both, and the Storybook control text matches.
  • New tests check that a pointer release reports the value an owner keeps when it clamps the drag, and that keyboard focus shows the formatted value in the value tooltip, which no test covered.
  • A browser audit spec checks the Slider stories in a real browser, in light and dark, both directions and the Butter theme.
  • Found, not fixed here: after a keyboard step, onChangeEnd reports the value Slider asked for, not the value the owner rendered. An owner that caps a volume at 80 in onChange sees the thumb stay at 80 while onChangeEnd reports 100. The record makes the fix a breaking change for an owner that moves value only from onChangeEnd, so it ships in a declared minor (Needs Review 1). No runtime code changes in this pull request.

Audit result

  • Package/component: core/Slider (released in @astryxdesign/core under ./Slider)
  • Mode: Night Watch whole-component audit, rubric 1.16.6
  • Base: b2914afe14da; head: e18e4598e5d9257b9c858d6f4efd4a7b6af6eed1
  • Component contract: component:Slider (authority: current), with family:input-fields, design:reduced-motion, design:user-states, architecture:component-theming-surface, architecture:public-component-api and spec:AST-085, spec:AST-094. No backfill: the record maps the whole inventory. No record change.

Overlap checked: #7516 (open, contributor) changes how a pointer reaches an off-grid max; it waits on an owner rule and this pull request does not touch that path. #11544 (open, draft) moves the touch runtime; it touches other parts of Slider.tsx. New tests are appended at the end of Slider.test.tsx.

Before After
Score 87.1 / C (1 BLOCK) 90.3 / C (1 BLOCK)
Distinct defects 1 BLOCK, 7 FIX, 1 NIT 1 BLOCK, 3 FIX, 1 NIT
Section W Before After State
§1 Accessibility 16 5 5 scored; each thumb is an APG slider (AR1): named (range thumbs apart), aria-valuemin/valuenow/valuemax, aria-valuetext with a formatter, aria-orientation; arrows follow the painted track under RTL, Page steps ten, Home and End reach the bounds; a disabled thumb keeps its Tab stop with aria-disabled and keys change nothing; the reason tooltip shows on keyboard focus and describes the thumb; the error slider is aria-invalid and each status message describes its thumb; shared focus outline; thumb contrast 3.5–11.4:1 against the track and 5.2–17.2:1 against the surface; axe clean. The 20 px tall control passes WCAG 2.5.8 by the spacing exception under a fine pointer (no target within its 24 px circle) and grows under a finger (FR7)
§2 Theming 14 4.5 4.5 scored; four targets (slider, slider-control, slider-track, slider-thumb) with orientation and disabled; tokens throughout; Butter reaches every part. Not 5: no MediaTheme frame. The filled range, ticks, labels and value display have no target by the record's own open question (OQ1), not scored
§3 Public API 14 4.5 4.5 scored; ref, base props and caller handlers reach the thumb; single and range types. FIX open: inside an InputGroup the Field box renders but container* is dropped with a warning (the record's family:input-fields implementation gap)
§4 Behavior 12 3 3 scored; BLOCK open (FR5, DEC-3): a keyboard step's onChangeEnd reports a value the owner did not render. With an owner that keeps 50, or [20, 80], an arrow or End reports 51, or [20, 100] (three tests failed on the base); a pointer release already reports the rendered value. The record ships the change as [breaking] in a declared minor (Needs Review 1). FIX open: a mouse's or a pen's release does not coast yet (the record's FR7 implementation gap)
§5a Design, objective 6 5 5 scored; radius and color tokens; thumb transitions on --duration-fast and --ease-standard, 0 s under reduced motion; travel by translate only. The thumb's hover is a color-mix toward --color-tint-hover, not the overlay token; no current record decides Slider's hover, so it is not scored (Needs Review 3)
§5b Design, rendered 4 5 5 scored from receipted frames, light and dark, both directions: rest, hover, focus with its value tooltip, pressed, range, marks, vertical, disabled, disabled with its reason, status, formatted text value, Butter
§6 Testing 8 4 4.5 scored; FIX closed (V3): the value tooltip on focus and the pointer release's rendered value under an owner that clamps had no test; three new tests. FR5's keyboard owner cases wait for the minor's fix (downstream of the §4 BLOCK, not counted again)
§7 Code health 8 4.5 4.5 scored; one Effect, a cleanup of a lost pointer capture (a real browser system); touch tracking in its own controller and hook; flushSync where the owner must render before onChangeEnd reads, and to place the value tooltips' anchors. NIT open: some comments cite PR and record ids
§8 Docs 8 3.5 5 scored; FIX closed: the onChange and onChangeEnd docs said drag only; FIX closed: the disabledMessage docs implied a disabled thumb leaves the tab order without a reason (AR1); FIX closed: the Chinese docs missed width and left disabledMessage in English, and the dense docs missed both
§9 i18n and RTL 5 5 5 scored; strings from the catalog; logical styles; the horizontal arrows follow the painted track and the mark labels the reading direction (measured by the audit spec in both directions); the touched-components check runs the RTL audit at the head
§10 Responsive and touch 5 4.5 4.5 scored; a 48 px touch target and tap paths under a finger (FR7); the control fills its container. FIX open: no receipt at a 320 px width (R11)

§11 is not run for a released component.

Sensitivity: the grade is capped at C by one BLOCK (Needs Review 1). Closing it and changing nothing else lifts §4 to 4.5: 93.9 / A.

Why the score moved: the §6 tests and the §8 docs.

Pre-fix score: scored from base source, a base unit run (with FR5 keyboard owner tests that failed, since kept out of this pull request) and a browser run of the audit spec against a Storybook built from the base b2914af (the spec uncommitted beside it). Night Watch records only the landed post-fix result in the score ledger, so the pre-fix score lives here.

Findings fixed

ID Finding Authority Fix and proof
V3 (FIX) The value tooltip on focus and the pointer release's rendered value under a clamping owner had no test rubric V3; component:Slider FR4, FR5 and verification map Three tests
Doc drift (FIX) onChange and onChangeEnd docs said drag only component:Slider FR5, FR7 English, Chinese, dense docs and JSDoc
Doc drift (FIX) disabledMessage docs implied the thumb is focusable only with a reason component:Slider AR1; spec:AST-085 Docs and JSDoc; the browser spec's disabled case reaches a thumb with no reason by Tab
X5b (FIX) Chinese docs missed width and left disabledMessage untranslated; dense docs missed both rubric X5 Entries added

A changeset records the doc change.

Needs Review

  1. Keyboard onChangeEnd (BLOCK, §4) — owner decision. FR5 has onChangeEnd report the value the owner renders; a keyboard step reports the value Slider emitted. The fix is small: the keyboard path lets the owner render the step before onChangeEnd reads the value, as the pointer path does, with owner clamp, reject and range tests. The record names the victim, an owner that moves value only from onChangeEnd, and ships FR5 as [breaking] in a declared minor (spec:AST-017/FR31), so it is not in this patch. Question: ship the keyboard onChangeEnd fix as [breaking] in the next declared minor?
  2. Record follow-up. The verification map lists the value tooltip as untested; a test now covers it. That edit needs the spec owner.
  3. Mouse and pen coast (FIX, §4). FR7 has a mouse's or a pen's release coast, as spec:AST-094/DEC-26 decided; the record names the missing coast as an implementation gap. It is new motion, not an audit fix.
  4. Thumb hover. The hover paints a color-mix toward --color-tint-hover rather than the --color-overlay-hover overlay. No current record decides Slider's hover, so it is recorded here, not scored.
  5. InputGroup container* (FIX, §3). The record's family:input-fields gap: inside an InputGroup Slider's Field box still renders but container* is dropped.
  6. Pointer to an off-grid max. fix(Slider): preserve max for pointer endpoint selection #7516 waits on an owner rule for whether a pointer at the end of the track reaches an off-grid max; not scored here.

Evidence

  • Audit spec: SliderAudit.a11y.chromium.spec.ts drives the Default, Range, WithMarks, VerticalOrientation, Disabled, DisabledWithMessage, WithStatus, WithFormatValue and PressedState stories, under reduced motion and a fine pointer. Every receipt binds the Storybook build SHA and checkout, story, theme, mode, direction, viewport, DPR 2, media, settled fonts, a finished story render and no page errors. Checks that fail the receipt when they do not hold, each in light and dark and both directions:
    • single: role, name, value properties, Tab stop, orientation; thumb contrast against the track and the surface at least 3:1; hover paints and keeps the value; keyboard focus draws the shared outline and the value tooltip shows 50; axe clean;
    • keyboard: ArrowRight is +1 in LTR and −1 in RTL, ArrowLeft undoes it, ArrowUp +1, PageUp +10, Home 0, End 100;
    • range: two named thumbs at 20 and 80, the lower one at the inline start;
    • marks: five labels below the control in reading order;
    • vertical: ArrowUp and ArrowRight each +1;
    • disabled: aria-disabled, a Tab stop, keys change nothing, hover paints nothing, default cursor;
    • reason: keyboard focus shows the reason tooltip, and the thumb's description carries it;
    • status: the error thumb is aria-invalid, and each message describes its thumb;
    • text: aria-valuetext carries the formatted value;
    • pressed: a press paints the pressed overlay and changes no value;
    • theme: under Butter the four targets render and the thumb contrast holds.
  • Before: against a Storybook built from b2914af, the spec as first written passed all 44 receipts. After: against a Storybook built from the exact head e18e459, all 44 receipts pass. Review tightened the spec (a missing thumb box fails, Butter is proven against Neutral's accent, tooltips are polled, focus is moved off before Tab), and those checks ran at the head only; the head changes no runtime code. 48 of 52 shared frames are byte-identical; the 4 disabled frames differ only because the first spec left keyboard focus on the disabled thumb, so its focus ring shows in the before frames and not after. Receipts are written to test-results/slider-audit-evidence/.
  • Visual acceptance: N/A. No style, rendered story or runtime change; the story file changes only a control's description text.
  • Unit tests: the Slider suites pass; strict lint on the changed files and prettier pass.

Closed evidence inventory

Surface Source Tests Consumer docs Rendered evidence Authority Result
Thumb semantics role="slider", value properties ARIA suites label, formatValue single, range, text frames AR1 pass
Keyboard handleKeyDown keyboard suites, RTL — keyboard receipts AR1, ORD1 pass
onChange / onChangeEnd updateValue, fireChangeEnd keyboard suites, pointer clamp (new) callbacks (fixed) — FR5, ORD2, DEC-3 pointer pass; keyboard reports the emitted value (BLOCK open)
Pointer tracking touch controller, pointer handlers drag, touch and pointer suites usage description pressed frames FR6, FR7 pass; mouse and pen coast (FIX open)
Disabled, reason aria-disabled, reason tooltip disabled suites isDisabled, disabledMessage (fixed) disabled, reason frames AR1, spec:AST-085 pass
Status, field Field, FieldStatus status suites status, description status frames FR4, family:input-fields pass; InputGroup container* (FIX open)
Value display value tooltip, text value tooltip tests (new), text width spec valueDisplay focus, text frames FR3, FR4 pass
Marks ticks, labels marks suites, geometry spec marks marks frames FR1 pass
Theme targets four themeProps themingTargets.test.ts theming targets Butter frames FR2 pass
Direction logical styles, arrow mapping RTL keyboard tests — RTL frames AR1, design:bidirectionality pass
FR10 eligibility report
{
  "schema": "astryx.audit-eligibility/v1",
  "component": "Slider",
  "package": "core",
  "mode": "night-watch",
  "rubricVersion": "1.16.6",
  "repository": {"base": "b2914afe14da", "head": "e18e4598e5d9257b9c858d6f4efd4a7b6af6eed1"},
  "contract": {"id": "component:Slider", "authority": "current", "changed": false},
  "inventory": {"closed": true, "rows": 10},
  "remediations": [
    {"id": "pointer-change-end-and-tooltip-tests", "kind": "objective-test", "evidence": "three new tests"},
    {"id": "callback-docs", "kind": "doc-drift", "evidence": "doc file and JSDoc diff"},
    {"id": "disabled-message-docs", "kind": "doc-drift", "evidence": "doc file and JSDoc diff"},
    {"id": "zh-dense-entries", "kind": "doc-drift", "evidence": "doc file diff"}
  ],
  "unresolved": {"objective": ["320 px receipt", "MediaTheme frame"], "manual": ["keyboard onChangeEnd rendered value (breaking; declared minor)", "mouse and pen coast (FR7 gap)", "InputGroup container props (family gap)", "thumb hover representation", "verification-map follow-up"]},
  "approvals": {"specOwner": "not required (no record change)"},
  "verdict": {"autoMergeEligible": false, "reasons": ["AST-029 FR11 activation has not shipped", "one open BLOCK"]}
}

…r renders

A keyboard step now lets the owner render its onChange response before
onChangeEnd reads the value, as a pointer release already did, so a value
the owner clamps or rejects is not reported. Tests drive owners that
clamp, reject and clamp a range, and the value tooltip on focus. The
keyboard tests that kept a fixed value now render each reported value.
The callback and disabledMessage docs say when each fires and that a
disabled thumb stays focusable, and the Chinese docs list width. A
browser audit spec checks every story's semantics, keys, states and
contrast in light and dark, both directions and the Butter theme.
@vercel

vercel Bot commented Dec 2, 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 Dec 2, 2026 7:45pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 2, 2026
@astracat-bot

astracat-bot Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Dec 2, 2026, 7:35 PM UTC

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

…nor; the docs and tests describe shipped behavior

The keyboard step keeps reporting the emitted value, since reporting the rendered value breaks an owner that moves value only from onChangeEnd. The pointer clamp and value tooltip tests stay; the audit spec fails closed on a missing thumb box, proves the Butter theme, polls for tooltips and blurs before Tab.

@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 keyboard fix matches the Slider record's onChangeEnd contract, but it is released under the wrong class.

  • .changeset/slider-audit.md ships the change as a patch [fix], but the Slider record names a released victim (an owner that moves value only from onChangeEnd stops moving by keyboard; reproduced locally, ArrowRight from 50 gives 51 before and 50 now), so it needs a minor [breaking] changeset that names that owner and the migration (move the value into onChange), landing with the declared minor or shipping beside the old keyboard payload until then.

Smaller points, none blocking: the new comment above the flushSync call in Slider.tsx could be active voice, the Storybook disabledMessage control text still carries the old focusability wording, and controlOf's doc comment in Slider.test.tsx now sits above OwnedSlider.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Title: after a key press, onChangeEnd reports the value the owner keeps: verified (the new keyboard tests fail on the base and pass on this head, run locally).
  • Title and changeset: the callback docs say when each fires: verified against the key handler, the pointer up and cancel handlers, and the touch controller, where only a finger coasts.
  • Changeset: a value you clamp or reject is no longer reported: verified (clamp, reject and range tests).
  • Changeset: a pointer release already reported the rendered value: verified (the new pointer-release test passes on the base and on this head).
  • Changeset: a disabled thumb stays focusable with or without a reason: verified (the thumb always takes a Tab stop, and the existing disabled-without-reason test passes).
  • Changeset: the Chinese docs list width: verified.
  • Changeset: the change is a patch fix: false (the Slider record classes it breaking; see the finding above).
  • Description: the scope is Slider: verified; the audit scorecard is still to come and makes no behavior claim yet.

Files:

  • .changeset/slider-audit.md: finding (release class).
  • packages/core/src/Slider/Slider.tsx: clear (non-blocking comment wording).
  • packages/core/src/Slider/Slider.doc.mjs: clear.
  • packages/core/src/Slider/Slider.test.tsx: clear (non-blocking comment placement).
  • packages/core/src/Slider/__tests__/SliderAudit.a11y.chromium.spec.ts: clear (not run here; CI runs it for audit pull requests).

Automated review (maintainer link)

Comment thread .changeset/slider-audit.md Resolved
Comment thread packages/core/src/Slider/Slider.tsx Resolved
@cixzhang cixzhang changed the title [Component Audit] Slider: onChangeEnd after a key press reports the value you keep, and the callbacks' docs say when they fire [Component Audit] Slider: docs say when onChange and onChangeEnd fire and that a disabled thumb stays focusable Dec 2, 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 docs and tests are close, but the new test breaks the core typecheck and the new callback docs misstate when a finger's or a pen's tap on the track fires the callbacks.

  • The new pointer-release test at packages/core/src/Slider/Slider.test.tsx:2419 fails pnpm typecheck in packages/core with TS7006 because next is implicitly any under Slider's union props (reproduced locally; the base passes), and typing it as (next: number) => setValue(Math.min(next, 60)) fixes it.
  • Miss: the English, Chinese and dense docs and both JSDoc blocks say onChange fires "on a track press" and onChangeEnd on "a pointer release or cancel", but a finger's or a pen's tap on the track fires nothing until it lifts, reports onChangeEnd only once the thumb's spring settles, and a press the browser cancels before it moves reports nothing (the Slider record's FR7 and the touch record's FR44; reproduced locally), so please name those cases, for example "at once on a mouse press on the track, from the lift of a finger's or a pen's tap on it" and "a pointer release or a cancelled drag (after a finger's coast or a track tap's spring settles)".

The earlier release-class request is resolved: the keyboard payload change is withdrawn and the changeset is a docs patch. Two non-blocking points: astryx component Slider --dense prints only the first sentence of the dense disabledMessage entry, so its focusability sentence never shows, and the Storybook disabledMessage control text in apps/storybook/stories/Slider.stories.tsx still carries the old focusability wording.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none

Claims:

  • Title: the docs say when onChange and onChangeEnd fire: false (a finger's or a pen's track tap, and a press cancelled before it moves; see above).
  • Title: the docs say a disabled thumb stays focusable: verified (every thumb keeps its Tab stop with aria-disabled, with or without a reason).
  • Changeset: the callback docs say when each fires, including keyboard steps and track presses: false (the same cases).
  • Changeset: the disabledMessage docs say a disabled thumb stays focusable with or without a reason: verified.
  • Changeset: the Chinese docs list width and translate disabledMessage, and the dense docs describe both: verified.
  • Changeset: a docs-only patch: verified (no runtime code changes; the keyboard handler matches the base).
  • Description: the scope is Slider: verified; the audit scorecard is still to come and makes no behavior claim yet.

Files:

  • .changeset/slider-audit.md: finding (its timing claim).
  • packages/core/src/Slider/Slider.doc.mjs: finding (track tap and cancel timing).
  • packages/core/src/Slider/Slider.tsx: finding (the same timing in both JSDoc blocks).
  • packages/core/src/Slider/Slider.test.tsx: finding (typecheck).
  • packages/core/src/Slider/__tests__/SliderAudit.a11y.chromium.spec.ts: clear (not run locally; it needs an exact-head Storybook build).

Automated review (maintainer link)

Comment thread packages/core/src/Slider/Slider.doc.mjs Resolved
Comment thread packages/core/src/Slider/Slider.doc.mjs Resolved
@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Dec 2, 2026
…nd a cancelled press

A finger or pen tap on the track fires on its lift and reports its end once the spring settles; a mouse press fires at once; a press cancelled before it moves reports nothing. The pointer clamp test types its value, and the Storybook control text matches the disabledMessage docs.

@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 callback docs now name the track tap, the mouse press and the tap spring correctly, but one new sentence misstates a cancelled press.

  • The new onChangeEnd sentence "A press cancelled before it moves reports nothing" (the English, Chinese and dense entries in Slider.doc.mjs, both onChangeEnd JSDoc blocks in Slider.tsx, and the description's User impact bullet) is false for a mouse press on the track, which fires onChange at once and still fires onChangeEnd when it is cancelled or loses pointer capture (onPointerCancel and the lostpointercapture listener in Slider.tsx, the existing test "ends the drag when its pointer capture is lost without an up", and the Slider record's FR5), so please bound it to a finger's or a pen's press, for example "A finger's or a pen's press that the browser cancels before it moves reports nothing", or drop it.

The earlier points are resolved: the pointer-release test types its value, the track-tap and tap-spring timing is named, and the Storybook control text matches the disabledMessage docs. CI has not run on this head yet.

Claims and files checked

Review mode: full; reason: history

Claims:

  • Title: the docs say when onChange and onChangeEnd fire: false (the cancelled-press sentence; a cancelled mouse track press reports onChangeEnd).
  • Title: the docs say a disabled thumb stays focusable: verified (every thumb keeps tabIndex={0} with aria-disabled).
  • Changeset: the callback docs cover a drag, a mouse press or a finger's tap on the track, a cancelled press and a keyboard step: false for the cancelled press (same finding); the rest verified against the pointer, touch and key handlers.
  • Changeset: the disabledMessage docs say a disabled thumb stays focusable with or without a reason: verified.
  • Changeset: the Chinese docs list width and translate disabledMessage, and the dense docs describe both: verified.
  • Changeset: a docs-only patch: verified (the Slider.tsx changes are JSDoc only).
  • Description: onChange fires through a drag and a finger's coast, at once on a mouse track press, from the lift of a finger's or a pen's tap, and on each key step: verified.
  • Description: onChangeEnd fires once at a pointer release or a cancelled drag, after a finger's coast or a tap's spring, or after a key step: verified.
  • Description: a press cancelled before it moves reports nothing: false (same finding).
  • Description: every disabled thumb stays a Tab stop with aria-disabled: verified.
  • Description: the new tests cover a pointer release under a clamping owner and the formatted value tooltip on keyboard focus: verified that the tests contain those cases; not run.
  • Description: no earlier test covered the value tooltip's text on keyboard focus: reported (the existing value-tooltip browser spec checks only that the tooltip is visible; the Slider record lists the gap).
  • Description: the audit spec checks the Slider stories in light and dark, both directions and the Butter theme: verified in the spec's code; its 44 passing receipts are reported.
  • Description: after a keyboard step, onChangeEnd reports the value Slider asked for, not the rendered value: verified (the key handler reports the clamped step before the owner renders).
  • Description: the Slider record ships that fix as breaking in a declared minor: verified.
  • Description: no runtime code changes: verified.
  • Description: the record lists the value tooltip as untested, a mouse's or a pen's coast as an implementation gap, and the InputGroup container* gap; the thumb hover mixes toward the hover tint: verified against the Slider record and source.
  • Description: the two overlapping pull requests are open, one a draft: verified.
  • Description: the audit scores, contrast ratios, axe results and frame comparisons: reported.

Files:

  • .changeset/slider-audit.md: clear.
  • apps/storybook/stories/Slider.stories.tsx: clear.
  • packages/core/src/Slider/Slider.doc.mjs: finding (the cancelled-press sentence in three entries).
  • packages/core/src/Slider/Slider.tsx: finding (the same sentence in both JSDoc blocks).
  • packages/core/src/Slider/Slider.test.tsx: clear (not run).
  • packages/core/src/Slider/__tests__/SliderAudit.a11y.chromium.spec.ts: clear (not run).

Automated review (maintainer link)

Comment thread packages/core/src/Slider/Slider.doc.mjs Resolved
Comment thread packages/core/src/Slider/Slider.tsx Resolved

@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 cancelled-press sentence now names a finger or a pen, but the onChangeEnd docs still miss several touch cases, and two smaller claims overstate the code.

  • Miss: the onChangeEnd sentence ("a pointer release or a cancelled drag (after a finger’s coast or a track tap’s spring settles), or a completed keyboard step. A finger’s or a pen’s press that the browser cancels before it moves reports nothing.") in the English, Chinese and dense entries of Slider.doc.mjs, in both onChangeEnd JSDoc blocks in Slider.tsx and in the description's User impact bullet promises a report at every pointer release and after every coast settles, but five cases report differently: a finger's or a pen's tap on the track that lands on the thumb's own value, a tap during a coast, a finger's swipe along the track and a drag that disabling the slider cancels before its value moved all report nothing, and a press on a thumb during a coast ends it with onChange and onChangeEnd at that press (handleTrackTap, begin and cancelLater in sliderTouchController.ts; reproduced locally with unit probes), so please bound the sentence, for example "…(after a finger’s coast or a track tap’s spring settles, or at a press that stops it), or a completed keyboard step. A finger’s or a pen’s touch on the track that sets no value (a tap on the thumb’s own value or during a coast, or a swipe) reports nothing, and so does a finger’s or a pen’s press that the browser cancels before it moves, or a drag that disabling the slider cancels before the value moves."
  • Miss: the dense disabledMessage line says the reason "shows on hover and focus", but focus after a pointer press does not open it (opensOnFocus in useTooltip.tsx), so please say "hover and keyboard focus" as the English, Chinese, JSDoc and Storybook text do.
  • Miss: the description's code-health cell says flushSync runs "only where the owner must render before onChangeEnd reads", but releaseAnchors in Slider.tsx also calls it to place the value tooltips' anchors, so please name that second use or drop "only".

The earlier points are resolved: the cancelled-press sentence names a finger or a pen in all five places. Locally, the seven Slider test files, the core typecheck, Prettier and ESLint on the changed files pass; CI has not run on this head yet.

Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims:

  • Title: the docs say when onChange and onChangeEnd fire: false (the onChangeEnd cases above).
  • Title: the docs say a disabled thumb stays focusable: verified (every thumb keeps tabIndex={0} with aria-disabled; disabled comes only from the prop).
  • Changeset: the callback docs say when each fires for a drag, a mouse press or a finger's tap on the track, a cancelled press and a keyboard step: false for a finger's tap that sets no value (same finding); the rest verified against the pointer, touch and key handlers.
  • Changeset: the disabledMessage docs say a disabled thumb stays focusable with or without a reason: verified.
  • Changeset: the Chinese docs list width and translate disabledMessage, and the dense docs describe both: verified that the entries exist and match the English; the dense focus wording is the second finding.
  • Changeset: a docs-only patch: verified (the Slider.tsx changes are JSDoc only; the repository's API generator, run locally on both trees, lists no API change).
  • Description: onChange fires through a drag and a finger's coast, at once on a mouse press on the track, from the lift of a finger's or a pen's tap on the track, and on each key step: verified, and the existing tap and coast tests pass locally.
  • Description: onChangeEnd fires once at a pointer release or a cancelled drag (after a coast or a tap's spring settles) or a completed key step: false (the five cases).
  • Description: a finger's or a pen's press that the browser cancels before it moves reports nothing: verified when no coast runs (the existing window-blur tests pass locally); false when the press stops a coast.
  • Description: every disabled thumb stays a Tab stop with aria-disabled, and keys change nothing: verified.
  • Description: the Chinese docs translate disabledMessage and list width, the dense docs describe both, and the Storybook control text matches: verified, apart from the dense focus wording.
  • Description: the new tests check a pointer release under a clamping owner and the formatted value tooltip on keyboard focus: verified; both contain those cases and pass locally.
  • Description: no earlier test covered the value tooltip's text on keyboard focus: verified by searching every test and spec that names Slider (the existing browser spec checks only that the tooltip is visible).
  • Description: the audit spec checks the stories in light and dark, both directions and the Butter theme, with the listed assertions: verified in its code; its 44 passing receipts and the before and after frame comparison are reported.
  • Description: after a keyboard step onChangeEnd reports the value Slider asked for, so an owner capping at 80 sees 80 while onChangeEnd reports 100: verified, reproduced locally.
  • Description: the record makes that fix breaking and defers it to a declared minor: verified.
  • Description: no runtime code changes: verified.
  • Description: thumb semantics (names, value properties, value text, orientation), arrows that follow the painted track under right-to-left, Page steps of ten, Home and End to the bounds, the reason and status descriptions, aria-invalid on an error: verified against the thumb markup and key handler; the existing keyboard and right-to-left tests pass locally.
  • Description: four theme targets with orientation and disabled: verified (all four reflect orientation; the root, control and thumb reflect disabled).
  • Description: one Effect, touch tracking in its own controller and hook, a 48 px touch target, catalog strings and logical styles, thumb transitions on the fast duration and standard easing with none under reduced motion, a hover that mixes toward the hover tint: verified in the source.
  • Description: flushSync only where the owner must render before onChangeEnd reads: false (the third finding).
  • Description: no current record decides Slider's hover; the record lists the value-tooltip coverage gap, the mouse and pen coast gap and the InputGroup container gap: verified against the records.
  • Description: the two overlapping pull requests are open, one a draft, and this one leaves their paths alone: verified.
  • Description: strict lint and Prettier pass on the changed files, and the Slider suites pass: verified, run locally.
  • Description: the audit scores, contrast ratios, axe results, frame comparisons, earlier red runs and the eligibility report: reported.

Files:

  • .changeset/slider-audit.md: clear.
  • apps/storybook/stories/Slider.stories.tsx: clear.
  • packages/core/src/Slider/Slider.doc.mjs: finding (the onChangeEnd sentence in three entries; the dense disabledMessage line).
  • packages/core/src/Slider/Slider.tsx: finding (the onChangeEnd sentence in both JSDoc blocks).
  • packages/core/src/Slider/Slider.test.tsx: clear (passes locally).
  • packages/core/src/Slider/__tests__/SliderAudit.a11y.chromium.spec.ts: clear (not run).

Automated review (maintainer link)

Comment thread packages/core/src/Slider/Slider.doc.mjs Resolved
Comment thread packages/core/src/Slider/Slider.doc.mjs Resolved
…ress that stops a coast

The dense disabledMessage entry says keyboard focus, as the other docs do.

@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 English, Chinese and JSDoc callback docs now match the touch code, but the new dense onChangeEnd line and one description bullet overstate which touches report nothing.

  • The dense onChangeEnd line in Slider.doc.mjs says "A touch that sets no value, a finger or pen press cancelled before moving, or a drag cancelled by disabling reports nothing", but a finger's or a pen's tap on a thumb and a drag that disabling cancels after its value moved each report one onChangeEnd (the existing tests "a tap on the thumb changes nothing and reports one onChangeEnd" and "cancels a drag when the slider is disabled mid-drag" in useSliderTouch.test.tsx assert this and pass locally), so please bound it as the English entry does, for example "A track touch that sets no value, a finger or pen press cancelled before moving, or a drag disabled before its value moves reports nothing."
  • The description's first User impact bullet says "a finger's or a pen's touch that sets no value … report nothing", which is false for a tap on a thumb, so please say "a finger's or a pen's touch on the track that sets no value" as the English docs do.

The three earlier points are resolved. Locally, the seven Slider test files, the core typecheck, Prettier and strict ESLint on the changed files pass; CI has not run on this head yet.

Claims and files checked

Review mode: incremental; reason: none

changed rules (0): none

Claims:

  • Title: the docs say when onChange and onChangeEnd fire: false through the dense onChangeEnd line (first finding); the full, Chinese and JSDoc entries verified against the pointer, touch and key handlers.
  • Title: the docs say a disabled thumb stays focusable: verified (every thumb keeps tabIndex={0} with aria-disabled).
  • Changeset: the callback docs say when each fires for a drag, a mouse press or a finger's tap on the track, a cancelled press and a keyboard step: verified; the dense line's extra cases are the first finding.
  • Changeset: the disabledMessage docs say a disabled thumb stays focusable with or without a reason: verified.
  • Changeset: the Chinese docs list width and translate disabledMessage, and the dense docs describe both: verified (all three entry sets list the same props; the dense line says keyboard focus).
  • Changeset: a docs-only patch: verified (the Slider.tsx changes are JSDoc only; the repository's API generator, run locally on both trees, lists no API change).
  • Description: onChange fires through a drag and a finger's coast, at once on a mouse press on the track, from the lift of a finger's or a pen's tap on the track, and on each key step: verified in the handlers; the tap and coast tests pass locally.
  • Description: onChangeEnd fires once at a release or a cancelled drag (after a coast or a tap's spring settles, or at a press that stops it) or a completed key step: verified.
  • Description: a finger's or a pen's touch that sets no value reports nothing: false for a tap on a thumb (second finding).
  • Description: a finger's or a pen's press the browser cancels before it moves, and a drag that disabling cancels before the value moves, report nothing: verified (the existing window-blur tests pass locally; the disable path reports only after a change).
  • Description: every disabled thumb stays a Tab stop with aria-disabled, and keys change nothing: verified.
  • Description: the Chinese docs translate disabledMessage and list width, the dense docs describe both, and the Storybook control text matches: verified.
  • Description: the new tests check a pointer release under a clamping owner and the formatted value tooltip on keyboard focus, which no test covered: verified; both pass locally, and a search of every test and spec file found no earlier assertion of either.
  • Description: the audit spec checks the stories in light and dark, both directions and the Butter theme, with the listed assertions: verified in its code; its passing receipts and frame comparison are reported.
  • Description: after a keyboard step onChangeEnd reports the value Slider asked for, so an owner capping at 80 sees 80 while onChangeEnd reports 100: verified by reading the key handler.
  • Description: the record makes that fix breaking and defers it to a declared minor: verified.
  • Description: no runtime code changes: verified.
  • Description: thumb names, value properties, value text and orientation; arrows that follow the painted track under right-to-left; Page steps of ten; Home and End to the bounds; the reason and status descriptions; aria-invalid on an error; four theme targets; one Effect; touch tracking in its own controller and hook; a 48 px touch target; catalog strings; logical styles; motion tokens with none under reduced motion; a hover that mixes toward the hover tint; the two flushSync uses: verified in the source.
  • Description: no current record decides Slider's hover, and the record lists the value-tooltip coverage gap, the mouse and pen coast gap and the InputGroup container gap: verified against the records.
  • Description: the two overlapping pull requests are open, one a draft: verified.
  • Description: strict lint and Prettier pass on the changed files, and the Slider suites pass: verified, run locally.
  • Description: the audit scores, contrast ratios, axe results, frame comparisons, earlier red runs and the eligibility report: reported.

Files:

  • .changeset/slider-audit.md: clear.
  • apps/storybook/stories/Slider.stories.tsx: clear.
  • packages/core/src/Slider/Slider.doc.mjs: finding (the dense onChangeEnd line).
  • packages/core/src/Slider/Slider.tsx: clear (JSDoc matches the English entry).
  • packages/core/src/Slider/Slider.test.tsx: clear (passes locally).
  • packages/core/src/Slider/__tests__/SliderAudit.a11y.chromium.spec.ts: clear (not run).

Automated review (maintainer link)

Comment thread packages/core/src/Slider/Slider.doc.mjs Outdated
onChange:
'Fired on each value step: drag and finger coast, mouse track press at once, finger or pen track tap on lift, key step.',
onChangeEnd:
'Fired once when an interaction ends: release or cancelled drag (after a coast or tap spring settles, or a press stops it), or a key step. A touch that sets no value, a finger or pen press cancelled before moving, or a drag cancelled by disabling reports nothing.',

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.

Two cases here report once, not nothing: a finger's or a pen's tap on a thumb (the existing test "a tap on the thumb changes nothing and reports one onChangeEnd") and a drag that disabling cancels after its value moved ("cancels a drag when the slider is disabled mid-drag: onChangeEnd fires once"), both in useSliderTouch.test.tsx and passing locally. The English entry keeps both bounds; for example:

'Fired once when an interaction ends: release or cancelled drag (after a coast or tap spring settles, or a press stops it), or a key step. A track touch that sets no value, a finger or pen press cancelled before moving, or a drag disabled before its value moves reports nothing.',

This branch was successfully deployed

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

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant