Repository navigation
Conversation
…h the touch runtime Toast no longer imports the gesture host statically: its one-way pan that claims a finger's touch is a runtime part mounted after the load, and until then no swipe starts. Popover's touch presentation creates its surface motion from the runtime; until it loads a popover presents as under a fine pointer. INV13's gap line drops Toast and Popover. With these, no static path from Toast or Popover reaches the animator or the gesture host.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/approve-spec 039f33c |
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: moving Toast's swipe claim and Popover's touch motion onto the shared touch runtime works as described, and the record change has an engineering owner's approval at this head, but two things need fixing first.
ToastSwipeClaimkeepsshouldReceiveand its claim in refs through per-site Effects (packages/core/src/utils/touchRuntimeModules.tsxlines 99-103 and 126-129); useuseCommittedRef(shouldReceive)(or drop the ref, since that callback is stable) and passclaimRefso the part callsuseCommittedRefInto(claimRef, claim).- The Toast record's FR4 and the Popover record's FR9 still say a swipe toward the edge dismisses and a finger-opened popover grows, with no word about the window before the touch runtime loads; add one sentence to each that names that window under INV13 (for Toast, also under its swipe-only custom-content gap).
Also worth a look: the stack's Changeset names only SegmentedControl, Switch and BottomSheet, and the header of Popover/PopoverTouch.ts still says Popover imports the touch modules statically.
Claims and files checked
- Claim: Toast and Popover no longer import the touch runtime statically. Verified: the boundary test's new Toast and Popover cases fail on the base and pass here.
- Claim: a page with a toast or a popover no longer carries the runtime in its first load. Verified for both components' import graphs; page bytes not measured.
- Claim: on the measured app this is all of the embed view's remaining first-load touch code, about 32 KB gzip. Not verifiable from this pull request.
- Claim: no behavior changes after the load. Verified: 303 tests pass, and in a real browser the loaded popover grows and a swipe dismisses the toast exactly as on the base.
- Claim: no API change. Verified: the built API surfaces of Core and the themes are identical.
- Claim: before the load a toast tracks no swipe and still dismisses by its button, timer and keys. Verified by the new test and a browser finger swipe; the button and timer paths are unchanged.
- Claim: before the load a finger-opened popover presents as under a fine pointer. Verified by the new test and in a browser, which plays the layer's own entrance.
- Claim: the window is first paint, then idle, at most 2 s. Verified as when the load starts; the chunk download comes on top.
- Claim: a gesture already in flight when the load lands finishes on its old path. Verified in code: the swipe start and the presentation are decided at press and open.
- Claim: the pan is a runtime part that renders nothing and mounts after the card. Verified in
Toast.tsxandtouchRuntimeModules.tsx. - Claim: Popover takes the motion factory from the runtime at open. Verified in
usePopoverSurfaceMotion.ts. - Claim: INV13's gap line drops Toast and Popover. Verified.
- Claim: the three new tests fail on the base. Verified.
- Claim: suites that drive touch motion load the runtime first. Verified.
- Claim: 303 tests pass, and the core typecheck and knowledge check pass. Verified.
- Claim: public text carries no internal context. Verified.
- File
docs/architecture/react-component-runtime.md: clear. - File
packages/core/src/Popover/Popover.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.ts: non-blocking comment suggestion. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/Toast/useToastGesture.ts: finding (the claim is handed over through an Effect). - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: finding (two per-site ref Effects).
| const shouldReceiveRef = useRef(shouldReceive); | ||
| // Syncs the pan's touch filter with the toast's newest one. | ||
| useIsomorphicLayoutEffect(() => { | ||
| shouldReceiveRef.current = shouldReceive; | ||
| }); |
There was a problem hiding this comment.
This Effect only copies shouldReceive into a ref, which the repository's pre-review item j flags. Use const shouldReceiveRef = useCommittedRef(shouldReceive); from ../hooks/useCommittedRef, or drop the ref: shouldReceive is a useCallback with no dependencies in useToastGesture.ts.
| useIsomorphicLayoutEffect(() => { | ||
| onClaim(claim); | ||
| return () => onClaim(null); | ||
| }, [claim, onClaim]); |
There was a problem hiding this comment.
This Effect's only job is to write claim into useToastGesture's claimRef through onClaim. Pass claimRef in the props and call useCommittedRefInto(claimRef, claim) instead, so the hand-over goes through the shared hook.
| // The touch presentation's motion comes with the shared touch runtime, | ||
| // which loads after first paint. Until then a popover presents as under a | ||
| // fine pointer. | ||
| useTouchRuntime(); |
There was a problem hiding this comment.
Non-blocking (comment style): the call's result is unused, and the comment does not say why the call is here, so it reads as dead code. Suggested: // This call schedules the page's one load of the touch runtime. Until it loads, a popover presents as under a fine pointer.
|
/approve-spec 4693441 |
There was a problem hiding this comment.
Changes requested: Toast's swipe claim and Popover's touch motion now come from the shared touch runtime as described, and the record change has an engineering owner's approval at this head, but three things need fixing first.
ToastSwipeClaimkeepsshouldReceiveand its claim in refs through per-site Effects (packages/core/src/utils/touchRuntimeModules.tsxlines 96-100 and 123-126); useuseCommittedRef(shouldReceive)(or drop that ref, since the callback is stable) and passclaimRefso the part callsuseCommittedRefInto(claimRef, claim), asSegmentedMotionin the same file does.- The Toast record's FR4 and the Popover record's FR9 still say a swipe toward the edge dismisses and a finger-opened popover grows, with no word about the window before the touch runtime loads; add one sentence to each that names that window, as the base branch does for SegmentedControl FR9 and FR13 (for Toast, also under its swipe-only custom-content gap).
- Miss: on a page whose only touch component is a toast, nothing schedules the runtime until the first toast mounts (
packages/core/src/Toast/useToastGesture.tsline 141), so the load starts with that toast instead of after first paint and that toast cannot be swiped; schedule the load from the page-level host, for example oneuseTouchRuntime()call inToastViewport.
Also worth a look: the stack's changeset names only SegmentedControl, Switch and BottomSheet, and the header of Popover/PopoverTouch.ts still says Popover imports the touch modules statically.
Claims and files checked
- Claim: Toast and Popover no longer import the touch runtime statically. Verified: the boundary test's new Toast and Popover cases fail on the base and pass here.
- Claim: they take it from the base branch's shared loader. Verified:
useTouchRuntimeandgetTouchRuntimein both hooks. - Claim: a page with a toast or a popover no longer carries the runtime in its first load. Verified for both import graphs; page bytes not measured.
- Claim: on the measured app this is all of the remaining first-load touch code, about 32 KB gzip. Not verified here: the measurement comes from the base pull request.
- Claim: no behavior change after the load and no API change. Verified: the suites pass with the runtime loaded, and the API surface generator lists no change.
- Claim: before the load a toast tracks no swipe but still dismisses by its button, timer and keys. Verified:
useToastGesture.tsline 182 and the new test. - Claim: before the load a finger-opened popover presents as under a fine pointer. Verified: the new test.
- Claim: a swipe or press in flight when the load lands finishes that way. Verified by reading: the claim part attaches only when it mounts, and Popover decides at open.
- Claim: the claim part renders nothing and follows the card, so the card is attached first. Verified:
Toast.tsxfragment order. - Claim: the hook starts no swipe until the claim exists; Popover takes the factory at open. Verified.
- Claim: the governing records are the runtime architecture record's touch-module invariant and the stylesheet spec's decision as the base branch amends them, and the gap line drops Toast and Popover. Verified.
- Claim: the three new tests fail on the base pull request's head. Verified: all fail there and pass here.
- Claim: the touch-driving suites load the runtime before their cases. Verified.
- Claim: 303 tests pass. At this head 304 pass; the merged base adds one.
- Claim: core typecheck and the knowledge check pass; the record stays in the present tense. Verified.
- Claim: no internal context in public text. Verified.
docs/architecture/react-component-runtime.md: clear.packages/core/src/Popover/Popover.test.tsx: clear.packages/core/src/Popover/usePopoverSurfaceMotion.test.tsx: clear.packages/core/src/Popover/usePopoverSurfaceMotion.ts: non-blocking comment suggestion.packages/core/src/Toast/Toast.tsx: clear.packages/core/src/Toast/ToastViewport.test.tsx: clear.packages/core/src/Toast/useToastGesture.ts: the claim hand-over and the load scheduling findings.packages/core/src/utils/touchRuntime.boundary.test.ts: clear.packages/core/src/utils/touchRuntimeModules.tsx: the per-site ref Effects finding.
| }, [claim, direction]); | ||
| // draws the swipe. The pan comes with the shared touch runtime, which | ||
| // loads after first paint; until then no swipe starts. | ||
| const touchRuntime = useTouchRuntime(); |
There was a problem hiding this comment.
Miss: this per-toast call is the only thing that schedules the touch runtime on a page whose only touch component is a toast, and ToastViewport renders no ToastSurface until a toast is raised. So the load starts with the first toast (often a click's answer) instead of after first paint, and that toast cannot be swiped until the load lands. One useTouchRuntime() call in ToastViewport would schedule it with the page, as INV13 describes.
|
/approve-spec 4f68088 |
There was a problem hiding this comment.
Changes requested: this head adds the pre-load window to the runtime, Toast and Popover records with an engineering owner's approval, but the code is unchanged since the last review, so its two code fixes are still needed, and the Toast record needs one more sentence.
ToastSwipeClaimkeepsshouldReceiveand its claim in refs through per-site Effects (packages/core/src/utils/touchRuntimeModules.tsx:96-100and:123-126), which the runtime record forbids; useuseCommittedRef(shouldReceive)and passclaimRefso the part callsuseCommittedRefInto(claimRef, claim).- Miss: on a page whose only touch component is a toast, nothing schedules the runtime load until the first toast mounts (
packages/core/src/Toast/useToastGesture.ts:141), so in Chromium the chunk is requested 11 ms after the tap that raises the toast instead of after first paint; oneuseTouchRuntime()call inToastViewportwould schedule it with the page. - The Toast record's gap entry for custom content without a control (
docs/specs/components/Toast/Toast.spec.md:102-105) still says such a toast can be dismissed by a swipe, but before the load it has no swipe, and an error one has no timer either, so the person cannot dismiss it; name the pre-load window there and add "in the default layout" to FR4's new sentence.
Two optional cleanups: PopoverTouch.ts's header still says Popover imports the touch modules statically, and the stack's changeset does not mention Toast or Popover.
Claims and files checked
- Claim: Toast and Popover stop importing the touch runtime statically and take it from the shared loader. Verified: the boundary test's two new entries fail on the base and pass here.
- Claim: a page with a toast viewport or a popover no longer carries the runtime in its first load. Verified for the static graph; the page-level saving is not re-measured here.
- Claim: no behavior change after the load and no API change. Verified: Chromium frames after the load are identical on base and head, and the API generator finds no change.
- Claim: before the load (first paint, then idle, at most 2 s) a toast tracks no swipe. Partly false: the swipe is refused (new test), but on a toast-only page the window starts at the first toast, not at first paint.
- Claim: the toast still dismisses by its button, timer and keys. Verified for the default layout; not for custom content without a control.
- Claim: a popover under a finger presents as under a fine pointer before the load. Verified: new test and
usePopoverSurfaceMotion.ts:117-120. - Claim: a swipe or press in flight when the load lands finishes that way. Verified:
beginGesturerefuses without the claim (useToastGesture.ts:182), and Popover decides at open. - Claim:
ToastSwipeClaimrenders nothing and mounts after the load as a sibling that follows the card; the hook starts no swipe until it exists. Verified:Toast.tsx:458,touchRuntimeModules.tsx:89-128,useToastGesture.ts:182. - Claim: INV13's gap line drops Toast and Popover. Verified.
- Claim: the three new tests fail first on the base. Verified.
- Claim: the touch-driving suites load the runtime in
beforeAll; the suites pass; core typecheck and the knowledge check pass. Verified (306 pass at this head). - File
docs/architecture/react-component-runtime.md: clear. - File
docs/specs/components/Popover/Popover.spec.md: clear. - File
docs/specs/components/Toast/Toast.spec.md: finding (custom-content gap). - File
packages/core/src/Popover/Popover.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.ts: clear (one optional comment suggestion). - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/Toast/useToastGesture.ts: finding (load scheduled per toast). - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: finding (per-site ref Effects).
| | FR1 | A card carries `toast` with `type` and shows `body` and, on its first line, `endContent` then a dismiss Button named by `@astryx.toast.dismiss`; long body text wraps below. `renderContent` replaces that layout, receives `body`, `endContent`, `type`, timing, and a `dismiss` function, and gets no injected dismiss control. | Current source and tests | | ||
| | FR2 | With auto-hide on (the default for `info`, off for `error`), the card dismisses with reason `auto` after `autoHideDuration` ms. The timer pauses while the pointer is over the card, focus is inside it, a touch or pen gesture is active, or the window is blurred, and resumes with the remaining time (at least 1 s). Each pause condition holds the timer on its own: one ending resumes it only when no other still holds, and focus moving between the card's own controls keeps it held. A toast raised while the window is already blurred starts with its timer held. | Current source and tests | | ||
| | FR3 | The dismiss button, a swipe, a `dismiss` call, or the returned dismiss function dismiss with reason `manual`; `onHide` fires at most once, when the toast is dismissed, even when dismissed twice during its exit or before it shows. A toast replaced through `uniqueID` is not dismissed and reports no `onHide`. | Current source and tests | | ||
| | FR4 | A drag toward the position's block edge, from any pointer (`spec:AST-094` FR43), decides once, at release, per `spec:AST-094` FR36–FR37: projected travel past the commit point dismisses, and a release moving back toward the start cancels. A short drag snaps back; horizontal intent, a second touch, or a gesture starting on an interactive descendant does not dismiss. Native page scrolling continues until touch intent matches the dismiss edge. On a touch screen, the touch's first move decides: toward the dismiss edge, the swipe owns the touch. In the default layout the visible dismiss button stays as a non-gesture alternative; custom content supplies its own. Implementation gaps: the shipped rule dismisses on net travel past a distance threshold or a fast flick timed by its own average speed, even after the finger moves back, and recognizes only touch and pen drags, not a mouse (Current-state impact). Until the shared touch runtime has loaded (`architecture:react-component-runtime` INV13), a toast does not swipe; its close button and timer still dismiss it. | Current source and tests | |
There was a problem hiding this comment.
Before the load, a renderContent toast with no control has no close button, and an error one has no timer, so it cannot be dismissed at all. The gap entry "Custom content without a control has only the swipe" (line 102) still says it has the swipe. Suggested: add "in the default layout" to this sentence, and one sentence in that gap entry naming the pre-load window.
|
/approve-spec b994b59 |
There was a problem hiding this comment.
Changes requested: moving Toast's swipe claim and Popover's touch motion onto the shared touch runtime works as described, and the owner-approved records cover the direction, but three fixes from the last review are still open at this head.
ToastSwipeClaimkeepsshouldReceiveand its claim in refs through per-site Effects (packages/core/src/utils/touchRuntimeModules.tsx:96-100and:123-126), which the runtime record forbids; useuseCommittedRef(shouldReceive)and passclaimRefso the part callsuseCommittedRefInto(claimRef, claim).- Miss: on a page whose only touch component is a toast, nothing schedules the runtime load until the first toast mounts (
packages/core/src/Toast/useToastGesture.ts:141), so in Chromium the chunk is requested 39 ms after the tap that raises the toast instead of after first paint; oneuseTouchRuntime()call inToastViewportwould schedule it with the page. - The Toast record's gap entry for custom content without a control (
docs/specs/components/Toast/Toast.spec.md:102-105) still says such a toast can be dismissed by a swipe, but before the load it has no swipe, and an error one has no timer either, so the person cannot dismiss it; name the pre-load window there and add "in the default layout" to FR4's new sentence.
Two optional cleanups: PopoverTouch.ts's header still says Popover imports the touch modules statically, and the stack's changeset does not mention Toast or Popover.
Claims and files checked
- Claim: Toast and Popover stop importing the touch runtime statically and take it from the shared loader. Verified: the boundary test's two new entries fail on the base and pass here.
- Claim: a page with a toast viewport or a popover no longer carries the runtime in its first load. Verified for the static graph; the page-level saving is not re-measured here.
- Claim: no behavior change after the load and no API change. Verified: Chromium frames after the load are identical on base and head, and the API surface comparison finds no change.
- Claim: before the load (first paint, then idle, at most 2 s) a toast tracks no swipe. Partly false: the swipe is refused (new test, and a held-back Chromium swipe), but on a toast-only page the window starts at the first toast, not at first paint.
- Claim: the toast still dismisses by its button, timer and keys. Verified for the default layout; not for custom content without a control.
- Claim: a popover under a finger presents as under a fine pointer before the load. Verified: new test,
usePopoverSurfaceMotion.ts:117-120, and a held-back Chromium tap (full size at 60 ms). - Claim: a swipe or press in flight when the load lands finishes that way. Verified:
beginGesturerefuses without the claim (useToastGesture.ts:182), and Popover decides at open (:117-120,closeStart). - Claim:
ToastSwipeClaimrenders nothing and mounts after the load as a sibling that follows the card; the hook starts no swipe until it exists. Verified:Toast.tsx:458,touchRuntimeModules.tsx:89-128,useToastGesture.ts:182. - Claim: INV13's gap line drops Toast and Popover. Verified.
- Claim: the three new tests fail first on the base. Verified (with the boundary file's two entries, four cases fail on the base).
- Claim: the touch-driving suites load the runtime in
beforeAll; the suites pass; core typecheck and the knowledge check pass. Verified (306 pass). - File
docs/architecture/react-component-runtime.md: clear. - File
docs/specs/components/Popover/Popover.spec.md: clear. - File
docs/specs/components/Toast/Toast.spec.md: finding (custom-content gap). - File
packages/core/src/Popover/Popover.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.ts: clear (one optional comment suggestion). - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/Toast/useToastGesture.ts: finding (load scheduled per toast). - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: finding (per-site ref Effects).
# Conflicts: # docs/architecture/react-component-runtime.md # docs/specs/components/Popover/Popover.spec.md # packages/core/src/Toast/Toast.tsx
|
/approve-spec a3f3413 |
There was a problem hiding this comment.
Changes requested. The record text this change rests on is now approved by an engineering owner for this head, so what remains are five fixes in the code, the Toast record and the description.
utils/touchRuntimeModules.tsx:96-100and:123-126copyshouldReceiveand the swipe claim into refs with per-site Effects, which INV3 rules out; useuseCommittedRefanduseCommittedRefInto, asSegmentedMotionin the same file already does.- Miss: on a page whose only touch component is a toast, nothing schedules the touch runtime until the first toast mounts (
Toast/useToastGesture.ts:141), so the load starts with that toast instead of after first paint, against INV13's "nothing loads them on demand" and the description's "first paint, then idle, at most 2 s"; schedule it once fromToastViewport, or narrow those claims. - Toast FR4's new sentence and the "Custom content without a control has only the swipe" gap entry imply a control-free
renderContenttoast can still be dismissed before the load, but it has no button and, as an error, no timer; scope the sentence to the default layout and name the pre-load window in that gap entry. - Miss: the description says only INV13's gap line changes in the records, but INV13's pre-load sentence, Toast FR4 and Popover FR9 change too; list them with their rubric results.
- Newly live check:
Toast/useToastGesture.tsgrows to 510 lines while timing its flick with its own average speed, so INV19 asks it to take the release decision fromVelocityTrackeror to record incomponent:Toastwhy no shared engine fits.
Smaller points: Popover FR9's row carries two stray cells and INV13 one unwrapped line from the base merge, Popover/PopoverTouch.ts's header and the stack's changeset still describe the old static import, and the description's test count is now 318.
Claims and files checked
- Claim: Toast and Popover no longer import the touch runtime statically and take it from the shared loader. Verified: the two new boundary cases fail on the base and pass here.
- Claim: no static path from either entry reaches the animator or the gesture host. Verified: the boundary test checks exactly those two modules.
- Claim: these two are all of the embed view's remaining first-load touch code, about 32 KB gzip. Consistent with the base pull request's measurements; not re-measured here.
- Claim: no behavior change after the load and no API change. Verified: the Toast, Popover and touch-runtime suites pass with the runtime loaded (318), and the built public surfaces of Core and the themes show no change.
- Claim: before the load a toast tracks no swipe and still dismisses by its button, timer and keys. Verified for the default layout; false for control-free custom content (third finding).
- Claim: before the load a popover under a finger presents as under a fine pointer. Verified by the new test, which fails on the base.
- Claim: the window before the load is first paint, then idle, at most 2 s. False on a page whose only touch component is a toast (second finding).
- Claim: a swipe or press already in flight at the load finishes the old way. Verified in code: no swipe starts while the claim is missing, and a popover decides at open.
- Claim: the swipe claim renders nothing, mounts after the load as the card's next sibling, and no swipe starts until it exists. Verified in
Toast.tsxanduseToastGesture.ts. - Claim: Popover takes the motion factory from the runtime at open. Verified in
usePopoverSurfaceMotion.ts. - Claim: INV13's gap line drops Toast and Popover. Verified.
- Claim: only INV13's gap line changes in the records. False (fourth finding).
- Claim: the three named tests fail on the base pull request's head. Verified: four cases fail there, 193 pass.
- Claim: suites that drive touch motion load the runtime first, and the suites pass. Verified; the count is now 318, not 303.
- Claim: core typecheck and the knowledge check pass. Verified.
- Claim: public text has no internal context. Verified.
- File
docs/architecture/react-component-runtime.md: clear apart from one unwrapped line. - File
docs/specs/components/Popover/Popover.spec.md: two stray cells in FR9's row. - File
docs/specs/components/Toast/Toast.spec.md: third finding. - File
packages/core/src/Popover/Popover.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.ts: clear; one comment suggestion. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/Toast/useToastGesture.ts: second and fifth findings. - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: first finding.
# Conflicts: # docs/specs/components/Toast/Toast.spec.md
# Conflicts: # docs/architecture/react-component-runtime.md
|
/approve-spec af42d11 |
There was a problem hiding this comment.
Changes requested. An engineering owner has now approved the proposed INV13, Toast FR4 and Popover FR9 text for this head, so the spec question is settled; the five fixes below still apply to this pull request's code, records and description.
utils/touchRuntimeModules.tsx:96-100and:123-126copyshouldReceiveand the swipe claim into refs with per-site Effects, which INV3 rules out; useuseCommittedRefanduseCommittedRefInto, asSegmentedMotionin the same file already does.- Miss: on a page whose only touch component is a toast, nothing schedules the touch runtime until the first toast mounts (
Toast/useToastGesture.ts:141), so the load starts with that toast instead of after first paint, against INV13's "nothing loads them on demand" and the description's "first paint, then idle, at most 2 s"; schedule it once fromToastViewport, or narrow those claims. - Toast FR4's new sentence and the "Custom content without a control has only the swipe" gap entry imply a control-free
renderContenttoast can still be dismissed before the load, but it has no button and, as an error, no timer, as FR1 and FR2 still say; scope the sentence to the default layout and name the pre-load window in that gap entry. - Miss: the description says only INV13's gap line changes in the records, but INV13's pre-load sentence, Toast FR4 and Popover FR9 change too; list them with their rubric results.
- Newly live check:
Toast/useToastGesture.tsgrows to 510 lines while timing its flick with its own average speed, so INV19 asks it to take the release decision fromVelocityTrackeror to record incomponent:Toastwhy no shared engine fits.
Smaller points: Popover FR9's row carries two stray cells and INV13 two unwrapped lines, Popover/PopoverTouch.ts's header and the stack's changeset still describe the old static import, and the description's test count is now 324.
Claims and files checked
Review mode: same-head; reason: none
- Claim: Toast and Popover no longer import the touch runtime statically and take it from the shared loader. Verified: the two new boundary cases fail on the base and pass here.
- Claim: no static path from either entry reaches the animator or the gesture host. Verified: the boundary test walks the static imports to exactly those two modules.
- Claim: these two are all of the embed view's remaining first-load touch code, about 32 KB gzip. Consistent with the base pull request's measurements; not re-measured here.
- Claim: no behavior change after the load and no API change. Verified: the Toast, Popover and touch-runtime suites pass with the runtime loaded (324), a swipe after the load dismisses on both sides in Chromium with identical frames, and the built public surfaces of Core and the themes show no change.
- Claim: before the load a toast tracks no swipe and still dismisses by its button, timer and keys. Verified for the default layout; false for control-free custom content (third finding).
- Claim: before the load a popover under a finger presents as under a fine pointer. Verified by the new test, which fails on the base.
- Claim: the window before the load is first paint, then idle, at most 2 s. False on a page whose only touch component is a toast (second finding).
- Claim: a swipe or press already in flight at the load finishes the old way. Verified in code: no swipe starts while the claim is missing, and a popover decides at open.
- Claim: the swipe claim renders nothing, mounts after the load as the card's next sibling, and no swipe starts until it exists. Verified in
Toast.tsxanduseToastGesture.ts. - Claim: Popover takes the motion factory from the runtime at open. Verified in
usePopoverSurfaceMotion.ts. - Claim: INV13's gap line drops Toast and Popover. Verified; AlertDialog stays, correctly, since it still imports the animator.
- Claim: only INV13's gap line changes in the records. False (fourth finding).
- Claim: the three named tests fail on the base pull request's head. Verified: four cases fail there, 193 pass.
- Claim: suites that drive touch motion load the runtime first, and the suites pass. Verified; the count is now 324, not 303.
- Claim: core typecheck and the knowledge check pass. Verified.
- Claim: one primary intent, with no separable extras. Verified: no tag-along.
- Claim: public text has no internal context. Verified.
- Changesets: the pull request adds none.
- File
docs/architecture/react-component-runtime.md: clear apart from two unwrapped lines. - File
docs/specs/components/Popover/Popover.spec.md: two stray cells in FR9's row. - File
docs/specs/components/Toast/Toast.spec.md: third finding. - File
packages/core/src/Popover/Popover.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.test.tsx: clear. - File
packages/core/src/Popover/usePopoverSurfaceMotion.ts: clear; one comment suggestion. - File
packages/core/src/Toast/Toast.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
packages/core/src/Toast/useToastGesture.ts: second and fifth findings. - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: first finding.
Primary intent
Performance, stacked on #11450: Toast and Popover stop importing the touch runtime (the gesture host and the animator) statically. They take it from the shared loader that #11450 adds, so a page that imports Toast or Popover no longer carries the runtime in its first load; the runtime loads after first paint. On the measured app this is all of the embed view's remaining first-load touch code. It is not a bug fix or a feature: no behavior changes after the load, and there's no API change.
User or maintainer impact
A swipe or a press already in flight when the load lands finishes that way; the next one takes the touch path.
Problem and solution fit
useToastGesturedrew the swipe from React's events, but claimed a finger's touch with the gesture host's one-way pan, which is a static import ofgestures/useGestureRecognizerandGestureHost. That pan is now the runtime partToastSwipeClaim. It renders nothing and mounts after the load, as a sibling that follows the card, so the card's node is attached when the claim attaches to it. The hook starts no swipe until the claim exists.usePopoverSurfaceMotioncreated its touch presentation withcreatePopoverSurfaceMotion, a static import of the animator. It now takes the factory from the runtime at open time, and treats an open before the load as a fine-pointer one.Authority
architecture:react-component-runtimeINV13 andspec:AST-080DEC-5, as amended in #11450. INV13's gap line drops Toast and Popover.Change and evidence
Toast/useToastGesture.ts,Toast/Toast.tsx,Popover/usePopoverSurfaceMotion.ts,utils/touchRuntimeModules.tsx(ToastSwipeClaim,createPopoverSurfaceMotion), plus the INV13 gap line.motion/animatororgestures/GestureHost.Static first-load graph (module counts only)
Structural evidence, not a size claim; the size numbers above and below come from real bundlers. The modules each page reaches through static imports, from this PR's head against #11450's head (its base):
Measured effect on a consumer app
Measured on a consumer app's production build (its own bundler, not an estimate), n=10 interleaved runs. The measured build is this PR's head, which includes #11450, so the effect belongs to the pair.
At 20 Mbit there is no slowdown, despite three more chunk levels. The measured build also dropped one unrelated entry from the app's own configuration.
Scope
Components: Toast, Popover, utils/touchRuntimeModules
Testing
Red first, each failing on #11450's head:
utils/touchRuntime.boundary.test.ts: the Toast and Popover entries reach no touch module statically.ToastViewport.test.tsx: "tracks no swipe before the touch runtime loads" (a pen swipe past the threshold neither moves nor dismisses the toast).usePopoverSurfaceMotion.test.tsx: "before the touch runtime loads, presents a coarse open as a fine-pointer one".Also:
beforeAll.packages/core/src/Toast,packages/core/src/Popoverandutils/touchRuntime*: 303 passed.check:knowledgepass.Writing rubric results
Owner and land path
Owner: the Astryx fix loop, lane 3. Lands after #8690 merges, in stack order (#11450, #11463, #11466, #11476, #11478, #11508, #11518, #11525, #11530, #11536, #11540, #11544), each after Specs, CodeBunny at its head and green CI; the drain merges.