Skip to content
Draft
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
62c9b4a
feat(AlertDialog): under a finger the alert appears the way iOS's does
vjeux Nov 3, 2026
dd1c162
Merge branch 'main' into uikit/c18-alerts-pr2
cixzhang Nov 5, 2026
c7f3449
Merge branch 'main' into uikit/c18-alerts-pr2
vjeux Nov 5, 2026
b86bb05
Merge main into the Toast branch (#8047 landed)
cixzhang Nov 6, 2026
c048c03
fix(Toast): a moved toast's card starts no transition
vjeux Nov 6, 2026
9cbf06b
Merge #10223 (a moved toast's card starts no transition) into uikit/c…
vjeux Nov 6, 2026
d244534
Merge main into the Toast branch (#10223 landed)
cixzhang Nov 6, 2026
d0f8d96
test(AlertDialog): a toast the alert raises enters once across repeats
vjeux Nov 6, 2026
773374e
docs(AlertDialog): split the file header's input list into sentences
vjeux Nov 6, 2026
d05b6c6
Merge main into the AlertDialog branch
vjeux Nov 6, 2026
f664bbc
fix(core): a leaving alert reads another window's nodes
vjeux Nov 6, 2026
362ea7f
test(AlertDialog): a toast the alert raises stays painted as it closes
vjeux Nov 6, 2026
91cb191
refactor(AlertDialog): keep the start scale's Effect note above it
vjeux Nov 6, 2026
d9bdee4
docs(AlertDialog): name the file header's inputs in one sentence
vjeux Nov 6, 2026
008be81
Merge main into the AlertDialog branch
vjeux Nov 7, 2026
057a36f
test(SnapPaging): the pager may bundle the input hold's host registry
vjeux Nov 7, 2026
95c6e98
docs(AlertDialog): shorter file headers, an exact WebKit skip reason
vjeux Nov 7, 2026
52802e3
fix(AlertDialog): close at the tap, fade an exit copy
vjeux Nov 7, 2026
fae82ea
Merge main into the AlertDialog branch
vjeux Nov 8, 2026
3ec5192
chore(sandbox): AlertDialog cases on a page the document scrolls
vjeux Nov 8, 2026
b68d8bf
Merge main into the AlertDialog branch
vjeux Nov 8, 2026
1589e5f
docs(AlertDialog): the touch exit still fades under reduced motion
vjeux Nov 8, 2026
bead618
Merge main into the AlertDialog branch
vjeux Nov 8, 2026
31e5375
Merge main into the AlertDialog branch
vjeux Nov 9, 2026
3e53941
Merge main into the AlertDialog branch
vjeux Nov 9, 2026
77caa21
fix(Layer): a hold leaves a live region with nothing focusable live
vjeux Nov 9, 2026
3393a18
docs(AlertDialog): the changeset says which announcements are read
vjeux Nov 9, 2026
5ee2465
docs(AlertDialog): reword the start limit's comment as two sentences
vjeux Nov 9, 2026
0e9f63a
Merge main into the AlertDialog branch
vjeux Nov 9, 2026
643313e
docs(AlertDialog): the changeset no longer says a toast is read at once
vjeux Nov 9, 2026
e30bc88
fix(Layer): a swizzled copy's input hold sees the package's hosts
vjeux Nov 9, 2026
0b033bc
Merge main
vjeux Nov 10, 2026
ec87860
refactor(Layer): the global modal hosts take a page-wide shared slot
vjeux Nov 10, 2026
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
9 changes: 9 additions & 0 deletions .changeset/alertdialog-touch-motion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@astryxdesign/core': patch
---

[feat] AlertDialog: under a finger the alert appears the way an iOS alert does. It scales down into place from 1.2 while it and the dimming fade in, on your theme's dialog entrance duration and curve. When it closes, it fades out with the dimming. With reduced motion it fades in without the scale, over 200 ms, and fades out within 200 ms. While it fades out, its content is inert: a touch, a click, a key or an assistive-technology activation on it does nothing, and focus leaves it until it returns to the opener. A toast stays operable above it, so one the action raises takes a tap and is read. On a phone, an alert with no `width` prop is now UIKit's 320 px wide in every theme, not 400 px. A `width` you pass still wins. With a mouse nothing changes.

An announcement made through the shared announcement channel while the alert fades out under a finger, such as the words of a toast its action raises, is read. A live region inside the page's content stays inert until the fade ends.

@vjeux
55 changes: 54 additions & 1 deletion apps/storybook/stories/AlertDialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.

import {useState} from 'react';
import {useEffect, useRef, useState} from 'react';
import type {Meta, StoryObj} from '@storybook/react';
import {
AlertDialog,
useImperativeAlertDialog,
} from '@astryxdesign/core/AlertDialog';
import {Button} from '@astryxdesign/core/Button';
import {Stack} from '@astryxdesign/core/Stack';
import {Text} from '@astryxdesign/core/Text';
import {useToast} from '@astryxdesign/core/Toast';
import type {ToastDismissFn} from '@astryxdesign/core/Toast';

const meta: Meta<typeof AlertDialog> = {
title: 'Core/AlertDialog',
Expand Down Expand Up @@ -226,3 +230,52 @@ export const Inline: Story = {
onAction: () => {},
},
};

/**
* An action that raises a toast. Under a finger the alert fades out above the
* toast. The toast stays live meanwhile: its Undo button takes a tap during
* the fade, and assistive technology reads it.
*/
export const AlertOverAToast: Story = {
render: function AlertOverAToastStory() {
const [isOpen, setIsOpen] = useState(false);
const [undoCount, setUndoCount] = useState(0);
const toast = useToast();
// The story's one toast. A new delete replaces it, and leaving the story
// dismisses it.
const dismissRef = useRef<ToastDismissFn | null>(null);
useEffect(() => () => dismissRef.current?.(), []);
return (
<Stack gap={2}>
<Button
label="Delete item"
variant="destructive"
onClick={() => setIsOpen(true)}
/>
<Text>{`Undo taps: ${undoCount}`}</Text>
<AlertDialog
isOpen={isOpen}
onOpenChange={setIsOpen}
title="Delete item?"
description="This action cannot be undone. The item and all its data will be permanently removed."
actionLabel="Delete"
onAction={() => {
dismissRef.current = toast({
body: 'Item deleted.',
uniqueID: 'alert-over-a-toast',
isAutoHide: false,
endContent: (
<Button
label="Undo"
variant="secondary"
onClick={() => setUndoCount(count => count + 1)}
/>
),
});
setIsOpen(false);
}}
/>
</Stack>
);
},
};
22 changes: 16 additions & 6 deletions docs/architecture/layer-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ verified_by:
packages/core/src/Layer/useLayerDismissal.test.tsx,
packages/core/src/Layer/layerClickBoundary.test.tsx,
packages/core/src/Layer/layerDismissalInvariants.test.tsx,
packages/core/src/Layer/inputHold.test.tsx,
packages/core/src/Layer/layerExitCopy.test.ts,
packages/core/src/Layer/presentationHold.test.tsx,
packages/core/src/Layer/__tests__/layerExitCopy.interaction.browser.spec.ts,
Expand Down Expand Up @@ -461,7 +462,15 @@ do not slide out with it. A top-layer viewport renders into a host element
it owns, moves that host into the latest open outlet, returns it to the
viewport's tree position when no outlet is open, and enters the top layer again
after each move. Toasts therefore paint above the modal and stay operable inside
it. Moving the host does not remount the rows, so entries, timers, and focus
it. An input hold can make a layer's content inert, or the page's. A host
there stays live, as do the elements that hold it; their other children go
inert. A live region among them stays live too, unless it holds something
focusable when the hold starts: it takes no input, and inert would drop what
is written to it. A
live region inside a child that goes inert stays inert with it. The
hold announces its shield's entry, so toasts stay operable above the shield
too.
Moving the host does not remount the rows, so entries, timers, and focus
handoff survive. The rule is one of order, not of modality, and it reaches
the surfaces that tell the registry they entered the top layer: the modal
outlets, and a non-modal top-layer surface that blocks nothing and announces
Expand Down Expand Up @@ -588,11 +597,12 @@ layers use Layer rendering without joining Escape/platform dismissal.
Otherwise a layer never paints at a geometry it is about to
correct, and the runtime polls nothing.
- **INV13 — One exit copy per closing layer.** A layer's close plays on at most
one exit copy, made by `placeLayerExitCopy`: drawn where the layer was drawn,
inert, hidden from assistive technology, without ids, form names, or form
owner, shown only in the top layer, and removed by its owner when the close
settles. Placing a second copy for the same layer removes the first; another
layer's copy stays.
one exit copy, made by `placeLayerExitCopy`, or taken by `takeLayerExitCopy`
and placed later: drawn where the layer was drawn, inert, hidden from
assistive technology, without ids, form names, or form owner, shown only in
the top layer, and removed by its owner when the close settles. Placing a
second copy for the same layer removes the first; another layer's copy
stays.
- **INV14 — The runtime owns every layer's shared mechanism.** Internally, the layer runtime owns the shared
mechanism layers use: top-layer mounting, close-request delivery, the
presentation hold (keeping a layer's chosen presentation from the open until
Expand Down
6 changes: 5 additions & 1 deletion docs/specs/AST-094-touch-presentations/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ affects_consumer_docs: []
verified_by:
[
packages/core/src/motion/__tests__/animatedLayoutBusy.interaction.browser.spec.ts,
packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts,
]
---

Expand Down Expand Up @@ -253,7 +254,9 @@ a measured, sourced difference exists.
runs off the main thread,
and MUST keep advancing at display rate through a main-thread block. It MUST
NOT animate layout properties, and MUST NOT step a frame from script when the
compositor can run the curve.
compositor can run the curve. An exit copy's fade starts once a frame has
shown the copy; until then the copy rests at the fade's start, and from then
on the fade advances through any block.
A press shows at once. Every press release that fades does so on the
theme's exit motion tokens (`--duration-exit`, `--ease-exit`), on every
device and pointer, by the owner's decision (2026-11-03); under Reduce
Expand Down Expand Up @@ -1072,6 +1075,7 @@ Motion that FR45 moves, by component. Each component's record carries its own li
| FR4 | Role unit tests over every touch motion | each role at its table value; a theme that writes `motion` | a literal played in place of a role (other than a measured gesture-driven exit spring its component's motion table lists with its platform source), a value that differs from the table at `tempo` 1 and `'standard'`, or a theme that changes a role other than through its motion knobs fails |
| FR4 | Role unit tests over gesture-driven exits | a gesture-driven exit (a release that closes or dismisses) playing a spring measured from the platform reference with no named role; the same unnamed spring played by a program-started motion or by a gesture-driven motion that is not an exit, such as a settle | a gesture-driven exit playing a measured table spring passes; a program-started motion, or a non-exit gesture motion, playing an unnamed spring fails |
| FR5 | Browser proof: an animation keeps advancing frame by frame through a 1 s main-thread block, with no layout or paint per frame | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out |
| FR5 exit copy | Browser proof: a block between the copy's first and second frame shows the copy fully visible, then one whole fade | AlertDialog's touch close with a 300 ms and a 1,200 ms block from the copy's first frame; Chromium phone emulation; WebKit | a copy that fades during the block, jumps into its fade after it, or goes without its fade fails |
| FR5 glide | Browser proof: the animated-layout glide keeps moving through a 700 ms main-thread block, on every frame a compositor control moves | the content after a Collapsible, a TreeList branch and a Table row; verified in Chromium; WebKit by an iOS Simulator spot-check (38/39 frames), not an automated run (evidence gap) | a glide stepped from the main thread freezes |
| FR6 | Unit and browser tests catching an animation mid-flight and retargeting it | catch at peak velocity; retarget with a new spring; a retarget before the browser reports the call's start | a layout read, a jump, or a lost velocity fails |
| FR6 pager | Unit and browser tests of a pager's settle start | releases just under and over 225 pt/s; a catch mid-settle; a programmatic page change mid-settle | a release under the floor whose settle starts moving, a release over it whose settle starts from rest, a catch that loses the on-screen velocity, or a programmatic page change mid-settle that starts from rest fails; a page change during a drag starts from rest |
Expand Down
Loading