Skip to content

feat(Toast): the swipe follows iOS notification banners under a finger - #8121

Draft
vjeux wants to merge 19 commits into
meta:mainfrom
vjeux:uikit/c25-toast-swipe
Draft

vjeux wants to merge 19 commits into
meta:mainfrom
vjeux:uikit/c25-toast-swipe

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Under a finger (a coarse primary pointer), Toast's swipe and exit follow the iOS notification banner. It is the default, with no new option, and folds in #8144's turn-back stretch.

User or maintainer impact

Path Clip
Before (main): the card jumps 9 px after 8 px, fades to 0.79 and shrinks to 0.989 main
A slow drag: still for 14 px, then at 0.55 of the finger. Released short, it springs back slow-drag
A 20 pt flick: the retract keeps its speed, out in 160 ms, unfaded, as do the close button and the timeout flick close timeout
A drag that turns back stretches the card and springs it back turn-back

Clips: an earlier draft (iOS 26.2 simulator, Mobile Safari). Device runs at 496e170 are pending; earlier ones are in a comment below. The sandbox page /pages/toast-swipe-cases/ has a toast per case on a scrolling page. A fine pointer is unchanged.

Problem and solution fit

  • Today's swipe under a finger is hand-tuned. A touch presentation follows UIKit's measured motion (spec:AST-094 FR1), here 60 fps recordings of the iOS 26.2 banner.

Authority

  • spec:AST-094 FR1, FR4 (the settle is springs.settle), FR6, FR13, FR17, FR37 and FR38; design:reduced-motion; spec:AST-100's release filter.
  • Owner decisions in component:Toast: DEC-1, no presentation prop, and DEC-2. Under a finger every exit plays the banner's measured slide, the exception to spec:AST-094 FR45, FR38 and FR4.

Change and evidence

  • motion/uikit/toast.ts: the banner's measured values, each with its source.
  • useToastBannerSwipe.ts, Toast's touch module: the pan Toast.swipe, decided on the touch's first move. The follow, the settle and retract run on the compositor animator. A finger catches a springing or leaving card where it shows. A dragging or catching finger starts no text selection. Around a Reduce Motion fade, the layer turns the card's own transitions off, so Safari no longer replays the fade. An exit's fade starts from the opacity on screen. Otherwise they stay, so an entrance runs on under a finger. A fine pointer gets them back.
  • The latest-value refs this change adds go through useCommittedRef, and the dismissal through its useCommittedRefInto form.
  • Toast.spec.md: FR4, FR5, three gap bullets, compatibility, DEC-1, DEC-2, three verification rows and an Ownership line. AST-094: Toast's FR36 values, its FR45 exception, and pointers to it in FR4, FR7 and FR38.

Scope

Components: Toast

  • This PR has one primary intent.
  • Independently removable deltas were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Two test-only PRs follow: the remaining jsdom finger cases, and the real-touch browser proofs.
  • This head (496e170) is nineteen commits on main (721dbf1), +3,255 / −340. They are the change, a record commit, the catch, a round of fixes and the exit and selection round. Then come a merge of main and the exit decision's record. The last six are two ref-hook commits, the entrance fix, the FR4 and FR38 pointers and a second merge. Then come the FR7 pointer, Toast FR4's second-touch line and a third merge of main. Then two fix a drag or a dismissal during the entrance, and its Reduce Motion fade. The last three are a fourth, a fifth and a sixth merge of main. The fourth brings chore(core): the animator takes start: 'next-frame' in an input event #9261's animator change and fix(Layer): keep an entrance's first frame off its trigger #11396's anchored-layer entrance, which Toast reaches through its imports. The fifth merge of main brings fix(core): pass host data-* attributes to the component's own element #11406's host data-* attributes on the toast element. Toast's code also reaches main's Layer/layerEntranceSide.ts (fix(Layer): keep a flush layer's entrance off its trigger #11417), theme/generateThemeRules.ts and theme/tokenReferences.ts (fix(core): theme padding with functions builds as written #11347) and utils/clickGuard.ts (fix(menu press): cancel only the lifted finger's touchend #11164). The merge renames the swipe handle's rest to restCard, since fix(core): pass host data-* attributes to the component's own element #11406's props spread takes that name. The sixth merge brings fix(layer): a release does not dismiss the layer it opened #11258's changes to utils/clickGuard.ts, utils/touchEndMark.ts, Layer/gestureCounter.ts and Layer/useLayer.tsx. It also brings fix(layer): a press on another trigger of an open layer opens it there #11337's change to Layer/useLayer.tsx, and feat(Lightbox): a gallery's caption sits in a two-line band #9810's to utils/sharedResizeObserver.ts and Text/useTruncation.ts. Toast reaches all six files through its imports.
  • The catch: ToastCatch's two cases land a finger on a card that springs back, and on one that leaves after its close button. On the previous head (800a0db) both fail in both engines, 3 of 3 each: the card moves on under the still finger. On this head they pass 10 of 10 in each engine.
  • A dismissal while a finger drags the card: ToastCatch's third case. On the catch commit (4e842ab) the card never leaves, 3 of 3 in each engine. On this head it leaves, 10 of 10.
  • A uniqueID update during the retract keeps its own row. With the catch commit's Toast.tsx the update is dismissed unseen, and the jsdom case fails.
  • Every exit under a finger: ToastExit checks a swipe, the close button, the timeout and an app's dismiss(). Each plays one translate-only slide of toast.exitMs that ends past the edge. From rest it follows the measured curve. They pass on an earlier head (1a80fef) too, since the exits were already the banner's. A build with a 200 ms retract fails all four, and one with a linear curve fails the three from rest.
  • Under Reduce Motion a spring-back fades once. On 1a80fef WebKit fades twice, 3 of 3; on this head once, 3 of 3. Chromium fades once on both.
  • Text selection: on 1a80fef a drag starts one, 3 of 3 in each engine. On this head neither a drag nor a catching finger does, 3 of 3, and a still hold on a resting card still can. A build without the catch's hold fails at the catch.
  • A catch whose lift the page never hears ends at the next touch. A tap on the close button then dismisses it, on both heads.
  • A tap, a drag or a dismissal during the entrance: ToastCatch slows the entrance and acts while the card fades in. A tap on cee63c3 makes the card jump to full opacity, 3 of 3 in each engine. So do a drag and a dismissal on 407c161. On this head the entrance runs on, 3 of 3.
  • Two jsdom cases check the card's own transitions. The layer leaves them alone through a drag and a retract, and turns them off before a Reduce Motion fade. Both fail on 407c161.
  • Under Reduce Motion, a dismissal during the entrance fades out from the opacity it shows. A spring-back or a catch then ends at full opacity. ToastCatch checks all three, 3 of 3 in each engine. The first fails on 48bfd6a, where the card steps to full opacity. The other two fail on a build that stored the on-screen opacity in the animator.
  • The dismissal is stored before any layout effect of the toast's first commit: a jsdom case clicks the close button from one. With the value written in a layout effect instead, it fails.
  • jsdom: Toast, motion, gestures, Layer and the ref hook pass, 117 files and 2,812 tests. Under a finger they cover the follow, the settle, slow and quick dismissals, a release moving back and the first move. They also cover a horizontal drag, a second finger, an interactive descendant, the turn-back and the retract. A fine pointer keeps Toast's own swipe and close. The sandbox route test passes.
  • At 1 worker, motion's seven interaction specs pass in both engines: Chromium 154, WebKit 144 with 10 skips. Toast's five pass too: Chromium 27, WebKit 25 with 2 skips.
  • The three a11y specs with toasts pass in Chromium, 11 of 11.
  • The sandbox export prerenders the cases page. In Chromium's iPhone emulation, each case's swipe ends as its label says, and the page does not scroll.
  • Core tsc reports 0. Strict ESLint reports 0 errors; its 3 warnings are on lines main already has. Prettier is clean, check:knowledge aligned, check:changesets valid, and the Changeset coverage step passes.

Public and internal API delta

  • Public: no added, changed or removed rows. The generated surface compare for @astryxdesign/core, a build of main 721dbf10f6 against this head, has 0 rows. Behavior: under a finger (a coarse primary pointer), Toast's default swipe and exit change to the notification banner's. Usage is unchanged: useToast() with a <ToastViewport>. Why: the owners chose the banner swipe as the touch default, with no new option.
  • Internal, reached by no public entry point:
    • useToastBannerSwipe, Toast's touch layer in Toast/useToastBannerSwipe.ts. Usage: const {retract, rest} = useToastBannerSwipe({rootRef, isNotification, direction, …}), in Toast.tsx only. Why: under a finger the swipe needs a one-way pan decided on its first move, a release rule and a retract on the compositor. It also exports the swipe's math for its tests: followOffset, isDismissRelease, retractTarget and retractCurve. It adds no observer. A held finger's text-selection hold is the shared lock in utils/selectionLock.ts.
      • Existing modules considered: useToastGesture keeps the fine-pointer swipe, a different model with raw listeners, an 8 px slop, a fade and a scale. usePanGesture has no one-way direction, first-move decision, pointer filter or gesture name. createDragToSnapPoints follows 1:1 and springs to a snap point, with no dead zone, follow ratio or timed exit. Item/useSwipeAction reveals a row's actions.
    • The UIKit table's Toast domain, motion/uikit/toast.ts, re-exported from motion/uikit/index.ts. Usage: toast.followRatio // 0.55. Why: spec:AST-094 FR1 keeps measured motion values in the UIKit table.
      • Existing modules considered: the settle reuses springs.settle, and the pan begins at the shared hysteresis. No existing domain holds a banner's follow, dismiss or exit values.
  • App size: the whole sandbox app's built JS against main 721dbf10f6, with chunk hashes normalized: +2,800 B gzip (+7,576 B raw). That includes the new cases page.
  • Component size (architecture:component-style-authoring INV6): Toast's import grows from 113,027 to 130,932 B gzip, most of it the shared animator. That is one esbuild bundle, with npm packages external. Leaving out INV13's shared touch modules, Toast's own touch code adds 3,043 B gzip, over INV6's 2 KB flag. Those modules are the gesture system, the animator and the press recognizer. Its CSS adds 29 B gzip.
    • Justification: those bytes are Toast's whole touch layer: the banner hook, its measured table, the settle spring's theme role and the selection lock. They load with Toast because the hook holds a touch on its first move. A toast can appear just as a finger lands on it.
  • Size: +3,255/−340 lines (721dbf10f6..496e170091), in 25 files: source +749/−13, tests +2,217/−276, the sandbox page +160/−1, and docs, the records and the changeset +129/−50. Toast's requirement table re-pads to its longer FR4 row.

Writing rubric results

R1 narration: FR4, FR5, the compatibility lines, three current-state bullets and the Ownership line state what the system does, in the present tense. So do spec:AST-094's FR36 and FR45 lines; none found.
R2 research: none in the record; the measured values stay with their sources in motion/uikit/toast.ts.
R3 evidence: the FR4–FR5 verification row names test files, not changes.
R4 rejected alternatives: DEC-1 and DEC-2 each name what was rejected, in the decision log's form.
R5 change references: none.
R6 open questions: none; the record keeps "None".

@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 13, 2026 6:14am 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 13, 2026, 10:31 AM 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.

Approval waits on an engineering owner deciding the iOS-banner swipe model for Toast, which no current spec covers. That means the 14 px dead zone and 0.55x follow, dismissal at 15.7 px or 105 px/s, no fade while dragging, the 0.5 s spring-back that also runs under Reduce Motion, pass-through while settling, a second finger that no longer cancels the swipe (blocking pinch-zoom for that gesture), and whether draft AST-094 may narrow the current theme-tokens and interaction-modality records. An engineering owner records that decision by commenting /approve-spec 19dd8fd3117aaf92e2b5a65473cea3d8a26160ef, and the author, as an engineering owner, may do so. These fixes are needed either way:

  • Rebase onto the merged stack (#8052 through #8047) so this PR carries only its Toast commit instead of 24,617 authored lines.
  • Remove or complete the "Touch presentation" section of packages/core/src/gestures/README.md, which documents a utils/touchPresentation.ts module and test that do not exist.
  • Correct the stale references (sources.test.ts, uikit/switch.ts, uikit/contextMenu.ts, "decides at 8" and the changeset's "projected with its velocity") and update AST-057's description of useToastGesture.

[Automated review]

Comment thread packages/core/src/gestures/README.md Resolved
Comment thread packages/core/src/gestures/README.md Resolved
@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.

Approval waits on an engineering owner deciding the iOS-banner swipe model for Toast, which no current spec covers: the 14 px dead zone and 0.55x follow, dismissal at 15.7 px or 105 px/s, no fade while dragging, the 0.5 s spring-back that also runs under Reduce Motion, pass-through while settling, a second finger that no longer cancels the swipe (blocking pinch-zoom for that gesture), and whether draft AST-094 may amend the current theme-tokens, interaction-modality, user-states, buttons and AST-025 records. An engineering owner records that decision by commenting /approve-spec 33dbb831a6124c75f70c487a8513dc376bd0f3fc, and the author, as an engineering owner, may do so. These fixes are needed either way:

  • Rebase onto the merged stack (#8052 through #8047) so this PR carries only its Toast commit instead of 26,022 authored lines.
  • Remove or complete the "Touch presentation" section of packages/core/src/gestures/README.md, which documents a utils/touchPresentation.ts module and test that do not exist.
  • Correct the stale references ("decides at 8", sources.test.ts, uikit/switch.ts, uikit/contextMenu.ts and the changeset's "projected with its velocity") and update AST-057's description of useToastGesture.

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

Approval waits on an engineering owner deciding the iOS-banner swipe model for Toast, which no current spec covers: the 14 px dead zone and 0.55x follow, dismissal at 15.7 px or 105 px/s, no fade while dragging, the 0.5 s spring-back that also runs under Reduce Motion, pass-through while settling, a second finger that no longer cancels a claimed swipe (blocking pinch-zoom for that gesture), and whether draft AST-094's requirements may become current. An engineering owner records that decision by commenting /approve-spec 4cf3606b4068909001bebf752e9188469dedfc21 on this pull request, and the author may do so if they are an engineering owner. These fixes are needed either way:

  • Rebase onto the merged stack (#8052 through #8047) so this PR carries only its Toast commit instead of 28,637 authored lines.
  • Take the theme motion roles and the platform adaptation condition out of this PR, or have architecture:theme-tokens INV1 and spec:AST-012 FR2 amended first, since draft AST-094 FR4 also says touch motion is not themable.
  • Return a standalone Toast to rest after a swipe dismissal, because today it stays where the finger left it when its owner keeps it mounted.
  • Remove or complete the gestures README's "Touch presentation" section, which documents a touchPresentation module that does not exist, and fix the stale references noted inline.

[Automated review]

Comment thread packages/core/src/motion/roles.ts Resolved
Comment thread packages/core/src/gestures/README.md Resolved
Comment thread packages/core/src/gestures/README.md 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.

Approval waits on an engineering owner deciding whether Toast should adopt the iOS notification-banner swipe and retract exit proposed in draft AST-094: an engineering owner records that decision by commenting /approve-spec e32f22318deea384b1b53adadc7088efaa781e9d on this pull request, and the author may do so if they are an engineering owner. Whatever that decision, these changes are needed:

  • Under Reduce Motion, cross-fade the iOS spring-back and retract in 200 ms or less instead of keeping their travel, as the current reduced-motion design record requires.
  • Clear the dismissal latch so a directly rendered Toast that stays mounted does not end off-screen and unresponsive on iOS.
  • Load the touch-only gesture and motion code lazily or justify it (Toast's import grows by about 25 KB gzip), and derive the compact edge from the theme's md point instead of 744 px.
  • Land the predecessor pull requests first so this one carries only its own commit.

[Automated review]

Comment thread packages/core/src/Toast/Toast.tsx Resolved
Comment thread packages/core/src/Toast/Toast.tsx Resolved
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

  • Touch gating. core/src/Toast/Toast.tsx:95 writes its own (pointer: coarse) check. This conflicts with AST-012 FR2 (touch is resolved once, through the closed adaptation vocabulary) and public-component-api INV16. Resolve through the shared touch resolver key so behavior matches the spec. If this behavior genuinely can't be expressed through the resolver, please raise it here as a spec question instead of shipping a separate check.
  • Reduced motion. core/src/Toast/useToastBannerSwipe.ts:101 handles reduced motion locally. Per design:reduced-motion (DR1–DR4), the animator is the one place that resolves it (touch cross-fades in 200 ms or less with no travel, a fine pointer changes at once), and core has no opt-out, so reducedMotion: 'keep' should be removed.
  • Commit or spring back on release. core/src/Toast/toastSwipe.ts:33 decides on its own whether a release finishes or springs back. A shared release rule is being specified (AST-057 FR5 covers row swipe today); avoid a component-specific threshold model.

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • Touch gating: the swipe keys on the shared touch resolver (useTouchPresentation, a coarse primary pointer, the same on every touch device), and the banner swipe lives in Toast's one touch module, useToastBannerSwipe.ts; Toast.tsx keeps no pointer or touch-callout check of its own.
  • Reduced motion: reducedMotion: 'keep' is gone; the spring-back and the retract follow the animator's policy (a release passes touchRelease), and the entrance uses the shared reduced-motion queries and constants.
  • Commit or spring back on release: the release speed moves to the shared tracker (AST-100, spec(AST-100): one velocity tracker and one release filter for every gesture #8312); the dismiss offset and flick speed stay Toast's tuning in motion/uikit/toast.ts (AST-100 FR3).

@vjeux
vjeux force-pushed the uikit/c25-toast-swipe branch from e32f223 to a0dfe79 Compare October 25, 2026 00:16
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026
@vjeux vjeux changed the title feat(Toast): the swipe follows iOS notification banners feat(Toast): the swipe follows iOS notification banners under a finger Oct 25, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 407c161

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

Changes requested. An engineering owner approved the Toast and touch-presentations record changes for this head, so the banner swipe and the slide-out exit under a finger are decided direction. Two things remain.

Blocking

  • Miss: when a swipe begins, or a dismissal starts, while the toast is still entering, useToastBannerSwipe.ts:365 and :449 turn the card's transitions off, which cancels the entrance so the card jumps to rest and full opacity instead of moving on from where it shows (touch-presentations FR6, Toast FR5); leaving a running entrance alone until it ends, with catch tests that drag and dismiss during a slowed entrance, would fix it.
  • State in text, at this head, the real-iPhone Safari run and the Android-emulator runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile) that the touch-presentations record asks for, each with device or emulator, browser, head, animation scale and result; the only stated runs are from an earlier head, and the swipe code changed since, so they do not carry over.

The earlier review threads on the record amendments, the effects, the refs and the row's collapse are fixed at this head.

Claims and files checked
  • Claim: under a finger the swipe and exit follow the banner by default, with no new option. Verified (Toast.tsx gates on the touch presentation; no prop added).
  • Claim: the turn-back stretch is folded in. Verified (followOffset on negative travel; a stretched card always springs back).
  • Claim: a fine pointer is unchanged. Verified: useToastGesture still drives it; only the reduced-motion key moves from 0.01 ms to none, which shows the same and which nothing waits on.
  • Claim: each measured value carries its source. Verified (motion/uikit/toast.ts).
  • Claim: the pan is decided on the touch's first move, and the follow, the settle and the slide-out run on the shared animator. Verified.
  • Claim: a finger catches a springing or leaving card where it shows. Verified; an entering card is not caught (blocking above).
  • Claim: a dragging or catching finger starts no text selection. Verified (lockSelection).
  • Claim: the layer turns the card's transitions off once a finger moves it, and a fine pointer gets them back. Verified; it also cuts a running entrance (blocking above).
  • Claim: a tap during the entrance leaves it running. Verified: a tap starts no pan, so nothing turns the transitions off.
  • Claim: the new latest-value refs use useCommittedRef, and the dismissal useCommittedRefInto. Verified.
  • Claim: the listed Toast record and touch-presentations amendments. Verified.
  • Claim: no public API rows. Verified from source.
  • Claim: the touch hook is used only by Toast.tsx, adds no observer, and exports its math. Verified; it also exports RETRACT_CLEARANCE and its two interfaces.
  • Claim: +2,929/-340 lines in 25 files, in fourteen commits with three merges of main. Verified.
  • Claim: device runs at this head are pending. Consistent with the blocking item above.
  • Claims: test pass counts, browser-spec results, bundle and app sizes, type-check and lint results, phone-emulation results. Not verified: CI skipped its jobs on this draft and the review could not install the toolchain.
  • Changeset: follow after 14 px at 0.55 with no jump; turn-back stretch; a flick or a far-enough drag dismisses; every dismissal slides out unfaded and the row closes after; the catch; a fine pointer unchanged; reduced motion fades under a finger and changes at once otherwise. Verified against useToastBannerSwipe.ts, Toast.tsx and ToastViewport.tsx.
  • Files: useToastBannerSwipe.ts (blocking finding); Toast.tsx, ToastViewport.tsx, motion/uikit/toast.ts, motion/uikit/index.ts, both records, the changeset, Toast.doc.mjs, the story, MEASUREMENTS.md, motion README.md, the seven sandbox files, ToastViewport.test.tsx, toastSwipe.test.ts, toastSpringRows.test.ts and the three browser specs: clear.

Automated review (maintainer link)

A swipe that began, or a dismissal that started, while the toast was
still entering turned the card's stylesheet transitions off. That cut
the entrance, so the card jumped to rest and full opacity. The layer
now turns them off only just before a Reduce Motion fade, which is the
only time WebKit replays them, so an entrance runs on under a finger.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 48bfd6a

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

Changes requested. An engineering owner approved the Toast and touch-presentations record changes for this head, so the banner swipe and the slide-out exit under a finger are decided direction, and the code shows no blocking defect.

Blocking

  • State in text, at this head, the real-iPhone Safari run and the Android-emulator runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile) that the touch-presentations record asks for, each with device or emulator, browser, head, animation scale and result; the only stated runs are from an earlier head, and the swipe code changed since, so they do not carry over.

Non-blocking: under Reduce Motion, a dismissal during the 200 ms entrance fade still steps the card to full opacity before it fades out (useToastBannerSwipe.ts:201-209); starting the cross-fade from the on-screen opacity would remove the step.

Claims and files checked
  • Claim: under a finger the swipe and exit follow the banner by default, with no new option. Verified (Toast.tsx gates on the shared touch presentation; no prop added).
  • Claim: the turn-back stretch is folded in. Verified (followOffset on negative travel; a stretched card always springs back).
  • Claim: a fine pointer is unchanged. Verified: useToastGesture still drives it; only the reduced-motion transition moves from 0.01 ms to none, which shows the same.
  • Claim: each measured value carries its source. Verified (motion/uikit/toast.ts; the axis ratio is marked as a guess with its measurement listed).
  • Claim: the pan is decided on the first move, and the follow, the settle and the retract run on the shared animator. Verified.
  • Claim: a finger catches a springing or leaving card where it shows. Verified in code (shouldReceiveTouch stops the animator at the shown value).
  • Claim: a dragging or catching finger starts no text selection, and a still hold on a resting card still can. Verified (lockSelection only at a catch or once the swipe begins).
  • Claim: the card's own transitions turn off only just before a Reduce Motion fade, so an entrance runs on under a finger, and a fine pointer gets them back. Verified (stillTransitionsBeforeFade; the layer's cleanup removes the override).
  • Claim: the new latest-value refs use useCommittedRef, and the dismissal useCommittedRefInto. Verified.
  • Claim: the dismissal is stored before any layout effect of the first commit. Verified in code and in a jsdom case.
  • Claim: a catch whose lift the page never hears ends at the next touch. Covered by a browser case; not reproduced.
  • Claim: the listed Toast record and touch-presentations edits. Verified against the diff.
  • Claim: no public API rows. Verified from source.
  • Claim: the touch hook is used only by Toast.tsx, adds no observer, and exports its math. Verified; it also exports RETRACT_CLEARANCE and its two interfaces.
  • Claim: +3,103/-340 lines in 25 files, fifteen commits, with the stated per-group split. Verified.
  • Claim: device runs at this head are pending. Consistent with the blocking item above.
  • Claims: test pass counts, browser-spec results, bundle and app sizes, type-check, lint and phone-emulation results. Not reproduced: CI skipped its jobs on this draft.
  • Changeset: follow after 14 px at 0.55 with no jump; turn-back stretch; a flick or a far-enough drag dismisses; every dismissal slides out unfaded and the row closes after; the catch; a fine pointer unchanged; reduced motion fades under a finger and changes at once otherwise. Verified against useToastBannerSwipe.ts, Toast.tsx and ToastViewport.tsx.
  • Files: useToastBannerSwipe.ts (non-blocking note); Toast.tsx, ToastViewport.tsx, motion/uikit/toast.ts, motion/uikit/index.ts, both records, the changeset, Toast.doc.mjs, the story, MEASUREMENTS.md, motion README.md, the seven sandbox files, ToastViewport.test.tsx, toastSwipe.test.ts, toastSpringRows.test.ts and the three browser specs: clear.

Automated review (maintainer link)

Under Reduce Motion, a dismissal in the toast's first 200 ms turned the
card's transitions off before its fade call. That cut the entrance
fade, so the card stepped to full opacity first. The exit now calls the
animator first, which takes the opacity on screen, then turns the
transitions off. That also ends a running opacity transition, which
WebKit would keep.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 270bd41

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

Changes requested. An engineering owner approved the Toast and touch-presentations record changes for this exact head, so the banner swipe and slide-out exit under a finger are decided direction, and the code shows no blocking defect.

Blocking

  • State in text, at this head, the real-iPhone Safari run and the Android-emulator runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile) that the touch-presentations record asks for, each with device or emulator, browser, head, animation scale and result; the stated runs are from an earlier head and the swipe code has changed since, so they do not carry over.
Claims and files checked
  • Claim: under a finger the swipe and every exit follow the banner by default, with no new option. Verified: the touch layer is gated on the shared touch resolver and no prop is added.
  • Claim: a fine pointer is unchanged. Verified: the desktop swipe code is unchanged; its Reduce Motion transition goes from 0.01 ms to none, which looks the same.
  • Claim: the follow, release rule, settle and slide-out use the measured banner values, each with its source. Verified in the UIKit table's Toast domain.
  • Claim: a finger catches a springing or leaving card, and a dragging or catching finger starts no selection. Verified in code.
  • Claim: under Reduce Motion a dismissal during the entrance fades from the opacity on screen. Verified in code: the animator call comes before the transitions go off.
  • Claim: the new latest-value refs go through the shared committed-ref hooks. Verified.
  • Claim: no public API rows change. Verified from source.
  • Claim: the record edits listed in the description. Verified against the diff.
  • Claim: size, line split and commit count. Line split and commit count verified; bundle sizes not rebuilt.
  • Claim: device runs at this head are pending. Consistent with the blocking item.
  • Claims: test pass counts, lint, type-check and phone-emulation results. Not reproduced, since CI skipped this draft.
  • Changeset: the follow, the turn-back stretch, the flick and distance rule, the slide-out exit, the catch, an unchanged fine pointer and the Reduce Motion fade. Verified against the touch layer, the card and the viewport row.
  • Files: the touch layer, the card, the viewport row, the measured table and its index, both records, the changeset, the doc text, the story, the two motion docs, the seven sandbox files and the six test files were read at this head: clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec ad73222

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

Changes requested. An engineering owner approved the Toast and touch-presentations record changes for this exact head, so the banner swipe and slide-out exit under a finger are decided direction, and the code shows no blocking defect.

Blocking

  • State in text, at this head, the real-iPhone Safari run and the Android-emulator runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile) that the touch-presentations record asks for, each with device or emulator, browser, head, animation scale and result; the stated runs are from an earlier head, and the swipe code and this head's merge of the shared animator have changed since, so they do not carry over.

Required CI has not run on this head yet, since CI skips the draft.

Claims and files checked
  • Claim: under a finger the swipe and every exit follow the banner by default, with no new option. Verified: the touch layer is gated on the shared touch resolver and no prop is added.
  • Claim: a fine pointer is unchanged. Verified: the desktop swipe code is unchanged; its Reduce Motion transition goes from 0.01 ms to none, which looks the same.
  • Claim: the follow, release rule, settle and slide-out use the measured banner values, each with its source. Verified in the UIKit table's Toast domain.
  • Claim: a finger catches a springing or leaving card, and a dragging or catching finger starts no selection. Verified in code.
  • Claim: under Reduce Motion the card's own transitions go off around a fade, and a dismissal during the entrance fades from the opacity on screen. Verified in code: the animator call comes before the transitions go off.
  • Claim: the new latest-value refs go through the shared committed-ref hooks. Verified.
  • Claim: no public API rows change. Verified from source.
  • Claim: the record edits listed in the description. Verified against the diff.
  • Claim: commit count, file count and line split. Verified; bundle sizes not rebuilt.
  • Claim: the last merge of main brings the animator and anchored-layer entrance changes. Verified; Toast uses none of the animator's new options.
  • Claim: device runs at this head are pending. Consistent with the blocking item.
  • Claims: test pass counts, lint, type-check and phone-emulation results. Not reproduced, since CI skipped this draft.
  • Changeset: the follow, the turn-back stretch, the flick and distance rule, the slide-out exit, the catch, an unchanged fine pointer and the Reduce Motion fade. Verified against the touch layer, the card and the viewport row.
  • Files: the touch layer, the card, the viewport row, the measured table and its index, both records, the changeset, the doc text, the story, the two motion docs, the seven sandbox files (one of them a test) and the six Toast test files were read at this head: clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 0a6be9d

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

Changes requested. An engineering owner approved the Toast and touch-presentations record changes for this exact head, so the banner swipe and slide-out exit under a finger are decided direction, and the code shows no blocking defect; one piece of evidence the touch-presentations record requires is still missing.

Blocking

  • State in text, at this head, the real-iPhone Safari run and the Android-emulator runs (Chrome with Gboard, animations at normal scale and removed, plus a slow-device profile) that the touch-presentations record asks for, each with device or emulator, browser, head, animation scale and result; the stated runs are from an earlier head, and the swipe code and this head's merge into Toast.tsx have changed since, so they do not carry over.

Required CI has not run on this head yet, since CI skips the draft.

Claims and files checked
  • Changeset: under a finger the card stays still for 14 px, then follows at 0.55 of the finger with no jump. Verified in the touch layer's follow function and its unit tests.
  • Changeset: a swipe that turns back stretches the card and springs it back. Verified: a negative follow never dismisses, and a jsdom case covers it.
  • Changeset: a quick flick toward the edge, or a card far enough out, dismisses; anything else springs back. Verified in the release rule (15.7 px out, or 105 px/s toward the edge from at or past rest; a release moving back springs back) and its tests.
  • Changeset: every dismissal under a finger slides the card past its edge without fading, and its row closes after it. Verified in the card's dismissal path and the viewport row, which waits for the slide.
  • Changeset: a finger catches a card that springs back or leaves, and the card follows it. Verified in the touch layer's catch; the two-engine browser cases were not run here.
  • Changeset: before, the card faded and shrank under a finger and faded out when dismissed. Verified against the base swipe.
  • Changeset: nothing changes with a fine pointer. Verified: the desktop swipe is unchanged; its reduced-motion transition goes from 0.01 ms to none, which looks the same.
  • Changeset: under reduced motion the toast fades in place under a finger and changes at once otherwise. Verified in the card's styles and the animator's cross-fade.
  • Description: the swipe and exit follow the banner by default under a coarse primary pointer, with no new option. Verified: the layer keys on the shared touch resolver and no prop is added.
  • Description: the measured values live in the UIKit table's Toast domain, each with its source. Verified.
  • Description: the new latest-value refs use the shared committed-ref hooks. Verified.
  • Description: the touch layer adds no observer and holds selection through the shared lock. Verified.
  • Description: the record edits (Toast FR4, FR5, three gap bullets, compatibility, DEC-1, DEC-2, three verification rows, an ownership line; touch-presentations FR36, FR45 and pointers in FR4, FR7, FR38). Verified in the diff.
  • Description: no public API rows change. Verified: a base and head build of Core and the seven themes compare with 0 rows.
  • Description: commit count, 25 files and the line split. Verified (18 commits, +3,255/−340).
  • Description: the latest merges bring main's changes and rename the swipe handle's reset to make room for the host data attributes. Verified.
  • Description: the Toast, motion table and sandbox route jsdom suites pass. Verified at this head (19 files, 704 tests); the wider 117-file run, the two-engine browser results, phone emulation, type check, lint and bundle sizes were not reproduced.
  • Description: device runs at this head are pending. Consistent with the blocking item.
  • Files: the touch layer, the card, the viewport row, the measured table and its index, both records, the changeset, the doc text, the story, the two motion docs, the six sandbox files and the seven test files: clear apart from the blocking item.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 496e170

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

Changes requested. The Toast and touch-presentations record changes carry an engineering owner's approval at this head, and the stated iPhone run passes. The stated Android run fails one case, and the description overstates the selection test.

Blocking

  • Miss: on Chrome for Android a slow drag on the toast selects its text and the card does not move (the owner's real-Pixel run at this head), against Toast FR4 and the touch-presentations record's FR41, because a resting card takes its selection hold only once the pan begins (useToastBannerSwipe.ts:388-392); make a slow first move toward the edge move the card and start no selection, with a test whose drag reaches the pan's start slowly.
  • Miss: the description says "A dragging or catching finger starts no text selection", but the selection test covers only a 20 px drag in 60 ms and a catching finger, so fix the slow drag to make the sentence hold or narrow it until then.

After the fix, state the iPhone re-take and the Android set at the fixed head in text, as the owner asked; no clip needs attaching. Required CI has not run on this head yet, because CI skips draft pull requests.

Claims and files checked
  • Changeset: under a finger the card stays still for 14 px, then follows at 0.55 of the finger with no jump. Verified in the follow function and its unit tests.
  • Changeset: a swipe that turns back stretches the card and springs it back. Verified in the release rule and a jsdom case.
  • Changeset: a quick flick toward the edge, or a card far enough out, dismisses; anything else springs back. Verified (15.7 px out, or 105 px/s toward the edge from at or past rest; a release moving back springs back) with tests.
  • Changeset: every dismissal under a finger slides the card past its edge without fading, and its row closes after it. Verified in the dismissal path and the row.
  • Changeset: a finger catches a card that springs back or leaves. Verified in the touch layer's catch and its browser spec.
  • Changeset: nothing changes with a fine pointer. Verified: the desktop swipe is unchanged, and its reduced-motion transition stays immediate.
  • Changeset: under reduced motion the toast fades in place under a finger and changes at once otherwise. Verified in the card's styles and the animator's cross-fade.
  • Description: the banner swipe and exit are the default under a coarse primary pointer, with no new option. Verified.
  • Description: the measured values live in the UIKit table's Toast domain, each with its source. Verified.
  • Description: a dragging or catching finger starts no text selection. False for a slow drag on Chrome for Android; the test covers a quick drag and a catch only.
  • Description: the new latest-value refs use the shared committed-ref hooks. Verified.
  • Description: the record edits to Toast and the touch-presentations record. Verified in the diff.
  • Description: no public API rows change. Verified: base and head builds of Core and the seven themes compare with 0 rows.
  • Description: 25 files, +3,255/−340. Verified.
  • Description: the Toast, motion and sandbox route unit suites pass, and core type-checks. Verified for 20 files and 793 tests; the browser specs and phone emulation were not rerun.
  • Files: the touch layer has the blocking finding; the card, the viewport row, the measured table and its index, both records, the changeset, the doc text, the story, the two motion docs, the six sandbox files and the other test files are clear.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

Decision: D-20261113-192

Records the owner's pick A (the banner slide for all exits) and her accepted touch swipe-feel fix at 496e170, where the real-phone farm take passed every drivable case on iPhone. The Android set FAILED at this head: on a real Pixel at normal settings, a slow drag on the toast selects its text and the card does not move, against component:Toast FR4 and spec:AST-094 FR41. A fix is required, then an iPhone farm re-take and the Android set at the fixed head.

@astracat-bot

astracat-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

In reply to @cixzhang

I'll run a full review to re-check this with your note.

This branch was successfully deployed

1 active deployment
Preview — 496e1700 Deployed Nov 13, 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