Skip to content

feat(AlertDialog): under a finger the alert appears and leaves the way iOS's does - #8084

Draft
vjeux wants to merge 33 commits into
meta:mainfrom
vjeux:uikit/c18-alerts-pr2
Draft

vjeux wants to merge 33 commits into
meta:mainfrom
vjeux:uikit/c18-alerts-pr2

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #8084 → #8095

Behavior module: AlertDialog's touch motion (useAlertMotion).

User need

On a phone, AlertDialog plays its desktop entrance and closes at once. The iOS alert shrinks in from 1.2 as it and the dimming fade in, and fades out to close.

Problem and solution fit

  1. Look (FR6): under a touch presentation the alert scales from 1.2 and fades in with the dimming, and leaves by a fade, on Dialog's tokens. Reduce Motion caps each fade at 200 ms.
  2. Leaving (FR7): the alert closes in the tap's task, and a copy of it fades out with the dimming. The page stays inert under the hold's shield until the fade ends, then focus returns to the opener. A toast the action raises stays live.
  3. Width (FR9): on a phone the alert is 320 px wide, so its 1.2 start stays on screen.

Current specification

component:AlertDialog FR6, FR7 and FR9, with DEC-4 (spec:AST-094 FR45), and spec:AST-094 FR5 for the exit copy's start. The touch exit plays with the dialog exit switch off (spec:AST-090 FR14). Toasts stay operable above the modal and under an input hold (spec:AST-003 FR16, FR18).

Public delta and caller burden

No API change; a mouse keeps today's motion, and a caller's width wins. Private changes:

  • Global hosts are marked in the modal outlet registry, in a page-wide slot every copy of Core shares.
  • The layer runtime's exit copy can be taken before a commit and placed after it (takeLayerExitCopy).
  • The copy helper can skip its inherited-value read (opt-in).

Design and alternatives

The alert's keyframes run on the compositor, and the dimming inherits their timing. The copy is taken in the closing commit and placed after Dialog's close, so the page's styles cannot win over its fade. Its fade waits for a frame that shows it whole: WebKit can animate a new layer before its first paint. A fade on the live dialog would mount the top layer outside the layer runtime (architecture:layer-runtime INV14).

Evidence

  • At this head (ec87860), a real iPhone 14 passed the entrance and close, width within capture resolution; see Testing. Android's set is pending.
  • Red first for a swizzled copy: with a set per copy, both cases in modalOutlet.shared.test.ts fail.
  • Red first for the close: "a touch close closes the alert in the tap's task" fails in both engines on 247c405.

Scope

Components: AlertDialog, Layer, Toast, motion

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

This head (ec87860) is e30bc88 with a merge of main 841b486 and the hosts' shared slot. At this head, with 1 worker:

  • Both AlertDialog interaction specs: Chromium 28 passed, and WebKit in CI's container 26 passed (2 skipped).
  • Unit tests for AlertDialog, Layer, Toast, motion, Dialog and the theme registry: 2,175 passed.
  • The core typecheck, pnpm build, the Storybook build, Prettier and ESLint on the changed files, check:knowledge, check:sync and check:changesets pass.

On a real iPhone 14 (iOS 26.2, Safari) at this head, beside 3ec5192, with real touches on /pages/alert-dialog-cases/:

  • The touch entrance passes on both heads: the alert scales in and fades with the dimming. Under Reduce Motion it shows at full size with a fade only, on both.
  • Over four interleaved takes, the two heads' entrances show no consistent difference. From its first painted frame, the dimming follows the dialog's 550 ms curve within 3% on both.
  • In the clip the alert settles at 323 pt, which is FR9's 320 pt within about 1.5 capture pixels (2.2 pt each). In Chromium at a 390 px viewport it lays out at 320 px. Its first painted frame is about 1.06×, so no frame shows the 1.2 start.
  • The close passes: the toast appears during the copy's fade. It keeps its place on every later frame, through a second Delete and Undo ("Undo taps: 1"). Under Reduce Motion too, and "Saving the item." stays put as the dialog closes about 0.45 s after Save.
  • The close's timing matches main 841b486 over 48 closes. The median gap is 56 against 56 ms on the story, and 84 against 84 ms over a toast.

The merge guard runs the Android exit-timing check at this exact head before it merges.

The cost of the tap's task, at 7235482 (Chromium, minified Storybook, 16 closes per arm, medians). Main closes at once with no fade:

CPU main: the alert gone this change: first frame, the copy at rest this change: first frame that looks different
1× 24.0 ms 23.7 ms 40.9 ms, the next frame
4× 72.7 ms 108.8 ms 109.0 ms
6× 105.0 ms 159.0 ms 159.0 ms

History

Checks on earlier heads; none of them carries to this head.

  • e30bc88: a real iPhone 14 (iOS 26.2, Safari) beside 3ec5192, with no visible difference.
  • e30bc88: Android's set passed, with the exit-timing check (median gap: storybook-delete head 74 ms, main 78 ms; alert-over-a-toast head 68 ms, main 78 ms).
  • e30bc88: pnpm test:ui (23,426), pnpm test:node (17,781), and 191 Chromium and 168 WebKit browser cases.
  • 3ec5192: the design owner's real-iPhone check passed, Nov 8 2026.
  • 643313e and 5ee2465: Android checks at normal scale, under Remove animations and with a slow-device profile.
  • 7235482: iOS Simulator recordings of each close's first frames, and long-task traces of the close.
  • 45e9de5: the design owner's real-iPhone pass of the scale-in, the close fade, Reduce Motion and a tap during the fade.
  • 362ea7f: the design owner's real-device check passed, Nov 6 2026.
  • 95c6e98 and 272c8ca: earlier designs that kept the alert open through its fade or started the fade at the copy's placement.

Writing rubric results

component:AlertDialog: PR2 says the entrance plays on the dialog surface and its ::backdrop. The dismissal fades on the layer runtime's one exit copy (architecture:layer-runtime INV13), and AlertDialog renders no other element under a touch presentation. The FR6/PR2 verification row names the copy, the reopen case and "an element besides the exit copy fails". FR6 plays the theme's tokens, with the exit fade on even while the dialog exit switch is off. Its turn-back clause carries an implementation gap, listed under Current-state impact. FR7 ships whole: its gap sentence and its Current-state entry are gone. Its verification row names the entrance and exit cases with all five cells. DEC-4, readiness, system_specs, Governing rules and the FR6/PR2 verification row match what ships. No motion role is added.

  • R1 narration, R2 research, R4 rejected alternatives, R5 change references: none.
  • R3 evidence: the look's source is the measurement (UIAlertController, iOS 26.2); its timing's is DEC-4.
  • R6 open questions: none touched.

spec:AST-094: FR5 gains the spec owners' sentence, verbatim:

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.

The verification table gains the row "FR5 exit copy". A block between the copy's first and second frame shows the copy fully visible, then one whole fade. verified_by gains AlertDialog's motion spec, which holds that case.

  • R1 narration, R2 research, R4 rejected alternatives, R5 change references: none.
  • R3 evidence: the row's case in AlertDialog.motion.interaction.browser.spec.ts, listed in verified_by.
  • R6 open questions: none touched.

architecture:layer-runtime: two present-tense changes. The modal-outlet paragraph says that 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, and their other children go inert. It also says:

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. INV13 names the copy that takeLayerExitCopy takes and its owner places later. verified_by gains Layer/inputHold.test.tsx, which holds the deeper-host case and the live-region cases.

  • R1 narration, R2 research, R4 rejected alternatives, R5 change references: none.
  • R3 evidence: inputHold.test.tsx (the deeper host), ToastViewport.modalHost.test.tsx (the shield's entry) and layerExitCopy.test.ts (take, then place), all in the record's verified_by.
  • R6 open questions: none touched.

@vercel

vercel Bot commented Oct 24, 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 Nov 10, 2026 5:52pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 10, 2026, 7:03 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 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.

This pull request is on hold for an owner decision: AlertDialog's touch motion rests only on draft spec:AST-094 (FR4, FR5, FR7, FR8 and DEC-1), and FR4 narrows the current architecture:theme-tokens INV3, so an engineering owner has to approve or amend those requirements. An engineering owner records the decision by commenting /approve-spec <full head SHA> on the pull request, and the author may do so if they are an engineering owner. Separately from that decision:

  • Land the stacked pull requests first and rebase, so this diff is only the AlertDialog motion commit instead of 25,379 authored lines.
  • While the alert fades out under touch, keyboard and assistive-technology activations still run onAction, and Escape calls onOpenChange(false) again; make the leaving alert inert.
  • Under React StrictMode, an AlertDialog that mounts open never starts its presentation and stays invisible and modal; the status effect should own and clean up its animation frame.
  • The adaptive threshold change contradicts component:Selector DEC-1; split it out or keep the current query.
  • The lint job failed on this head with an ESLint out-of-memory error and needs a rerun.

[Automated review]

@github-actions

github-actions Bot commented Oct 24, 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

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

This pull request is on hold for an owner decision: AlertDialog's touch motion rests only on draft spec:AST-094 (FR4, FR5, FR7, FR8 and DEC-1), and FR4 narrows the current architecture:theme-tokens INV3, so an engineering owner needs to approve or amend those requirements. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Separately from that decision:

  • Land the stacked pull requests first and rebase, so this diff is only the AlertDialog motion commit instead of 26,547 authored lines.
  • While the alert fades out under touch, keyboard and assistive-technology activations still run onAction and Escape calls onOpenChange(false) again; make the leaving alert inert.
  • Under React StrictMode, an AlertDialog that mounts open never starts its presentation and stays invisible and unresponsive to touch; let the status effect own and clean up its animation frame.
  • The adaptive threshold change contradicts component:Selector DEC-1; split it out or keep the current query.
  • The lint job runs out of memory on this head while the base passes.

[Automated review]

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

This pull request is on hold for an owner decision: AlertDialog's touch motion rests only on draft spec:AST-094 (FR4, FR5, FR7, FR8 and DEC-1), and FR4 narrows the current architecture:theme-tokens INV3, so an engineering owner needs to approve or amend those requirements. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. Separately from that decision:

  • Land the stacked pull requests first and rebase, so this diff is only the AlertDialog motion commit instead of 27,525 authored lines.
  • While the alert fades out under touch, keyboard, click and assistive-technology activations still run onAction, and Escape calls onOpenChange(false) again; make the leaving alert inert.
  • The adaptive threshold change contradicts component:Selector DEC-1; split it out or keep the current query.
  • The lint job runs out of memory on this head while main passes.
  • Add a StrictMode mount-open test for the new motion effect; the StrictMode presentation issue raised on the earlier head no longer applies.

[Automated review]

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
@vjeux
vjeux force-pushed the uikit/c18-alerts-pr2 branch from b635c03 to 1c55503 Compare October 24, 2026 21:29
@vjeux vjeux changed the title feat(AlertDialog): on a touch screen the alert appears and leaves the way iOS's does feat(AlertDialog): on iPhone and iPad the alert appears and leaves the way iOS's does Oct 24, 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.

This pull request is on hold for an owner decision: AlertDialog's iPhone and iPad motion rests only on draft spec:AST-094 (FR5, FR7, DEC-1), and that record's FR4 and DEC-1 forbid the theme-tunable touch motion this head adds through defineTheme({motion: {springs, durations, curves}}), so an engineering owner needs to settle which holds, and whether the two non-component experimental subpaths are an acceptable boundary under spec:AST-017 FR21. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request once the record says so, and the author may do so if they are an engineering owner. Separately from that decision:

  • While the alert fades out on iOS, keyboard and assistive-technology activations still run onAction and Escape calls onOpenChange(false) again; make the leaving alert inert.
  • Under Reduce Motion the iOS fades last 404 ms on a spring, but design:reduced-motion DR2 allows an opacity-only change of 200 ms or less, and DR4 bars theme values that lengthen it.
  • The compact test's 744 px width contradicts spec:AST-012 FR9 (the theme's md point or a height under 500), and the platform adaptation condition extends the vocabulary FR2 closes.
  • Land the stacked pull requests first and rebase, so this diff is only the AlertDialog motion commit instead of 31,379 authored lines.
  • Add a StrictMode mount-open test for the new motion effect.

[Automated review]

@vjeux
vjeux force-pushed the uikit/c18-alerts-pr2 branch from 1c55503 to 6dca4bf Compare October 24, 2026 22:07
@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Addressed at 6dca4bf:

  • While the alert leaves, a click, Enter or assistive-technology activation on an action, Cancel and Escape do nothing (new failing-before case).
  • StrictMode mount-open case added; the presentation no longer waits for an animation frame.
  • lint passes on this head (the out-of-memory run was on b635c03).

Waiting in the reviewers' queue: the spec decision (draft AST-094 FR4, FR5, FR7, FR8, DEC-1 and theme-tokens INV3; the alert's springs and durations are now theme motion roles) and the adaptive query, which belongs to #8062. This pull request carries its stack until it lands; review the last commit.

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

This pull request is on hold for an owner decision: AlertDialog's iPhone and iPad motion rests only on draft spec:AST-094 (FR5, FR7, DEC-1), and that record's FR4 and DEC-1 forbid the theme-tunable touch motion this head adds through defineTheme({motion: {springs, durations, curves}}), so an engineering owner needs to settle which holds, and whether the two non-component experimental subpaths are an acceptable boundary under spec:AST-017 FR21. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request once the record says so, and the author may do so as an engineering owner. Separately from that decision:

  • Under Reduce Motion the iOS fades last 404 ms on a spring, but design:reduced-motion DR2 allows an opacity-only change of 200 ms or less, and DR4 bars theme values that lengthen it.
  • The changeset and docs say no click, key or assistive-technology activation reaches the alert during either transition, but during the entrance they still run onAction and onOpenChange; gate them until the presentation completes or narrow the text.
  • The compact test's 744 px width contradicts spec:AST-012 FR9 and the compact definition main now exports, and the platform adaptation condition extends the vocabulary FR2 closes.
  • Land the stacked pull requests first and rebase, so this diff is only the AlertDialog motion commit instead of 31,567 authored lines.

[Automated review]

@vjeux
vjeux force-pushed the uikit/c18-alerts-pr2 branch from 6dca4bf to 3b4bd41 Compare October 24, 2026 23:31
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/approve-spec bead618

@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: one evidence gap remains. An engineering owner approved the spec content at this head, so the touch look, the exit fade over an inert page with live toasts, the phone width and the spec:AST-094 FR5 exit-copy rule are settled direction; the reduced-motion docs fix and the transientCopy.ts merge resolution look right.

Blocking:

  • The new touch exit has no device evidence at this head: spec:AST-094 Platform support and DEC-27 ask for Android Chrome with Gboard in the emulator at the exact head (animations at normal scale and removed, plus a slow-device profile), and the approved FR6/PR2 row asks for the owner's iOS Safari pass at the exact head, but the description's runs are for the previous commit or older, and this head merges main, which now builds the exit copy's clone in motion/inertClone.ts.

Posting those runs for the head intended to merge clears the request; so would the record owners amending DEC-27 and the FR6/PR2 row to accept evidence carried across a merge of main.

[Automated review]

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 31e5375

@vjeux

vjeux commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

The description now carries device evidence for the head to merge. Android exit timing, interleaved against main in one session on an emulator, passes on both cases: on storybook-delete the exit copy's first frame comes at a median 21 ms after the tap, with a median close gap of 74 ms against main's 60; on the alert over a toast, 52 ms, with a gap of 144 ms against main's 80. They were measured at bead618. This head, 31e5375, keeps bead618's own changes; its merge of main brings the sandbox page and changes outside the exit copy's path, so the runs carry (maintainers' ruling). The owner's iOS visual pass carries the same way.

@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: one evidence gap remains. An engineering owner approved the spec content at this head, so the touch entrance, the exit fade over an inert page with live toasts, the 320 px phone width and the spec:AST-094 FR5 exit-copy rule are settled direction, and the code has no blocking finding.

  • Exact-head device evidence is missing: spec:AST-094 Platform support and DEC-27, and the approved FR6/PR2 row in component:AlertDialog, require the Android Chrome emulator runs with Gboard (animations at normal scale, removed, and a slow-device profile) and the owner's real-device iOS Safari pass at the exact head, but the runs in the description are for earlier commits; post them for the head you intend to merge, or have the record owners amend DEC-27 and the FR6/PR2 row to accept evidence carried across a merge of main.

Non-blocking: the comment at useAlertMotion.ts:42-46 reads more easily as two sentences, a rewording you have moved to #8095. The stack line does not hold yet, because #8095's head does not contain this head, so this review covers this pull request alone.

[Automated review]

vjeux added 2 commits November 8, 2026 20:40
An alert's touch exit holds the page, and the hold made every child of
the body inert, the page's shared live regions too. A toast the alert's
action raised was then written to an inert region, which assistive
technology does not read. A live region with nothing focusable in it
now stays live under a hold: it takes no input. One that holds
something focusable stays inert.
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 77caa21

@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. An engineering owner approved the spec content at this head, so the touch entrance, the exit fade over an inert page with live toasts, the 320 px phone width, the spec:AST-094 FR5 exit-copy rule and the new live-region rule are settled direction; two items remain.

  • Exact-head device evidence is missing: spec:AST-094 Platform support and DEC-27, and the approved FR6/PR2 row in component:AlertDialog, require the Android Chrome emulator runs with Gboard (animations at normal scale, removed, and a slow-device profile) and the owner's real-device iOS Safari pass at the exact head, and the description says the runs for this head are pending.
  • The changeset's new sentence (.changeset/alertdialog-touch-motion.md:7) says the page's live regions stay live through the fade, but the hold keeps only top-level live regions with nothing focusable live, so a region inside the page, such as Button's loading region, still drops what is written to it; please narrow the sentence to the shared announcement channel and say that in-page regions stay inert until the fade ends.

Non-blocking: the comment at useAlertMotion.ts:42-46 still reads more easily as two sentences, a rewording you have moved to #8095. The stack line does not hold yet, because #8095's head does not contain this head, so this review covers this pull request alone.

[Automated review]

Comment thread .changeset/alertdialog-touch-motion.md Resolved
vjeux added 2 commits November 8, 2026 21:59
The hold keeps only the page's top-level live regions with nothing
focusable live, so only the shared announcement channel is read during
the fade. A live region inside the page's content stays inert until the
fade ends, and the changeset now says so.
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 5ee2465

@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: one evidence gap remains. An engineering owner approved the spec content at this exact head, so the touch entrance, the exit fade over an inert page with live toasts and readable announcements, the 320 px phone width and the spec:AST-094 FR5 exit-copy rule are settled direction, and no code defect was found.

  • Exact-head device evidence is missing: spec:AST-094 Platform support and DEC-27, and the approved FR6/PR2 row in component:AlertDialog, require the Android Chrome emulator runs with Gboard (animations at normal scale, removed, and a slow-device profile) and the owner's real-device iOS Safari pass at the exact head, and the description reports them only for earlier commits.

The stack line does not hold yet, because #8095's head does not contain this head, so this review covers this pull request alone.

[Automated review]

vjeux added 2 commits November 9, 2026 11:29
A toast the alert's action raises is written to the page's shared
announcement region in the next frame, which on a slow device ends with
the close's long frame. The changeset now says only that it is read.
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 643313e

@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: two items remain. An engineering owner approved the spec content at this exact head, so the touch entrance, the inert fade-out with toasts kept live, the 320 px phone width and the spec:AST-094 FR5 exit-copy rule are settled direction.

  • Newly live check: packages/core/src/Layer/modalOutlet.ts:61 keeps the new global-host set in module state while the input hold that reads it keeps its own store under a shared key, so a swizzled AlertDialog's touch close makes the package ToastViewport's host inert; register the set with realmValue(sharedKey('layer/modal-outlet-hosts', 1), () => new Set<Element>()), as Layer/toastHost.tsx now registers the toast viewport.
  • Exact-head device evidence is missing: spec:AST-094 Platform support and DEC-27, and the approved FR6/PR2 row in component:AlertDialog, require the Android Chrome emulator runs with Gboard (animations at normal scale, removed, and a slow-device profile) and the owner's real-device iOS Safari pass at the head that merges, and the description lists both as pending for this head.

The stack line does not hold yet, because #8095's head does not contain this head, so this review covers this pull request alone.

[Automated review]

Comment thread packages/core/src/Layer/modalOutlet.ts Resolved
The global hosts that move into the latest open modal lived in module
state, while the input hold that reads them keeps its own state under a
shared key. A swizzled copy's hold therefore saw no host and made the
package's toast viewport inert during an alert's fade. The set is now
registered under a shared key too.

@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: one piece of device evidence remains. The spec content is owner-approved at this exact head, every code change matches it, and the Android emulator runs in the description now cover this head.

  • The approved FR6/PR2 verification row in component:AlertDialog asks for the record owner's real-device iOS Safari pass at this head, and the iPhone 14 run in the description does not say the record owner made or confirmed it.

Once the record owner confirms that run, or posts their own, for this head, nothing else blocks. Two non-blocking notes stay open on their lines, with follow-ups already agreed: a swizzled copy's input hold still announces its shield only to its own listeners (Layer/inputHold.ts:494), and the comment at useAlertMotion.ts:147 restates the ref's name.

[Automated review]

Comment thread packages/core/src/Layer/inputHold.ts Resolved
const blurredRef = useRef<HTMLElement | null>(null);
// The exit copy, from the commit that closes the alert to its layout effect.
const exitCopyRef = useRef<TakenLayerExitCopy | null>(null);
// Whether a reopen cut the last fade short.

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.

Non-blocking (INV29): this restates isCutShortRef. Drop it, or say why the ref exists: "Set by the exit's cleanup. A reopen reads it to open at rest."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. The comment will say why the ref exists in the next change to this file.

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec e30bc88

The global hosts that move into the latest open modal were shared
across copies of Core through a raw realm key. They now take their own
page-wide slot, layer/modal-outlet/hosts, beside the outlet state that
every copy shares. The outlet state keeps its shape and its version, so
a copy built without the hosts still shares the outlets.

A set per copy fails both two-copy tests in modalOutlet.shared.test.ts,
and the shared slot passes them.

@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 waits on an engineering owner's decision on the spec content at this head. The record edits in component:AlertDialog, spec:AST-094 and architecture:layer-runtime are unchanged since the last approval, but that approval named the previous commit; an engineering owner (the author included) records the decision by commenting /approve-spec followed by the full head SHA. After that, one blocking item remains:

  • The iOS Safari device pass and the Android Chrome emulator runs (normal motion, Remove animations and a slow profile) need to be taken again at this head, because it changes Layer/modalOutlet.ts and merges main changes into Layer/layerExitCopy.ts, so spec:AST-094 DEC-31 does not carry the earlier runs, and the description's evidence still names the previous revision.

The host set's move to its own shared slot settles the earlier note about a swizzled copy's shield; one non-blocking note stays open: the comment at useAlertMotion.ts:147 restates the ref's name.

[Automated review]

| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| FR1–FR5 | `AlertDialog.test.tsx` ("calls onOpenChange(false) on Escape", "does not call onOpenChange when action is clicked", "does not call onAction on Escape", "does not disable the cancel button while the action is loading", "exposes a named group instead, with no aria-modal") and `useImperativeAlertDialog.test.tsx` ("opens on show()", "closes on hide()") | open, loading, inline, imperative | Escape not cancelling, the action closing by itself, or the inline path claiming the role fails. | `audit:AlertDialog/behavior` |
| FR6, PR2 | `useAlertMotion.test.tsx` (the touch look, the start scale, an exit that closes at once at 0 ms, the close with the exit copy's fade, the backstop, a reopen mid-exit, a server-rendered open that opens at rest); `AlertDialog.motion.interaction.browser.spec.ts` under a coarse pointer in Chromium and WebKit (the presentation on the theme's entrance tokens, a reopen that enters with its dimming again, the fade on the exit copy on the exit tokens with the dialog exit switch off and on, the viewport start, reduced motion with its 200 ms dimming and exit) and in Chromium frames through a 1 s main-thread block; the same 1 s block on the iOS simulator in Safari; the owner's real-device pass on iOS Safari at the exact head, and with it the Android Chrome emulator recording at the exact head (Chrome with Gboard; default, Remove animations and a slow profile; `spec:AST-094` DEC-27) | present, dismiss with the dialog exit switch off and on, reopen during dismiss, reopen after dismiss, an open in server markup, Reduce Motion, a fine pointer, a narrow viewport | a timing off the theme's tokens, a start outside the viewport, a dismissal without its fade, a scale or a dimming over 200 ms under Reduce Motion, an entrance replayed after hydration, a reopen without the dimming's entrance, changed motion under a fine pointer, or an element besides the exit copy fails. No test checks a turn-back on interruption, which does not ship. | `audit:AlertDialog/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.

Blocking (evidence gap): this row, and current spec:AST-094 Platform support and DEC-27, want the iOS Safari device pass and the Android Chrome emulator runs at the exact head. DEC-31 does not carry the earlier runs here: this head changes Layer/modalOutlet.ts, and its merge of main changes Layer/layerExitCopy.ts. Take both again at this head, and update the description's head references.

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec ec87860

@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: one evidence gap remains. The spec content in component:AlertDialog, spec:AST-094 and architecture:layer-runtime now has an engineering owner's approval at this head, so the touch entrance, the close with a fading copy over an inert page that keeps toasts live, and the 320 px phone width all have current authority.

  • The iOS Safari real-device pass and the Android Chrome emulator runs (normal animations, Remove animations and a slow profile) still need to be taken at this head, as spec:AST-094 Platform support and DEC-27 and the approved FR6/PR2 verification row require; DEC-31 does not carry the earlier runs, because this head changes Layer/modalOutlet.ts and its merge of main changes Layer/layerExitCopy.ts and Layer/modalOutlet.ts.

One non-blocking note stays open: the comment at useAlertMotion.ts:147 restates the ref's name.

[Automated review]

@vjeux

vjeux commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

The real-iPhone pass is now taken at this head (ec87860): an iPhone 14 (iOS 26.2, Safari) beside 3ec5192, with real touches. The touch entrance, the close with its fading copy and live toasts, and Reduce Motion pass, and the close's timing matches main 841b486. The description's Testing section has the measurements, including the one difference in the dimming's first frame. The Android emulator runs at this head are next.

This branch was successfully deployed

1 active deployment
Preview — ec878601 Deployed Nov 10, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants