Repository navigation
test(interaction-harness): waitForRest waits out its layer's input hold - #13731
Conversation
A tap that a spec sends right after waitForRest can land under an input hold that outlasts the element's rest, and do nothing. After a storyboard seeks or pauses a motion, the animator settles it at a later look, and the hold ends only then. waitForRest now also waits until no hold of the element's own layer is in place. An element in a layer inside the held one stays live, as a dismissal leaves it, and a viewport-wide hold of another layer is not read. A hold still in place at the deadline rejects by name. waitForAnimation's "no animation started" error now says whether a dialog or a popover is still open. A new AlertDialog spec holds the entrance 1 ms before its curve ends, while the page's timers wait, then taps Cancel once the alert rests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| AlertDialog · Storybook | 136.4 kB (0) · 16.3 kB CSS (0) | 487 (0) | ✓ · ✓ · ✓ |
Package size: no published package changed; no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 27120f8 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review.
waitForRest now waits until no input-hold shield covers the element's own layer, and the new AlertDialog spec reproduces the swallowed tap it fixes. There are no blocking findings. Optional: the README could say that the wait also waits on a held layer inside the element (curves.ts:2275), and a harness case could cover ignoring another layer's viewport hold.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: a tap sent right after
waitForRestcan be swallowed by an entrance's input hold. Verified:packages/core/src/Layer/inputHold.ts:287-345. - Claim: after a storyboard pauses or seeks a run, the animator settles it at a later timer look. Verified:
packages/core/src/motion/animator.ts:3240-3269, every 100 ms while paused (:1034). - Claim: the wait reads the shield over the element's own layer, leaves out a nested layer, ignores another layer's viewport hold, and rejects by name at the deadline. Verified:
internal/interaction-harness/src/curves.ts:2250-2291. - Claim:
waitForAnimation's error says whether a dialog or popover is still open. Verified:curves.ts:2007-2037andharness.interaction.browser.spec.ts:2205-2207. - Claim: the new spec holds the entrance 1 ms before its curve ends while timers wait, then taps Cancel after rest. Verified:
AlertDialog.motion.interaction.browser.spec.ts:1313-1340. - Claim: the new spec fails on the base and passes here, and the AlertDialog and harness specs pass. Consistent with the code; the run counts are the author's and were not rerun.
- Claim: the measurements (the hold ending 6 ms after the tap, 53 to 67 ms before rest without a storyboard, 60 taps that each closed the alert). These are the author's and are consistent with the animator's timers.
- Claim: no product code or workflow changes, and the scope is the harness and AlertDialog's spec. Verified from the file list.
- Claim: public text carries no internal context. Verified.
- File
internal/interaction-harness/src/curves.ts: clear. - File
internal/interaction-harness/src/harness.interaction.browser.spec.ts: clear. - File
packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts: clear. - File
internal/interaction-harness/README.md: clear.
Main moved by 38 commits since 61362fc. The merge has no conflicts, and no file changed on both sides. It brings in meta#13731, which steadies the browser suite's AlertDialog motion test.
* test(core): components load no theme adaptation writer The token import test walks the whole-module first load of a page: a bundler that keeps a module's code keeps every module it imports. It now also checks that a Button, a Link, an IconButton, a Popover, an AppShell and the touch presentation resolver, and every export of their entries, reach none of the theme adaptation writer, the value resolver it runs and the local tokens. Tests: the eleven new cases fail on main. These components read only the breakpoint vocabulary and the compact definition, and they import them from themeAdaptations.ts. The next commit fixes it. * perf(core): the breakpoint vocabulary has its own module Button, Link, IconButton, Popover and AppShell read only the breakpoint names and the compact definition. They imported them from themeAdaptations.ts, so a bundler that keeps whole modules also kept the theme adaptation writer, the theme value resolver and the scale expanders. A bundler that never splits a module across chunks keeps the writer whole in the first load when a lazy theme chunk uses it. The breakpoint names and defaults, the size-edge helpers and the compact definition move to theme/breakpoints.ts, which imports nothing. themeAdaptations.ts re-exports them, so its exports do not change. touchPresentation.ts, Popover, AppShell and its unread width point import the new module. The edges test reads the helpers in their new file, and the header of touchPresentation.stylex.ts names it. The theme authoring contract names the new module as the owner of the breakpoint vocabulary. AST-012 links both files by path, in place of the comments that cited it. Tests: the eleven cases from the commit before now pass. * Merge main into perf/theme-breakpoints-module Main moved by 154 commits since 8b5d5e9. The merge has no conflicts. AppShell.tsx and Popover.tsx changed on both sides, in separate hunks. * fix(core): the changeset names the entry that keeps the writer Toast reads the breakpoint vocabulary through its Button, but its viewport also applies the caller's theme through Theme, which imports defineTheme and generateThemeRules, so the Toast entry still imports the theme adaptation writer. The changeset said every component that reads the vocabulary leaves the writer; it now names Toast and why. The CLI's copy of the default width points named themeAdaptations.ts as its SYNC source. This branch moved those points to breakpoints.ts, so the comment now names that file, and a CLI changeset records the change. Tests: no code changes. `pnpm check:changesets` passes, and a walk of every source entry of the package finds two at this head that reach the writer: Toast and the theme entry. * Merge main into perf/theme-breakpoints-module Main moved by 38 commits since 61362fc. The merge has no conflicts, and no file changed on both sides. It brings in #13731, which steadies the browser suite's AlertDialog motion test. * chore(lint): the provenance baseline follows the vocabulary move The vocabulary section that left themeAdaptations.ts for breakpoints.ts carried six citations, and breakpoints.ts cites none, so the no-comment-provenance baseline listed sites that no longer exist. The regenerated baseline lists FR5 and spec:AST-108 for themeAdaptations.ts and is otherwise unchanged. Tests: no code changes. The baseline script's --check passes.
Maintainer impact
An interaction spec can tap a control right after
waitForRestand see the tap do nothing. In one full Chromium run (test),AlertDialog.motion.interaction.browser.spec.ts› "under a finger › storyboard: present and dismiss" failed this way. Its dismiss wait threw "no animation started", and the alert stayed open.Intended invariant
After
waitForRest, no input hold of the element's own layer is in place, so a tap on the element reaches it.Change
waitForRestalso waits until no input hold covers the element's layer.main, it ended 6 ms after the tap went down (test).waitForAnimationfinds no animation on a dialog or a popover, its error now says whether the element is still open. The harness cannot see a component's own callbacks, such asonOpenChange.No product code changes. Without a storyboard, the hold ends 53 to 67 ms before
waitForRestreturns (test).Evidence
main. With only that spec added to d63c249, it fails 10 of 10 runs (test). It holds the entrance 1 ms before its curve ends while timers wait, so the hold ends 100 ms later.onOpenChange(false)each (test).Scope
Components: interaction harness, AlertDialog
Testing
pnpm test:interaction packages/core/src/AlertDialog/__tests__/AlertDialog.motion.interaction.browser.spec.ts --project chromium -g "once a held entrance rests" --repeat-each=10: 10 of 10 fail onmainwith only the new spec added (test). Here, 10 of 10 pass (test).pnpm test:interaction internal/interaction-harness/src/harness.interaction.browser.spec.ts --project chromium: 175 pass and 15 skip (test). The new harness spec checks three cases. A shield delays rest until it goes, a nested layer rests at once, and a shield still in place rejects by name.pnpm preflight --browser. Also pending: the full Chromium and WebKit interaction suites at this head and atmainon one machine, with their durations.