Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

spec(AST-020): reversible toggles may complete after a slide-off (FR9, DEC-5) (#8556)

Cindy Zhang056b591f062d
diff --git a/docs/specs/AST-020/spec.md b/docs/specs/AST-020/spec.md
index 0e13238241..7e858ef55d 100644
--- a/docs/specs/AST-020/spec.md
+++ b/docs/specs/AST-020/spec.md
@@ -126,6 +126,16 @@ review. It does not claim that one automated pass proves complete accessibility.
report only; `required` expectations gate new or changed behavior at a layer that
can objectively verify them. A coverage score, tool capability, or ease of
automation MUST NOT promote or demote either class.
+ WCAG 2.5.2 (pointer cancellation) is met by cancelling a press that slides
+ off its control before the lift, with one narrow exception: an instantly
+ reversible single-step toggle, where a second activation undoes the first,
+ may complete on a lift after the pointer slid off, meeting 2.5.2 through its
+ undo path. The exception covers Switch, Checkbox, and CheckboxListItem. It
+ does not cover Radio, SegmentedControl, DropdownMenuCheckboxItem (whose menu
+ rows act on nothing after a lift off the row), SelectableCard, or any
+ control that selects rather than toggles; other controls join only by a
+ later decision, and every other control that activates on a lift keeps
+ slide-off cancelling (DEC-5).
### Completeness and review
@@ -221,14 +231,14 @@ or CI gate. Those changes follow in implementation work governed by this record.
## Verification
-| Contract | Verification | Representative states | Mutation or failure expectation |
-| --------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
-| FR1–FR3 | Source and ownership review against WCAG 2.2, APG, and current Astryx records | component-owned A/AA criterion; page-owned criterion; one component with multiple parts | A draft WCAG 3.0 statement gates CI, an APG example is treated as universal WCAG, or one component is forced into one pattern |
-| FR4–FR9 | Contract schema and runner self-tests | required/advisory; unit/DOM/tree/axe/browser/manual/AT; toggle round trip; component-specific callback | A check lacks a source or layer, passes from an unsupported harness, depends on private markup, or one-way behavior hides a reverse-path failure |
-| FR10–FR12 | Completed checklist, positive/negative fixture suite, and independent review | simple control; composite widget; overlay; page-owned criterion | A dimension disappears silently, a mutation still passes, or review finds an unrecorded contract-encodable requirement |
-| FR15 | Adoption review against the component's current role claims | a disclosure set adopting required parts only; a composite control adopting arrow keys; a named exception | A required part is skipped without the owning record's reason, or arrow keys are added to independently focusable controls without a named exception |
-| FR13–FR14 | Pull-request template check plus id migration tests | new pattern; narrowed expectation; file-only refactor | Reviewers cannot understand the test from the PR, or an id change orphans bindings and gaps |
-| Platform | Real-browser and AST-009 evidence-boundary checks | focus navigation; accessibility tree; forced colors; announcement timing | jsdom or a tree snapshot is credited with pixels, browser behavior, or spoken output it cannot observe |
+| Contract | Verification | Representative states | Mutation or failure expectation |
+| --------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| FR1–FR3 | Source and ownership review against WCAG 2.2, APG, and current Astryx records | component-owned A/AA criterion; page-owned criterion; one component with multiple parts | A draft WCAG 3.0 statement gates CI, an APG example is treated as universal WCAG, or one component is forced into one pattern |
+| FR4–FR9 | Contract schema and runner self-tests | required/advisory; unit/DOM/tree/axe/browser/manual/AT; toggle round trip; component-specific callback; a slide-off lift on Switch, Checkbox, CheckboxListItem, Radio, SegmentedControl, and DropdownMenuCheckboxItem | A check lacks a source or layer, passes from an unsupported harness, depends on private markup, or one-way behavior hides a reverse-path failure, a slide-off lift that completes a lift-activated control outside the exception fails |
+| FR10–FR12 | Completed checklist, positive/negative fixture suite, and independent review | simple control; composite widget; overlay; page-owned criterion | A dimension disappears silently, a mutation still passes, or review finds an unrecorded contract-encodable requirement |
+| FR15 | Adoption review against the component's current role claims | a disclosure set adopting required parts only; a composite control adopting arrow keys; a named exception | A required part is skipped without the owning record's reason, or arrow keys are added to independently focusable controls without a named exception |
+| FR13–FR14 | Pull-request template check plus id migration tests | new pattern; narrowed expectation; file-only refactor | Reviewers cannot understand the test from the PR, or an id change orphans bindings and gaps |
+| Platform | Real-browser and AST-009 evidence-boundary checks | focus navigation; accessibility tree; forced colors; announcement timing | jsdom or a tree snapshot is credited with pixels, browser behavior, or spoken output it cannot observe |
### Completion criteria
@@ -299,6 +309,19 @@ Rejected: adopting every part of a pattern wherever its role appears (arrow keys
independent controls); adopting nothing until a component matches an APG example in
full.
+### DEC-5 — Reversible toggles may complete after a slide-off
+
+**Reference:** `spec:AST-020/DEC-5`
+**Decider:** `cixzhang`, `2026-10-26`
+
+A Switch or Checkbox that completes on a lift after the finger slid off can be
+undone by activating it again, which WCAG 2.5.2 accepts, and it matches
+UIKit's UISwitch. The exception names its kinds so it cannot widen without a
+decision; controls that select, such as Radio and SegmentedControl, keep
+slide-off cancelling because a second activation does not undo them.
+
+Rejected: slide-off cancelling for every control without exception.
+
## Open questions
None.
diff --git a/docs/specs/AST-094-touch-presentations/spec.md b/docs/specs/AST-094-touch-presentations/spec.md
index 2d1e602a7b..a0c65fcee9 100644
--- a/docs/specs/AST-094-touch-presentations/spec.md
+++ b/docs/specs/AST-094-touch-presentations/spec.md
@@ -185,7 +185,9 @@ a measured, sourced difference exists.
profiles. A control (UIControl) highlights on touch-down outside scroll
views and activates by the browser's click on a lift inside. On the web a
control's press ends when the browser takes the touch (FR20), and its
- activation stays the browser's click.
+ activation stays the browser's click, except that a toggle under
+ `spec:AST-020` FR9's slide-off exception (Switch, Checkbox,
+ CheckboxListItem) may also complete on a lift after the finger slid off.
A cell (a table or collection cell) highlights 150 ms after touch-down inside
a scroll view, drops the highlight when the scroll wins (FR20), and activates on a
lift inside it with no scroll taking the touch (FR20). A control is inside a scroll view when it sits in a scrollable container,
@@ -542,7 +544,7 @@ FR33 apply to menus only. A mouse keeps today's behavior.
| FR6 | Unit and browser tests catching an animation mid-flight and retargeting it | catch at peak velocity; retarget with a new spring | a layout read, a jump, or a lost velocity fails |
| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), or an opacity fade over 200 ms fails |
| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails |
-| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls | the wrong profile's timing, a press that survives the browser taking the touch, or a control activated other than by the browser's click, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, fails |
+| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails |
| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails |
| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails |
| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails |