From 8a2e87339e52f46c5db903cd5fdf23f15102bdfc Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Wed, 18 Nov 2026 15:42:31 -0800 Subject: [PATCH 1/5] fix(NavigationStack): in WebKit a push or pop from rest waits for its frame at rest WebKit's UI process applies a commit late, so a from-rest transition that started at its commit or the next frame skipped into its curve after a heavy commit on iOS. In WebKit the transition now uses the animator's start: 'presented'. Chromium and Firefox keep next-frame or the commit. The engine check is read at transition time, with its removal condition beside it. A WebKit, Chromium and Firefox frame trace covers it, and AST-094's FR45 verification gets the engine line. --- .../specs/AST-094-touch-presentations/spec.md | 91 ++++++++++--------- .../src/NavigationStack/NavigationStack.tsx | 31 ++++++- ...avigationStack.interaction.browser.spec.ts | 65 +++++++++++++ 3 files changed, 138 insertions(+), 49 deletions(-) diff --git a/docs/specs/AST-094-touch-presentations/spec.md b/docs/specs/AST-094-touch-presentations/spec.md index a64ae86f50a86..9c20b13cd882a 100644 --- a/docs/specs/AST-094-touch-presentations/spec.md +++ b/docs/specs/AST-094-touch-presentations/spec.md @@ -1108,51 +1108,52 @@ Motion that FR45 moves, by component. Each component's record carries its own li ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | -| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | -| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | -| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | -| 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 | -| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | -| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | -| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | -| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | -| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | -| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | -| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | -| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | -| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | -| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | -| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | -| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | -| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | -| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | -| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | -| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | -| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | -| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | -| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | -| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | -| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | -| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | -| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | -| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | -| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | -| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | -| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | -| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | -| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | -| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | -| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | -| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | -| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | -| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | +| Contract | Verification | Representative states | Mutation or failure expectation | +| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | +| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | +| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | +| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | +| 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 | +| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | +| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | +| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | +| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | +| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | +| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | +| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | +| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | +| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | +| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit, Chromium and Firefox. WebKit applies commits late, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`), a narrow engine workaround removed when WebKit applies commits on time (re-check each Safari major version; the WebKit trace then passes with `next-frame`) | A row tap whose push commit blocks the main thread for 300 ms; the pushed card's offset in the first six frames after the task | A first moving frame that shows a third or more of the travel fails; in WebKit a push that moves before its second frame fails; elsewhere a push that first moves after its third frame fails | +| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | +| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | +| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | +| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | +| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | +| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | +| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | +| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | +| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | +| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | +| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | +| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | +| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | +| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | +| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | +| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | +| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | +| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | +| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | +| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | +| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | +| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | +| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | +| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | +| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | ## Decision log diff --git a/packages/lab/src/NavigationStack/NavigationStack.tsx b/packages/lab/src/NavigationStack/NavigationStack.tsx index ca03fb6881e4f..aa3542b29d0fb 100644 --- a/packages/lab/src/NavigationStack/NavigationStack.tsx +++ b/packages/lab/src/NavigationStack/NavigationStack.tsx @@ -767,7 +767,22 @@ function writingDirection(element: HTMLElement | null): 'ltr' | 'rtl' { } /** When a transition's animations start, as the animator's call options. */ -type TransitionClock = {at?: number; start?: 'next-frame'}; +type TransitionClock = {at?: number; start?: 'next-frame' | 'presented'}; + +/** + * Whether the page runs in WebKit, whose UI process applies a commit late. + * There, a transition from rest that starts at its commit or at the next + * frame skips into its curve after a heavy commit on iOS. A page cannot + * detect late commits as a capability, so this is a narrow engine + * workaround. Read it on the client, at transition time. + * Remove it when WebKit applies commits on time: re-check at each Safari + * major version, when the WebKit busy-thread fixture passes with + * `next-frame`. A capability probe in the animator can replace it. + */ +function appliesCommitsLate(view: Window | null | undefined): boolean { + const userAgent = view?.navigator.userAgent ?? ''; + return userAgent.includes('AppleWebKit') && !userAgent.includes('Chrome'); +} /** * The clock of a transition. A finger's release keeps its release time, so @@ -775,15 +790,22 @@ type TransitionClock = {at?: number; start?: 'next-frame'}; * leaves its start to the animator. The browser's commit then dates it. So a * heavy commit or a later listener's block delays the motion. It never skips * ahead. In an input event's own task (a tap on a row, a key), the motion - * starts at the first frame after that task. + * starts at the first frame after that task. In WebKit it starts once the + * frame at rest has been presented. */ function transitionClock( releasedAt: number | undefined, isInputTask: boolean, + commitsLate: boolean, ): TransitionClock { if (releasedAt != null) { return {at: releasedAt}; } + // WebKit: the animations come two frames later, once the frame at rest + // has been presented, and start at their commit. + if (commitsLate) { + return {start: 'presented'}; + } return isInputTask ? {start: 'next-frame'} : {}; } @@ -1175,10 +1197,11 @@ export function NavigationStack({ const values = layersAt(to, width, direction); const velocity = dp == null ? null : layerVelocities(dp, width, direction); + const view = containerRef.current?.ownerDocument.defaultView; const clock = transitionClock( releasedAt, - inputTaskRef.current || - isDispatchingInput(containerRef.current?.ownerDocument.defaultView), + inputTaskRef.current || isDispatchingInput(view), + appliesCommitsLate(view), ); const topLayers = layersOf(top); const underLayers = layersOf(under); diff --git a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts index dad3226b4f25c..d80985070775c 100644 --- a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts +++ b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts @@ -1218,6 +1218,71 @@ test('a push whose commit blocks the main thread starts from its first frame', a expect(Math.abs(x) / width).toBeGreaterThan(0.5 * leftAt(sinceBlock)); }); +test("a push from rest after a heavy commit starts on the engine's clock: at rest for its presented frames in WebKit, moving at once elsewhere", async ({ + page, + browserName, +}) => { + // WebKit's UI process applies a commit late, so there the push waits until + // the frame at rest has been presented and starts at its own commit. Other + // engines start at the first frame after the task, as before. Either way, + // the first frame that moves shows the push near its start, never skipped + // into its curve. + const {driver, width} = await openStack(page, 'settings'); + await page.evaluate(() => { + const observer = new MutationObserver(() => { + if ( + document.querySelector('[data-navigation-screen="screen-General"]') == + null + ) { + return; + } + observer.disconnect(); + const until = performance.now() + 300; + while (performance.now() < until) { + // Hold the main thread, as a heavy commit does. + } + }); + observer.observe(document.body, {childList: true, subtree: true}); + }); + await driver.tap(await rowCenter(page, 'General')); + // The pushed card's offset in each of the first six frames after the task. + const offsets = await page.evaluate( + () => + new Promise(resolve => { + const read: number[] = []; + const step = () => { + const pushed = document.querySelector( + '[data-navigation-screen="screen-General"]', + ); + const value = + pushed == null ? 'none' : getComputedStyle(pushed).translate; + read.push(value === 'none' ? 0 : Math.abs(parseFloat(value))); + if (read.length < 6) { + requestAnimationFrame(step); + } else { + resolve(read); + } + }; + requestAnimationFrame(step); + }), + ); + const travelled = offsets.map(offset => 1 - offset / width); + const firstMoving = travelled.findIndex(share => share > 0.005); + expect(firstMoving).toBeGreaterThanOrEqual(0); + if (browserName === 'webkit') { + // At rest until its frame at rest has been presented: two frames, then + // its commit. + expect(firstMoving).toBeGreaterThanOrEqual(2); + } else { + // Unchanged: the first frame after the task starts it, and the next one + // shows it moving. + expect(firstMoving).toBeLessThanOrEqual(2); + } + // Never skipped into its curve: the first frame that moves shows less + // than a third of the travel. + expect(travelled[firstMoving]).toBeLessThan(1 / 3); +}); + test('a push keeps advancing every frame while the main thread is blocked', async ({ page, browserName, From 8fbe00c002f92cb64f28ea880fab80118eaf84f9 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Wed, 18 Nov 2026 16:06:16 -0800 Subject: [PATCH 2/5] test(NavigationStack): judge the first moving frame against the time since the frame before it A mouse click drives the row in every engine, so Firefox runs too. The first moving frame may show no more of the spring than the time since the frame before it (or since the block ended) allows, plus one frame. --- ...avigationStack.interaction.browser.spec.ts | 89 ++++++++++++------- 1 file changed, 55 insertions(+), 34 deletions(-) diff --git a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts index d80985070775c..712f8051b88b2 100644 --- a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts +++ b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts @@ -1218,16 +1218,17 @@ test('a push whose commit blocks the main thread starts from its first frame', a expect(Math.abs(x) / width).toBeGreaterThan(0.5 * leftAt(sinceBlock)); }); -test("a push from rest after a heavy commit starts on the engine's clock: at rest for its presented frames in WebKit, moving at once elsewhere", async ({ +test("a push from rest after a heavy commit starts on the engine's clock and never skips into its curve", async ({ page, browserName, }) => { // WebKit's UI process applies a commit late, so there the push waits until // the frame at rest has been presented and starts at its own commit. Other // engines start at the first frame after the task, as before. Either way, - // the first frame that moves shows the push near its start, never skipped - // into its curve. - const {driver, width} = await openStack(page, 'settings'); + // the first frame that moves shows no more of the spring than the time + // since the frame before it allows, so the push never skips into its curve. + // A mouse click is an input task in every engine, as a tap is. + const {width} = await openStack(page, 'settings'); await page.evaluate(() => { const observer = new MutationObserver(() => { if ( @@ -1241,46 +1242,66 @@ test("a push from rest after a heavy commit starts on the engine's clock: at res while (performance.now() < until) { // Hold the main thread, as a heavy commit does. } + (window as Window & {blockEnd?: number}).blockEnd = performance.now(); }); observer.observe(document.body, {childList: true, subtree: true}); }); - await driver.tap(await rowCenter(page, 'General')); - // The pushed card's offset in each of the first six frames after the task. - const offsets = await page.evaluate( + const row = await rowCenter(page, 'General'); + await page.mouse.click(row.x, row.y); + // The pushed card's offset and the frame time, in the first six frames, + // and when the block ended. + const {frames, blockEnd} = await page.evaluate( () => - new Promise(resolve => { - const read: number[] = []; - const step = () => { - const pushed = document.querySelector( - '[data-navigation-screen="screen-General"]', - ); - const value = - pushed == null ? 'none' : getComputedStyle(pushed).translate; - read.push(value === 'none' ? 0 : Math.abs(parseFloat(value))); - if (read.length < 6) { - requestAnimationFrame(step); - } else { - resolve(read); - } - }; - requestAnimationFrame(step); - }), + new Promise<{frames: {offset: number; t: number}[]; blockEnd: number}>( + resolve => { + const read: {offset: number; t: number}[] = []; + const step = (t: number) => { + const pushed = document.querySelector( + '[data-navigation-screen="screen-General"]', + ); + const value = + pushed == null ? 'none' : getComputedStyle(pushed).translate; + read.push({ + offset: value === 'none' ? 0 : Math.abs(parseFloat(value)), + t, + }); + if (read.length < 6) { + requestAnimationFrame(step); + } else { + resolve({ + frames: read, + blockEnd: + (window as Window & {blockEnd?: number}).blockEnd ?? 0, + }); + } + }; + requestAnimationFrame(step); + }, + ), ); - const travelled = offsets.map(offset => 1 - offset / width); + const travelled = frames.map(frame => 1 - frame.offset / width); const firstMoving = travelled.findIndex(share => share > 0.005); expect(firstMoving).toBeGreaterThanOrEqual(0); if (browserName === 'webkit') { - // At rest until its frame at rest has been presented: two frames, then - // its commit. - expect(firstMoving).toBeGreaterThanOrEqual(2); + // At rest until its frame at rest has been presented. + expect(firstMoving).toBeGreaterThanOrEqual(1); } else { - // Unchanged: the first frame after the task starts it, and the next one - // shows it moving. - expect(firstMoving).toBeLessThanOrEqual(2); + // Unchanged: moving from the first frame after the task. + expect(firstMoving).toBeLessThanOrEqual(1); } - // Never skipped into its curve: the first frame that moves shows less - // than a third of the travel. - expect(travelled[firstMoving]).toBeLessThan(1 / 3); + // The spring's share after `ms` from rest (OMEGA, starting at + // PUSH_VELOCITY), and the most the first moving frame may show: the time + // since the frame before it (or since the block ended), plus one frame. + const shareAt = (ms: number) => { + const s = ms / 1000; + return 1 - (1 + (OMEGA - PUSH_VELOCITY) * s) * Math.exp(-OMEGA * s); + }; + const sincePrevious = + frames[firstMoving].t - + (firstMoving > 0 ? frames[firstMoving - 1].t : blockEnd); + expect(travelled[firstMoving]).toBeLessThanOrEqual( + shareAt(sincePrevious + 17) + 0.02, + ); }); test('a push keeps advancing every frame while the main thread is blocked', async ({ From e0a81cb777cde68d7389485b289ae17ed879f2e4 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Wed, 18 Nov 2026 16:46:44 -0800 Subject: [PATCH 3/5] test(NavigationStack): run the engine-clock trace without the touch driver; state what Linux WebKit guards Firefox runs the test as written. The engine check and AST-094's FR45 row say the defect reproduces on iOS Safari and Linux WebKit's trace guards only a time-correct start; the removal re-check is on iOS. --- .../specs/AST-094-touch-presentations/spec.md | 92 +++++++++---------- .../src/NavigationStack/NavigationStack.tsx | 8 +- ...avigationStack.interaction.browser.spec.ts | 10 +- 3 files changed, 59 insertions(+), 51 deletions(-) diff --git a/docs/specs/AST-094-touch-presentations/spec.md b/docs/specs/AST-094-touch-presentations/spec.md index 9c20b13cd882a..947b3243f1af0 100644 --- a/docs/specs/AST-094-touch-presentations/spec.md +++ b/docs/specs/AST-094-touch-presentations/spec.md @@ -1108,52 +1108,52 @@ Motion that FR45 moves, by component. Each component's record carries its own li ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | -| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | -| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | -| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | -| 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 | -| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | -| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | -| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | -| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | -| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | -| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | -| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | -| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | -| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | -| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit, Chromium and Firefox. WebKit applies commits late, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`), a narrow engine workaround removed when WebKit applies commits on time (re-check each Safari major version; the WebKit trace then passes with `next-frame`) | A row tap whose push commit blocks the main thread for 300 ms; the pushed card's offset in the first six frames after the task | A first moving frame that shows a third or more of the travel fails; in WebKit a push that moves before its second frame fails; elsewhere a push that first moves after its third frame fails | -| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | -| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | -| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | -| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | -| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | -| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | -| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | -| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | -| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | -| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | -| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | -| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | -| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | -| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | -| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | -| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | -| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | -| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | -| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | -| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | -| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | -| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | -| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | -| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | -| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | +| Contract | Verification | Representative states | Mutation or failure expectation | +| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | +| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | +| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | +| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | +| 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 | +| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | +| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | +| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | +| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | +| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | +| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | +| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | +| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | +| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | +| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit, Chromium and Firefox. WebKit's UI process applies commits late on iOS, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`): a narrow engine workaround, reproduced on iOS Safari, removed when WebKit applies commits on time (re-check each Safari major version on iOS). Linux WebKit does not show the late commit, so its trace guards only that the start stays correct for the time that passed | A row click whose push commit blocks the main thread for 300 ms; the pushed card's offset and frame time in the first six frames | A first moving frame that shows more of the spring than the time since the frame before it (or since the block ended) allows, plus one frame, fails; in WebKit a push that moves in its first frame fails; elsewhere a push that first moves after its second frame fails | +| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | +| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | +| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | +| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | +| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | +| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | +| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | +| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | +| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | +| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | +| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | +| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | +| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | +| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | +| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | +| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | +| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | +| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | +| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | +| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | +| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | +| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | +| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | +| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | +| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | ## Decision log diff --git a/packages/lab/src/NavigationStack/NavigationStack.tsx b/packages/lab/src/NavigationStack/NavigationStack.tsx index aa3542b29d0fb..595d926e6f5df 100644 --- a/packages/lab/src/NavigationStack/NavigationStack.tsx +++ b/packages/lab/src/NavigationStack/NavigationStack.tsx @@ -775,9 +775,11 @@ type TransitionClock = {at?: number; start?: 'next-frame' | 'presented'}; * frame skips into its curve after a heavy commit on iOS. A page cannot * detect late commits as a capability, so this is a narrow engine * workaround. Read it on the client, at transition time. - * Remove it when WebKit applies commits on time: re-check at each Safari - * major version, when the WebKit busy-thread fixture passes with - * `next-frame`. A capability probe in the animator can replace it. + * Reproduced on iOS Safari. Linux WebKit does not show the late commit, so + * its fixture guards only that the start stays correct for the time that + * passed. Remove it when WebKit applies commits on time: re-check at each + * Safari major version on iOS. A capability probe in the animator can + * replace it. */ function appliesCommitsLate(view: Window | null | undefined): boolean { const userAgent = view?.navigator.userAgent ?? ''; diff --git a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts index 712f8051b88b2..4629721b07db0 100644 --- a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts +++ b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts @@ -1227,8 +1227,14 @@ test("a push from rest after a heavy commit starts on the engine's clock and nev // engines start at the first frame after the task, as before. Either way, // the first frame that moves shows no more of the spring than the time // since the frame before it allows, so the push never skips into its curve. - // A mouse click is an input task in every engine, as a tap is. - const {width} = await openStack(page, 'settings'); + // A mouse click is an input task in every engine, as a tap is, so the + // test needs no touch path and Firefox runs it too. + await openStory(page, storybook(), 'lab-navigationstack--settings'); + const stackBox = await page.getByTestId('navigation-stack').boundingBox(); + if (stackBox == null) { + throw new Error('no stack'); + } + const width = stackBox.width; await page.evaluate(() => { const observer = new MutationObserver(() => { if ( From e3bfff2968864cf036a1f703cdda1fb8053bc781 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Wed, 18 Nov 2026 18:06:31 -0800 Subject: [PATCH 4/5] docs(NavigationStack): the engine-clock trace runs in Chromium and WebKit The interaction config has no Firefox project, so AST-094's FR45 row and the test comment no longer claim one. --- .../specs/AST-094-touch-presentations/spec.md | 92 +++++++++---------- ...avigationStack.interaction.browser.spec.ts | 2 +- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/specs/AST-094-touch-presentations/spec.md b/docs/specs/AST-094-touch-presentations/spec.md index 947b3243f1af0..833eb5d81db36 100644 --- a/docs/specs/AST-094-touch-presentations/spec.md +++ b/docs/specs/AST-094-touch-presentations/spec.md @@ -1108,52 +1108,52 @@ Motion that FR45 moves, by component. Each component's record carries its own li ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | -| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | -| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | -| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | -| 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 | -| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | -| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | -| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | -| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | -| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | -| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | -| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | -| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | -| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | -| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit, Chromium and Firefox. WebKit's UI process applies commits late on iOS, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`): a narrow engine workaround, reproduced on iOS Safari, removed when WebKit applies commits on time (re-check each Safari major version on iOS). Linux WebKit does not show the late commit, so its trace guards only that the start stays correct for the time that passed | A row click whose push commit blocks the main thread for 300 ms; the pushed card's offset and frame time in the first six frames | A first moving frame that shows more of the spring than the time since the frame before it (or since the block ended) allows, plus one frame, fails; in WebKit a push that moves in its first frame fails; elsewhere a push that first moves after its second frame fails | -| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | -| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | -| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | -| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | -| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | -| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | -| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | -| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | -| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | -| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | -| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | -| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | -| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | -| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | -| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | -| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | -| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | -| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | -| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | -| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | -| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | -| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | -| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | -| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | -| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | +| Contract | Verification | Representative states | Mutation or failure expectation | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | +| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | +| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | +| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | +| 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 | +| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | +| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | +| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | +| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | +| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | +| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | +| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | +| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | +| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | +| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit and Chromium. WebKit's UI process applies commits late on iOS, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`): a narrow engine workaround, reproduced on iOS Safari, removed when WebKit applies commits on time (re-check each Safari major version on iOS). Linux WebKit does not show the late commit, so its trace guards only that the start stays correct for the time that passed | A row click whose push commit blocks the main thread for 300 ms; the pushed card's offset and frame time in the first six frames | A first moving frame that shows more of the spring than the time since the frame before it (or since the block ended) allows, plus one frame, fails; in WebKit a push that moves in its first frame fails; elsewhere a push that first moves after its second frame fails | +| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | +| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | +| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | +| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | +| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | +| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | +| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | +| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | +| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | +| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | +| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | +| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | +| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | +| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | +| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | +| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | +| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | +| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | +| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | +| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | +| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | +| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | +| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | +| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | +| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | ## Decision log diff --git a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts index 4629721b07db0..14492a9c18e7b 100644 --- a/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts +++ b/packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts @@ -1228,7 +1228,7 @@ test("a push from rest after a heavy commit starts on the engine's clock and nev // the first frame that moves shows no more of the spring than the time // since the frame before it allows, so the push never skips into its curve. // A mouse click is an input task in every engine, as a tap is, so the - // test needs no touch path and Firefox runs it too. + // test needs no touch path. await openStory(page, storybook(), 'lab-navigationstack--settings'); const stackBox = await page.getByTestId('navigation-stack').boundingBox(); if (stackBox == null) { From f0d911d1658c0934ad956aac5455ccedaf5b5889 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Thu, 19 Nov 2026 04:13:13 -0800 Subject: [PATCH 5/5] docs(NavigationStack): say what the WebKit trace checks It checks that the first frame stays at rest and that the start fits the time that passed, so its WebKit check goes with the workaround. --- .../specs/AST-094-touch-presentations/spec.md | 92 +++++++++---------- .../src/NavigationStack/NavigationStack.tsx | 10 +- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/docs/specs/AST-094-touch-presentations/spec.md b/docs/specs/AST-094-touch-presentations/spec.md index 833eb5d81db36..dda2da17837f5 100644 --- a/docs/specs/AST-094-touch-presentations/spec.md +++ b/docs/specs/AST-094-touch-presentations/spec.md @@ -1108,52 +1108,52 @@ Motion that FR45 moves, by component. Each component's record carries its own li ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | -| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | -| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | -| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | -| 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 | -| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | -| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | -| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | -| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | -| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | -| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | -| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | -| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | -| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | -| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit and Chromium. WebKit's UI process applies commits late on iOS, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`): a narrow engine workaround, reproduced on iOS Safari, removed when WebKit applies commits on time (re-check each Safari major version on iOS). Linux WebKit does not show the late commit, so its trace guards only that the start stays correct for the time that passed | A row click whose push commit blocks the main thread for 300 ms; the pushed card's offset and frame time in the first six frames | A first moving frame that shows more of the spring than the time since the frame before it (or since the block ended) allows, plus one frame, fails; in WebKit a push that moves in its first frame fails; elsewhere a push that first moves after its second frame fails | -| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | -| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | -| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | -| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | -| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | -| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | -| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | -| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | -| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | -| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | -| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | -| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | -| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | -| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | -| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | -| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | -| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | -| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | -| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | -| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | -| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | -| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | -| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | -| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | -| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | +| Contract | Verification | Representative states | Mutation or failure expectation | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails | +| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values | +| FR3 pager | Unit tests of the pager's page choice against the recorded UIKit releases | releases at 292.7–298.6 pt/s that stay and 310.7–329.9 pt/s that advance, at 10, 25 and 40 % of a page; releases at rest at 45–48.5 % and 55–57.5 %; a 1.5-page drag released at 0, 600 and 3000 pt/s; a release moving back toward the start page | a page chosen by projection, a release at or past 300 pt/s that stays, or a release that travels more than one page from its start fails | +| 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; a frame interval counts as a miss only when the animation's own curve moves at least one capture step since the last frame that showed a new position | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out | +| 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 | +| FR6 starved | Switch frame proofs on a starved main thread (4 workers on 2 cores); unit tests of a retarget on a settle tail and a rebase toward a new rest | a second tap mid-travel, with frames read late or its lift handled 100 ms late; a first frame committed late; a retarget once the thumb is still; a value change mid-slide, whose rebase moves the travel whole | a jump out of a thumb that is still fails; a value change mid-slide shows no step | +| FR6 late commit | A browser test of a retarget behind a 200 ms block; unit tests of a retarget whose frame comes late | a retarget made in a task, and one made in a frame callback of the page, before a 200 ms block; a frame within 34 ms of the call; a velocity the call hands the spring; a hidden page; two properties, and two animators, before one late frame; retargets on two animators in one callback | a step at the frame that commits a retarget fails; a retarget whose frame comes within 34 ms keeps the call's own clock; a retarget made in a frame callback of the page that shows its new curve in any frame but the next fails; a late frame that drops a handed velocity fails; a hidden page's retarget that never finishes fails; a later call before a late frame that keeps its own clock fails; two animators' retargets in one callback on different clocks fail | +| FR6 resize | Unit and browser tests of a resize during a pager's settle | a narrowing that renumbers the pages mid-settle; a widening and a narrowing of pages as wide as the row, mid-settle and mid-drag; a rotation of pages with a fixed gap; pages that share a shift; a still finger whose catch spans a resize; a widening that regroups fixed-width views; a tie between two pages (units); a narrowing that splits the last page from the stop before it; a narrowing while a release settles toward the last page, sampled every frame on each settle's own clock; a settle begun before the viewport had a width, which lands on its target at once | a settle that ends on its old index's new offset, a settle or release on scaled pages that ends on another page or loses its fraction of a page, a regrouping that jumps, a tie that reverses, a settle toward the last page that ends short of the new last page, a split-end settle that rests on the split-off stop, or a frame after that narrowing more than 1 px from the paging integrator's curve fails. The curve runs from where the settle shows as the new one starts, at its velocity then, to the new last page. The first frame after the narrowing may still show the settle before it, or the new curve between its start and its clock, where the browser commits it inside that frame | +| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion; a tap-, key- and program-started close of a sheet and the Lightbox | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), an opacity fade over 200 ms, or a tap-, key- or program-started close of a gesture component on the exit curve instead of its spring, fails | +| FR45 | Browser tests with a mouse, a pen, a trackpad and a finger at each `tempo` bound and each `character`, and with Reduce Motion | a tap, a click, a key and a programmatic change on a Switch, a menu, an alert, a sheet and a ProgressBar under a fine and a coarse pointer; a drag release, a flick and a pinch on a Switch, a Slider, a sheet, a pager and a Lightbox photo under each pointer; a tap that continues as a drag | a tap, click, key or programmatic change in a tap-classified component that plays a measured role or a spring instead of the theme's duration and easing tokens, a touch tap-started move in a gesture or gesture-capable component on a curve instead of its spring, a click, a key or a value change on Switch or SegmentedControl without a touch presentation that leaves the theme's curve, a velocity-carrying release that settles from rest or on a curve, a gesture's spring that ignores `character` or `tempo`, or a part that follows one pointer and not another, fails; the pager's measured settle, which does not yet follow `character`, is a recorded implementation gap | +| FR45 | Component source and token tests for a tap component's motion whose record names no step, with a platform measurement | a small anchored surface (a popover, a menu, a toggle, a row) and a full-screen surface (a Dialog, an AlertDialog), each with its own measurement; a tap component's overlay exit | a token cited as nearest to the measurement in the Storybook theme passes, and a tap component's overlay exit on `--duration-exit` passes; a token chosen by role alone, or nearest at Core's unthemed defaults, fails | +| FR45 | Browser frame capture of companion motion in a gesture and a tap component | a sheet's scrim, handle and content fade; a Lightbox's chrome fade; a menu's backdrop | a companion fade on its own duration fails; one driven by the main motion's progress or settle time passes | +| FR45 | Browser frame trace of RefreshControl's end at `tempo` 1 and at each `tempo` bound, and a unit test of the end's timing | a refresh that ends with its indicator shown, at `tempo` 1 (300 ms), 0.75 (225 ms) and 1.5 (450 ms); a theme whose move easing differs from UIKit's curve | an end whose per-frame trace leaves UIKit's measured 300 ms ease-in-out by more than 0.75 pt at `tempo` 1, an end on the theme's move easing instead of UIKit's curve, or a duration that ignores the theme's `tempo`, fails | +| FR45 swipe row | Browser frame traces of a held swipe row in Chromium and WebKit, read against each touch move | a 140 px drag over 0.4 s, held 0.6 s; a slow drag from the open row to 40 px past the confirm point, held 0.6 s | Short of the confirm point, a frame from the claim to the lift whose row travel differs from the finger's travel since touch-down by more than 1 px fails; past it, a lead that shrinks, or that ends away from the confirmation offset, fails | +| FR45 NavigationStack WebKit | `NavigationStack.interaction.browser.spec.ts` frame trace of a push from rest, in WebKit and Chromium. WebKit's UI process applies commits late on iOS, so its from-rest push waits for its frame at rest to be presented (`start: 'presented'`): a narrow engine workaround, reproduced on iOS Safari, removed when WebKit applies commits on time (re-check each Safari major version on iOS). Linux WebKit does not show the late commit; its trace checks that the first frame stays at rest and that the start fits the time that passed, and that WebKit check goes with the workaround | A row click whose push commit blocks the main thread for 300 ms; the pushed card's offset and frame time in the first six frames | A first moving frame that shows more of the spring than the time since the frame before it (or since the block ended) allows, plus one frame, fails; in WebKit a push that moves in its first frame fails; elsewhere a push that first moves after its second frame fails | +| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a page pinch blocked other than by the author's `touch-action`, fails | +| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger; a press on a row of a menu whose rows fit and of one that scrolls; a slide-off lift on a Switch and on a Radio | the wrong profile's timing, a press that survives the browser taking the touch, or a control outside an action group activated other than by the browser's click, outside `spec:AST-020` FR9's slide-off exception, a row of a menu whose rows fit that waits 150 ms, or one of a scrolling menu that does not, or a slide-off lift that completes a control outside `spec:AST-020` FR9's exception, fails | +| FR11 theme | `generateThemeRules.test.ts` themed-`:active` cases; real-browser forced `:active` on the Themed press story | a theme `:active` on a base and on a variant with a trailing pseudo; fine pointer; coarse pointer with forced `:active` and with the press attribute | a bare theme `:active` rule a coarse pointer matches, or a coarse arm keyed on `:active`, fails | +| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails | +| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails | +| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a watcher beside a claiming winner; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis, or a watcher failed or cancelled by a claiming winner fails | +| FR18–FR22 | Browser tests with real touch input (`spec:AST-013` FR10) | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag; a still finger with sub-pixel jitter over a scroll view; a finger moved 9 px and 10 px straight, and (7, 7) and (8, 8) diagonally; a recognizer on an element whose author `touch-action` is narrower, including one without `pinch-zoom`; a screen-edge pan landing at 40 px and at 41 px from the edge, at 14 px and 15 px of travel, and a horizontal scroll that starts outside the band; a screen-edge pan on an element within the band, and on one that reaches beyond it; a sheet's pull from a list at its top, and from a list scrolled away from its top; a long press dragged past its tolerance after it began, which never scrolls the page | a ghost click, a scroll or zoom blocked other than by the author's `touch-action`, or a cancelled unowned touchmove outside FR19's five exceptions, a tap cancelled by sub-pixel movement or by under 10 px of travel, a scroll that does not take the touch at 10 px, or a derived `touch-action` wider than the author's, a screen-edge pan that claims outside its band or before 15 px on an element within the band, or has not claimed at 15 px, or an author scroll outside the band that is blocked, a band claim of `pan-x` on an element that reaches beyond the band, or a 15 px start there, or a scroll-edge pan that cancels a move a scroller could scroll, or begins before 10 pt, fails | +| FR19 (DEC-30) | Gesture unit tests on synthetic streams; browser tests with real touch input in WebKit and Chromium | a tap that wobbles 2–4 px toward a scroll edge keeps every move, and a 5 px move is cancelled; a sideways move is never held; NavigationStack's content back swipe on a pushed screen; RefreshControl's pull at its top, whose touch path is not a scroll-edge pan (a guard) | a move under 5 px along the pan's axis cancelled, a move from 5 px left uncancelled while every scroller under the finger sits at its edge, a sideways move held, or a pan that begins before its hysteresis fails | +| FR20 | Browser tests with real touch input in Chromium phone emulation (`spec:AST-013` FR10) | a horizontal drag under `pan-y`; a vertical drag under `pan-y` over a scroller with room; a vertical drag where no scroller has room | a horizontal drag under `pan-y` counted as the browser taking the touch, a vertical one over a scroller with room not counted, or a later uncancelable move counted, fails | +| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails | +| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a gesture listener in a component that uses no gesture, an idle document listener outside a press other than the one shared press controller and the one stray-click swallower, a second press controller, a per-instance `document` or `window` listener, or a leak fails | +| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails | +| FR26–FR28, FR30 | Menu press tests and each member's pointer-stream tests, as `family:action-groups`' verification map lists them and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails | +| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll taking the touch before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails | +| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a pinch blocked other than by the author's `touch-action`, a tap outside that reaches the page, or a changed mouse path fails | +| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse; a tap and a drag during an alert's, a sheet's, and a dialog's entrance; a key and a screen reader during an entrance; a pinch during an alert's and a sheet's entrance; a tap and a scroll on the page beside an entering non-modal sheet, which pass | a drill-in that leaves the parent's rows in place, a change between levels that does not play on the theme's move duration and easing tokens, a tap during growth that closes, scrolls or moves focus, a pinch blocked other than by the author's `touch-action`, or a changed mouse path, a held key or assistive-technology activation, a hidden content tree, or a tap or drag during an entrance that closes the presentation, scrolls a held page, moves focus or reaches anything beneath, fails | +| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity (a paging release starts its settle per FR6's paging paragraph, DEC-25), or an action with no keyboard or mouse path fails | +| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection; a pen long press; a mouse long press, which makes no context request; a mouse drag a recognizer claims, with and without a page selection; a mouse drag that starts on selectable text | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, a change to native selection elsewhere, to keyboard or assistive-technology selection, or to mouse selection outside a drag a recognizer claims, a claimed drag that takes a new selection or after which an existing one does not survive, or a drag starting on text that does not select text fails | +| FR41 (box) | Browser tests with real touch input (`spec:AST-013` FR10), and Mobile Safari on an iOS simulator | a finger held on the box of a checkbox, a CheckboxList row, a radio option and a switch, then lifted still; the same hold on the label beside it; a tap on the box; a hold that moves away; a mouse press on the box | a hold on a box that starts a selection or the callout, a still lift that does not activate the control exactly once, a label whose long press does not select natively, a suppression that outlives the press, or a change to a mouse press fails | +| FR42 | Default-theme geometry tests under a coarse and a fine pointer, and hit-testing between adjacent targets | every component at phone width with a finger and with a mouse; a dense toolbar; a chip and its remove button; a Switch beside a label link | a default-theme box that grows under touch or at phone width other than with its text, or, where no component or module record sets the hit area, a touch target under 44 px where neighbors allow it or a hit area that overlaps a neighbor's target, fails | +| FR43 | Browser tests with a mouse, a trackpad, a pen, a finger, and the keyboard, and resource counts | a pan by drag and by wheel; a slider's thumb under a wheel and a trackpad scroll; a ctrl-wheel pinch; a long press, a right click, and Shift+F10; a mouse press; a handle drag; a row swipe with a mouse and a trackpad; a component with no gesture | a gesture missing under a mouse or pen, a mouse-drag swipe action, a pen pinch, an edge pan under a mouse, a trackpad, or a pen, a press delay under a fine pointer, a wheel or trackpad scroll that changes a thumb's value or does not reach the scroll under it, an idle listener in a component with no gesture, or added stylesheet bytes, fails | +| FR43 trackpad | Unit tests on timed wheel streams; WebKit browser tests with trackpad streams (Chromium's driver wheels read as a mouse wheel) | a form and a required sheet pulled 30 to 240 px by a finger and by a trackpad; mouse lines, notches, ticks and accelerated deltas over a sheet, a pager and a row; ten swipes each starting mid-momentum, ten whose momentum ends, and a slow drag with 150 ms pauses; a trackpad flick and a slow stopped drag on an info sheet; a fling, a slow 60 px swipe, a 42 px spike and back-to-back swipes on a pager; a row opened and swiped back within one gesture, and a long fast swipe; a pinch ending; a trackpad pan through a window blur and through a hidden page | a trackpad stretch that differs from a finger's for the same travel (120 px gives 54 px on the reference sheet), a mouse wheel that moves a sheet, a pager or a row, splitter counts other than ten, ten and one, momentum that moves a surface, a flick released with no velocity, a pager that travels past one page or pages on a spike, an info sheet a flick leaves open or a slow stopped drag closes, an open row that reveals its other side within one gesture, a trackpad pan a window blur or a hidden page leaves mid-gesture, or a pinch that ends after 100 ms fails | +| FR44 | Unit tests of a pen press a window blur ends, on a Switch, a Slider and the host, under a coarse and a fine pointer | a pen press on a Switch and on a Slider, blur mid-press: nothing toggles or commits; a pen whose contact ends in `pointercancel` | with the host keeping no note of a blur-cancelled pen, the Switch toggles at the pen's click | +| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari devices; Android Chrome in the Android emulator (DEC-27) | per component | an unmatched curve or timing is a parity defect | +| all (DEC-31) | The evidence-carry check, before device or emulator evidence from an earlier head counts at a later head | a later head that only merges `main`; the pull request's own changes byte-identical or changed; a merge that changes a file the pull request changes, a direct import of those changes, a shared motion or layer module, or none of them; a generated file among the pull request's own files that CI proves regenerates identically, or does not prove; a commit, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, or knowledge records, or not | the evidence-carry check compares the PR's own diff between the two heads, and the merge's changed files against the files the PR changes, the changes' direct imports and the shared motion and layer modules (currently `motion/transientCopy`, `motion/inertClone`, `motion/animator`, `motion/carryAnimations`, `Layer/useLayer`, `hooks/usePager`); any overlap fails, except a generated file among the pull request's own files that CI proves regenerates identically at the new head; a changed own diff, or an overlap with the pull request's own files, confined to test-only files as DEC-31 defines them, knowledge records or `.changeset/` release notes, passes | ## Decision log diff --git a/packages/lab/src/NavigationStack/NavigationStack.tsx b/packages/lab/src/NavigationStack/NavigationStack.tsx index 595d926e6f5df..acdb58e59b148 100644 --- a/packages/lab/src/NavigationStack/NavigationStack.tsx +++ b/packages/lab/src/NavigationStack/NavigationStack.tsx @@ -775,11 +775,11 @@ type TransitionClock = {at?: number; start?: 'next-frame' | 'presented'}; * frame skips into its curve after a heavy commit on iOS. A page cannot * detect late commits as a capability, so this is a narrow engine * workaround. Read it on the client, at transition time. - * Reproduced on iOS Safari. Linux WebKit does not show the late commit, so - * its fixture guards only that the start stays correct for the time that - * passed. Remove it when WebKit applies commits on time: re-check at each - * Safari major version on iOS. A capability probe in the animator can - * replace it. + * Reproduced on iOS Safari. Linux WebKit does not show the late commit. + * Its trace checks that the first frame stays at rest and that the start + * fits the time that passed. Remove it when WebKit applies commits on time: + * re-check at each Safari major version on iOS, and remove the trace's + * WebKit check with it. A capability probe in the animator can replace it. */ function appliesCommitsLate(view: Window | null | undefined): boolean { const userAgent = view?.navigator.userAgent ?? '';