Skip to content

test(interaction-harness): waitForRest waits out its layer's input hold - #13731

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:harness-rest-waits-for-input-hold
Nov 25, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:harness-rest-waits-for-input-hold

Conversation

@vjeux

@vjeux vjeux commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

An interaction spec can tap a control right after waitForRest and 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

waitForRest also waits until no input hold covers the element's layer.

  • A Core layer holds a finger's input under a shield while its motion runs. The hold ends when the animator settles that motion, and a press that goes down before then is held.
  • After a storyboard seeks or pauses a motion, the animator settles it at a later timer look. So the hold can end after the element rests. In an instrumented run that failed on main, it ended 6 ms after the tap went down (test).
  • The wait reads the shield that the hold lays over its layer. An element in a layer inside the held one, such as a toast that an alert raises, stays live, as a dismissal leaves it.
  • A hold still in place at the deadline rejects by name. A viewport-wide hold of another layer is not read.
  • When waitForAnimation finds 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 as onOpenChange.

No product code changes. Without a storyboard, the hold ends 53 to 67 ms before waitForRest returns (test).

Evidence

  • Failure before the change: the new spec "a tap on Cancel once a held entrance rests closes the alert" fails on 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.
  • Success after the change: the same spec passes 10 of 10 runs (test). The AlertDialog interaction and motion specs pass 10 of 10 runs together (test).
  • Product/runtime behavior verified unchanged: a local spec without a storyboard tapped Cancel 0 to 80 ms after rest. All 60 taps closed the alert, with one onOpenChange(false) each (test).
  • CI impact (for a change to workflows, actions or CI scripts): no workflow changes.

Scope

Components: interaction harness, AlertDialog

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

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 on main with 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.
  • The AlertDialog interaction and motion specs, run together 10 times in one worker: 31 of 31 pass each time (test).
  • Pending: the strict pnpm preflight --browser. Also pending: the full Chromium and WebKit interaction suites at this head and at main on one machine, with their durations.

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

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 24, 2026 4:55pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 24, 2026
@astracat-bot

astracat-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 24, 2026, 5:07 PM UTC

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 27120f8

Storybook · Sandbox · built from this PR's head

Modified components

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

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 27120f8

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 waitForRest can 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-2037 and harness.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.

Automated review (maintainer link)

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at 27120f8 (agent-made approval on behalf of the maintainer, per her 11/19 instruction for vjeux's read-access PRs, after CodeBunny ✓, the CI run fully green and Specs ✓ at this exact head). Test-harness only.

@cixzhang
cixzhang merged commit cc1e692 into meta:main Nov 25, 2026
219 of 222 checks passed
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 25, 2026
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.
cixzhang pushed a commit that referenced this pull request Nov 25, 2026
* 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.

This branch was successfully deployed

1 active deployment
Preview — 27120f85 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants