Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/alertdialog-touch-action-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
'@astryxdesign/core': patch
---

[fix] AlertDialog: its two actions are tracked as one group under every pointer, the way iOS tracks an alert's actions. A press that lands on one action and slides to the other runs the action it lifts on, and lifting off both runs nothing. The pressed action highlights at once, and the highlight follows the pointer between the actions. A second finger or the window losing focus ends the press with nothing run. A press on the title or the message is not tracked. The keyboard and assistive technology keep each button's own activation.
[fix] AlertDialog: under the touch presentation, its two actions are tracked as one group for a finger and a pen, the way iOS tracks an alert's actions. A press that lands on one action and slides to the other runs the action it lifts on, and lifting off both runs nothing. The pressed action highlights at once, and the highlight follows the finger between the actions. A second finger or the window losing focus ends the press with nothing run. A press on the title or the message is not tracked. A mouse press stays the native button's, and the keyboard and assistive technology keep each button's own activation.

@vjeux
44 changes: 30 additions & 14 deletions docs/families/action-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ Selector's and MultiSelector's options FR1–FR5

## Cross-component invariants

- **FR1 — The lift decides.** In a member, a press on an action that slides
across its siblings acts on the action the pointer lifts on, through that
action's own activation; a press that never leaves its action acts on it.
One gesture acts at most once (`spec:AST-094` FR26). After a slide, focus does what
a click on the lifted action does.
- **FR1 — The lift decides.** Under the touch presentation (`spec:AST-094`
FR13), in a member, a press on an action that slides across its siblings
acts on the action the pointer lifts on, through that action's own
activation; a press that never leaves its action acts on it. One gesture
acts at most once (`spec:AST-094` FR26). After a slide, focus does what a
click on the lifted action does. A mouse press acts as the platform's
native button does: on the action it began on, released over that action.
- **FR2 — The highlight follows the pointer.** While the pointer is held, the
enabled action under it is highlighted, at most one at a time, and nothing
is highlighted over a disabled action, a gap, or outside the group
Expand All @@ -148,22 +150,26 @@ Selector's and MultiSelector's options FR1–FR5
- **FR4 — A toggle group toggles only the lifted action.** In a toggle group,
only the action lifted on toggles; sliding across never toggles the actions
passed over.
- **FR5 — Every pointer, one target rule.** The behavior applies to every web
pointer, mouse and pen as well as a finger. Under a fine pointer a group
keeps one `pointerdown` listener on its element, cancelable where the member
needs it, adds document listeners only during a press and removes them at
the release, and may arm one per-document click swallower from the release
until that gesture's click; nothing else is idle (`spec:AST-094` FR19,
FR24). The 44 px target is each member's hit
- **FR5 — A finger and a pen, one target rule.** Under the touch presentation
the behavior applies to a finger and a pen; a mouse press acts as FR1 says.
While it tracks, a group keeps one `pointerdown` listener on its element,
cancelable where the member needs it, adds document listeners only during a
press and removes them at the release, and may arm one per-document click
swallower from the release until that gesture's click; nothing else is idle
(`spec:AST-094` FR19, FR24). The 44 px target is each member's hit
expansion under a coarse pointer only. Keyboard and assistive-technology
behavior is unchanged.

## Allowed component variation

- What an action does on activation, and how a member shows its highlight,
stay with the member.
- Menus keep their own opening and handoff (`spec:AST-094` FR29) and their
scrolling rules.
- Menus keep their own opening and handoff (`spec:AST-094` FR29), their
press and drag under every pointer, and their scrolling rules; FR1's touch
scope and FR5 do not change them.
Comment on lines +167 to +169

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 bullet exempts only menus, but this record lists Selector's and MultiSelector's options apart from menus (membership rule, Shared owner, Adoption table), as architecture:interaction-modality INV13 does. So FR1 and FR5 now make a mouse press on a Selector option native, while component:Selector FR7 and module:DropdownMenu/useMenuPress FR1 keep the release-over-row rule for a mouse. Suggest adding beside it: "Selector's and MultiSelector's options keep the menu press model's press and drag under every pointer (component:Selector FR7); FR1's touch scope and FR5 do not change them."

- Selector's and MultiSelector's options keep the menu press model's press
and drag under every pointer (`component:Selector` FR7); FR1's touch scope
and FR5 do not change them.
- A wheel is a scroll container: a drag scrolls it, as it does today, and a
tap acts on the option under it; only a press that does not scroll tracks.

Expand Down Expand Up @@ -205,6 +211,16 @@ they are outside the family.
- `spec:AST-094/DEC-17` — every group of sibling actions tracks a held
pointer the same way.

### DEC-1 — The slide across actions is for touch only

**Decider:** `cixzhang`, `2026-11-03`

The slide-across press runs under the touch presentation only. A desktop
mouse press behaves as a native button does: only the pressed action
activates, with no drag across the others.

Rejected: every pointer.

## Open questions

None.
Expand Down
16 changes: 9 additions & 7 deletions docs/specs/AST-094-touch-presentations/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ a measured, sourced difference exists.
exceptions. This rule governs
this record's behaviors only; `spec:AST-057` keeps its per-event pointer
read for the row swipe, as its record states. A `family:action-groups` member
tracks its own group as FR24 allows: under a fine pointer it keeps one
that tracks its group (`family:action-groups` FR1) keeps, as FR24 allows, one
`pointerdown` listener on the group element, cancelable where the member
needs it, adds document listeners only during a press, removed at the
release, and may arm one per-document click swallower from the release until
Expand Down Expand Up @@ -596,7 +596,8 @@ under a finger, and a mouse follows `module:DropdownMenu/useMenuPress` FR3 and
selection and native drag, while a trackpad's horizontal scroll swipes a
row (`spec:AST-057` AR2, DEC-7); a
pinch under a pen; the screen-edge pan under a mouse, a trackpad, or a pen;
and the 44 px coarse-pointer touch target, which stays coarse-only and never overlaps a
the slide across an action group under a mouse, and under any pointer
outside the touch presentation (`family:action-groups` FR1); and the 44 px coarse-pointer touch target, which stays coarse-only and never overlaps a

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.

With this exception, FR19 (lines 324-329) no longer holds: it still says an action-group member "tracks its own group as FR24 allows: under a fine pointer it keeps one pointerdown listener on the group element …". Outside the touch presentation the member now attaches nothing. Suggest the wording family FR5 got: "A family:action-groups member that tracks its group (family:action-groups FR1) keeps one pointerdown listener on the group element …".

neighbor's target. On the web, a pan takes a trackpad's two-finger scroll
where its record allows it, and never a mouse wheel's notches. A scroll is a
trackpad's only when it carries Chromium's and WebKit's trackpad signature:
Expand Down Expand Up @@ -723,9 +724,9 @@ under a finger, and a mouse follows `module:DropdownMenu/useMenuPress` FR3 and
pointer, within FR24's listener budget.
- `design:user-states` DR1, DR3 and `family:buttons`: press timing follows
FR11's profiles under every pointer, the fine-pointer profile included.
- Every `family:action-groups` member, as its membership rule lists them:
a press that slides across sibling actions acts on the action it lifts on
(FR26–FR28), under every pointer.
- Every `family:action-groups` member outside the menu press model: a press
that slides across sibling actions acts on the action it lifts on
(FR26–FR28), under the touch presentation (`family:action-groups` FR1).

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.

"Every member, as its membership rule lists them" includes menus and Selector's options, which this record's menu paragraph (lines 392-395) and DEC-17 ("Menus keep the behavior for every pointer") keep under every pointer. Suggest scoping it: "Every family:action-groups member outside the menu press model: … under the touch presentation (family:action-groups FR1)."

- Every component under a coarse pointer: no box grows for touch, and a
touch target reaches 44 px only through an invisible hit area clamped by
its neighbors, unless a component or module record sets its own (FR42).
Expand Down Expand Up @@ -948,8 +949,9 @@ A person who presses one action and slides to another expects the same result
in a menu, an alert's buttons, a button group, or a toolbar. Every member
group of sibling actions behaves the same way, decided once and built in
two owners: the menu press model and the action-group tracker
(`family:action-groups`; `architecture:interaction-modality` INV13). The behavior works with a mouse
as well, so it stays on for every pointer, while the 44 px target stays
(`family:action-groups`; `architecture:interaction-modality` INV13). Menus keep the behavior for every
pointer; an action group's slide runs for a finger and a pen under the touch
presentation (`family:action-groups` DEC-1). The 44 px target stays
touch-only.

Rejected: a tracking rule for menus only.
Expand Down
13 changes: 7 additions & 6 deletions docs/specs/components/AlertDialog/AlertDialog.spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ system_specs:
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Public contract | `AlertDialog`, `AlertDialogProps`, and `useImperativeAlertDialog` are exported from `@astryxdesign/core/AlertDialog`; `title`, `description`, `actionLabel`, `onAction`, and `onOpenChange` are required with `isOpen`, plus cancel label, action variant, loading, width, and an inline preview mode. |
| Behavior | A modal confirmation that interrupts: it opens through the native dialog, cannot be dismissed by a click outside, closes on Escape or Cancel through `onOpenChange(false)`, and runs `onAction` on the action button. |
| End-user impact | A keyboard or screen-reader user is told a decision is needed (the title and description are announced), lands on Cancel, and cannot lose the dialog by clicking past it. On a touch screen the alert scales in and fades out as iOS's does and ignores taps while it enters (FR6, FR7), and on a phone it is 320 px wide (FR9); under every pointer, mouse included, a press that slides from Cancel to the action runs the action it lifts on (FR8). |
| End-user impact | A keyboard or screen-reader user is told a decision is needed (the title and description are announced), lands on Cancel, and cannot lose the dialog by clicking past it. On a touch screen the alert scales in and fades out as iOS's does and ignores taps while it enters (FR6, FR7), and on a phone it is 320 px wide (FR9); on a touch screen a press slid from Cancel to the action runs the lifted action; a mouse's press acts natively (FR8). |
| Builder impact | None. |
| Compatibility/readiness | FR1–FR5, FR8 and AR1 record shipped behavior, apart from AR1's Tab wrap. FR6, FR7 and FR9 are requirements not shipped yet. Each gap is listed under Current-state impact. |
| Review checks | Reject a modal AlertDialog without `role="alertdialog"`, a title or description not linked by id, initial focus on the destructive action, or a backdrop click that dismisses it. |
Expand All @@ -67,8 +67,9 @@ confirmation without assembling it.

## Compatibility and migration

- Released default preserved: `no` — FR8 changes action activation under a
slide; shipping FR6, FR7 and FR9 changes the touch presentation and the
- Released default preserved: `no` — under the touch presentation FR8
changes action activation under a slide; a mouse press keeps the native
button's; shipping FR6, FR7 and FR9 changes the touch presentation and the
phone width
- Compatibility class: nonbreaking behavior change; no public API, DOM, or
target change
Expand Down Expand Up @@ -130,7 +131,7 @@ Consumer migration instructions belong in consumer docs and release notes.
| FR5 | `useImperativeAlertDialog` returns `show`, `hide`, and the element to render, and owns `isOpen`/`onOpenChange` for its caller. | shipped source and focused tests |
| FR6 | Under a touch presentation (`spec:AST-094` FR13), a modal AlertDialog presents by scaling from 1.2 to 1 with its opacity and its backdrop's dimming rising from 0 to 1 on the motion role `springs.alertPresent`, started at the browser's commit, with the larger start kept inside the viewport; it dismisses by a fade alone on `springs.alertDismiss` and closes at the fade's end; a close during the presentation, or a reopen during the dismissal, springs from where it is. The roles are internal, with UIKit's measured values at `tempo` 1 and `'standard'`, and follow the theme's motion knobs (`spec:AST-094` FR4, DEC-15). Under Reduce Motion both are the shared cross-fade (`design:reduced-motion` DR1–DR3). A fine primary pointer keeps today's motion (`spec:AST-094` FR13 and its Non-goals). Implementation gap: not shipped yet (Current-state impact). | proposed from measured iOS 26.2 behavior |
| FR7 | Under a touch presentation, pointer input to the alert is held while it enters (`spec:AST-094` FR35); keyboard and assistive-technology input are never held, and the entrance never makes the content inert. While the alert leaves, its content is inert for the dismissal fade. The hold's timing stays internal (`spec:AST-002` FR3). Implementation gap: not shipped yet (Current-state impact). | `spec:AST-094` FR35; owner decision (DEC-1) |
| FR8 | AlertDialog's actions are an action group (`family:action-groups`): a press that slides across them runs the action it lifts on, and a lift outside them runs nothing, under every pointer; keyboard and assistive-technology behavior is unchanged. | `family:action-groups`; `spec:AST-094` DEC-17; DEC-3 |
| FR8 | AlertDialog's actions are an action group (`family:action-groups`): under the touch presentation (`spec:AST-094` FR13), a press that slides across them runs the action it lifts on, and a lift outside them runs nothing; a mouse press acts as the platform's native button does; keyboard and assistive-technology behavior is unchanged. | `family:action-groups`; `spec:AST-094` DEC-17; DEC-3 |
| FR9 | On a phone, a compact window (`spec:AST-012` FR9: narrower than `md` or shorter than 500 px) under a coarse primary pointer, the alert is 320 px wide in every theme, as iOS's is; no theme role sets it. A caller's explicit `width` still wins there (`architecture:public-component-api` INV5), and Dialog's viewport clamp still applies on a screen narrower than the alert. Elsewhere it keeps today's width. Implementation gap: not shipped yet (Current-state impact). | owner decision (DEC-2) |

### Allowed variation
Expand Down Expand Up @@ -262,8 +263,8 @@ Rejected: a general compact-dialog width theme role.
**Decider:** `cixzhang`, `2026-10-26`

A press that slides from Cancel to the action runs the action it lifts on, as
in every group of sibling actions (`spec:AST-094` DEC-17), so an alert's two
buttons behave like a button group under every pointer.
in every group of sibling actions (`spec:AST-094` DEC-17), so under the touch
presentation an alert's two buttons behave like a button group.

Rejected: keeping each action's activation on the browser's click alone.

Expand Down
Loading
Loading