Skip to content

test(interaction-harness): a hold sent from the test names the motion it judges - #10438

Merged
cixzhang merged 5 commits into
mainfrom
test/hold-now-judged-motion
Nov 7, 2026
Merged

cixzhang merged 5 commits into
mainfrom
test/hold-now-judged-motion

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

A hold sent from the test (holdAnimations, and animationStoryboard without held) takes whatever runs when it reaches the page. The judged motion can still be to come, or already over on a busy runner, while other animations under the scope run. The test then samples or films a motion that is not the one it names, and stays green when the judged motion is wrong or missing. #10386 closed this for armed holds (armHold); this closes it for holds sent from the test.

Intended invariant

architecture:component-test-sufficiency INV6: "A motion judgement holds and asserts the judged motion itself, named by its target element and animated property; a held count alone does not prove it, since other animations can fill the count." The record already applies to internal/interaction-harness/.

Change

  • holdAnimations(page, scope, {judges}): judges is required, as for armHold ({target, property, pseudoElement?}, a list, or 'count-only'). The call rejects when the hold took no animation of each judged motion on that exact target; the error names the judged motion and every animation the hold took, and says to arm the hold before the action (armHold).
  • animationStoryboard: takes either held (from armHold, which already checked its judged motion) or judges (the film holds now, through holdAnimations). Passing neither is a type error, and rejects at run time.
  • armHold and holdAnimations share one check. 'count-only' checks nothing, as before.
  • Every existing call site names the motion it judges: the harness's own tests and the component tests below.

Audit

Each hold sent from the test and the motion it judges. In this pull request's CI (Chromium and WebKit interaction proofs, accessibility browser specs), every one of them holds its judged motion: none was vacuous on main, so no call site needs 'count-only'.

Call site Judged motion
BottomSheet detent: the settle (curve, storyboard) the sheet's transform
BottomSheet keyboard inset: the content's ride (2) the content's translate
BottomSheet native modal: a handoff phase each mover's transform or opacity
Button press release: Reduce Motion, curve, storyboard the surface's ::before opacity
Button press release: fine pointer the surface's --astryx-press-alpha (found through its @keyframes rule: Chromium's getKeyframes() leaves out a custom property, and StyleX nests the rule in a @layer)
DateInput wheel: the coast storyboard (held in the lift's frozen task) the strip's translate
Dialog touch entrance the dialog's opacity
Drawer touch entrance the drawer's transform
Lightbox zoom: settle and double tap (curves, storyboards) the photo's scale
Lightbox zoom modes: Reduce Motion fades (2) the photo's opacity
List row press: storyboard; row press paths (2) the row's ::before opacity
Popover touch motion: the presentation the layer's scale
SegmentedControl: the retarget storyboard (held in a frozen task) the group's ::before translate
Slider touch: the coast the thumb's translate
Spinner storyboard the rotor's transform
Switch: the press release (2) the track's and the thumb's ::before opacity
NavigationStack: the push (curve, storyboard) the top and under cards' translate
NavigationStack: the return the top card's translate
NavigationStack scroll edge storyboard the veil's opacity

Sites that hold from the test after the action are exposed to the late-hold race even when they pass here. Converting them to armHold (armed before the action) removes it; that belongs to the component lanes:

  • No wait for the motion before the hold: List row press paths (2 sites), List row press storyboard, Button press-release storyboard, Lightbox zoom modes (pinch release), BottomSheet settle storyboard.
  • A wait on the target, then a hold from the test: Lightbox zoom (2 sites, 2 storyboards), Lightbox zoom modes (double tap), Popover present, NavigationStack push (hold and storyboard), NavigationStack scroll-edge storyboard, BottomSheet native modal handoff.

Writing rubric results

No knowledge record changes in this pull request.

Evidence

  • Failure before the change: the new self-test "a hold sent from the test rejects when the judged motion does not run yet" starts a press fade on a box and, 150 ms later, the travel on its thumb, then holds at once. On main, holdAnimations returns the press, and a film of that hold shows the press.
  • Success after the change: the same scene rejects, naming translate on #thumb and the press it took. "a film that holds now refuses to start without the motion it shows" pins the missing-judges case.
  • Product/runtime behavior verified unchanged: No behavior change. Only test files and the private test harness change.
  • CI impact: none; no workflow or CI script changes.

Scope

  • 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

  • tsc --noEmit passes for the harness; Core reports no errors in the changed files.
  • Interaction proofs, Chromium (6 legs) and WebKit (5 legs), and the accessibility browser specs (3 legs) pass in this pull request's CI, the new self-tests included.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 7, 2026
@astracat-bot

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 8:13 AM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 111c9e4

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
BottomSheet 64.0 kB (0) · 7.5 kB CSS (0) — — · ✓ · —
BottomSheetSwitcher 17.7 kB (0) · 3.4 kB CSS (0) — — · — · —
Button · Storybook 58.0 kB (0) · 9.9 kB CSS (0) 688 (0) — · ✓ · —
16 more components
Component Size LoC Visual · A11y · RTL
DateInput · Storybook 179.6 kB (0) · 16.7 kB CSS (0) 5,586 (0) — · ✓ · —
Dialog 23.2 kB (0) · 6.7 kB CSS (0) — — · ✓ · —
DialogHeader 60.8 kB (0) · 11.4 kB CSS (0) — — · — · —
Drawer 48.4 kB (0) · 8.2 kB CSS (0) — — · ✓ · —
DrawerHeader 61.0 kB (0) · 12.8 kB CSS (0) — — · ✓ · —
Lightbox · Storybook 109.2 kB (0) · 10.3 kB CSS (0) 2,472 (0) — · ✓ · —
List 17.4 kB (0) · 651 B CSS (0) — — · ✓ · —
ListItem 67.6 kB (0) · 11.3 kB CSS (0) — — · — · —
Popover · Storybook 86.1 kB (0) · 13.9 kB CSS (0) 1,488 (0) — · ✓ · —
SegmentedControl 91.2 kB (0) · 6.8 kB CSS (0) — — · ✓ · —
SegmentedControlItem 16.5 kB (0) · 4.3 kB CSS (0) — — · — · —
Slider · Storybook 104.1 kB (0) · 8.7 kB CSS (0) 2,450 (0) — · ✓ · —
Spinner · Storybook 23.1 kB (0) · 6.1 kB CSS (0) 351 (0) — · ✓ · —
Switch · Storybook 98.7 kB (0) · 9.9 kB CSS (0) 1,725 (0) — · ✓ · —
lab/NavigationScreen 78.7 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/NavigationStack 78.7 kB (0) · 1.5 kB CSS (0) — — · ✓ · —

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 25 rows; run pnpm api:report.

Wide change (13 components): add ci:run-visual or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@vercel

vercel Bot commented Nov 7, 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 7, 2026 8:00am UTC

Request Review

@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 02:45

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one call site this pull request updates now fails every run.

  • ButtonPressRelease.interaction.browser.spec.ts:273 judges --astryx-press-alpha, but the harness reads animated properties from getKeyframes(), which in Chromium lists no property for a CSS animation of a registered custom property, so holdAnimations rejects although its hold took the strength release, and the fine-pointer release test fails every run (it passes on main).

A fix that keeps the judgement: let the judged-motion check read a CSSAnimation's properties from its @keyframes rule (named by animationName) when getKeyframes() lists none. The other updated call sites pass in Chromium with the motions they name, and the two new self-tests fail on main and pass here.

[Automated review]

@cixzhang
cixzhang marked this pull request as draft November 7, 2026 03:21

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the Button fine-pointer release test still fails every run in Chromium.

  • The new @keyframes lookup in expectJudgedMotionsHeld (internal/interaction-harness/src/curves.ts:1002-1020) reads only each sheet's top-level rules, but the built Storybook nests every Astryx @keyframes inside @layer astryx-base, so holdAnimations still cannot see --astryx-press-alpha and ButtonPressRelease.interaction.browser.spec.ts:273 fails on every run while it passes on main.

Walking grouping rules (anything with cssRules) when looking for the CSSKeyframesRule makes that test pass; please also wrap the @keyframes in the new custom-property self-test in an @layer, so it covers the case Storybook ships. The other updated call sites pass in Chromium with the motions they name.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 03:48

@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; it starts when the pull request is marked ready for review.

The nested @keyframes walk in expectJudgedMotionsHeld fixes the last blocker: the Button fine-pointer release test now finds --astryx-press-alpha inside @layer and passes, and the layered self-test fails against the previous top-level-only lookup. Every hold sent from the test now names the motion it judges, as INV6 of the component test sufficiency record requires.

  • Before it can merge, the branch needs a rebase: the DateInput wheel, Switch and NavigationStack interaction specs conflict with current main, which now arms a watch before the action on the same lines; keep main's watch and this pull request's judges.

[Automated review]

…motion

# Conflicts:
#	packages/core/src/DateInput/__tests__/Wheel.interaction.browser.spec.ts
#	packages/core/src/SegmentedControl/__tests__/SegmentedControl.interaction.browser.spec.ts
#	packages/core/src/Switch/__tests__/Switch.interaction.browser.spec.ts
#	packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts
@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 07:58

@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 is still running on this head; 45 checks have passed and none has failed so far.

The merge with main resolves the four conflicting specs cleanly: where main now arms the hold before the action (DateInput wheel coast, SegmentedControl slide, Switch travel), the head keeps main's armHold and films its held, and every hold still sent from the test names the motion it judges, as INV6 of the component test sufficiency record requires. The new self-tests fail against the previous harness and pass here, and the merge-resolved sites pass in Chromium.

[Automated review]

@cixzhang
cixzhang merged commit 9b7ebc4 into main Nov 7, 2026
124 checks passed

This branch was successfully deployed

1 active deployment
Preview — 111c9e41 Deployed Nov 7, 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-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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.

1 participant