Skip to content

test(interaction-harness): an armed hold names the motion it judges - #10386

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

cixzhang merged 5 commits into
mainfrom
test/armhold-judged-motion

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

A storyboard or curve test can pass without holding the motion it judges. armHold waits for a count of running animations under its scope. Other animations under the scope (a press fade, a colour change) can meet that count before the judged motion starts. The hold then takes only them, and the film or the sampled curve shows a motion that is not the one the test names. The test stays green when the judged motion is wrong or missing.

Switch's tap storyboard was one case (fixed for that test in #10316). Every armHold call site can fail the same way.

Intended invariant

architecture:component-test-sufficiency INV6: a test counted as sufficient must fail when its promised behavior is removed or broken. A hold that took only other animations cannot fail on the judged motion.

No record governed internal/interaction-harness before this change, and none stated this rule. This pull request adds it to architecture:component-test-sufficiency:

  • applies_to gains internal/interaction-harness/.
  • INV6 gains: "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."
  • INV6's verification row gains the state "a held set missing the named motion" and the failure "a motion judgement passes on unrelated animations".

Change

  • armHold(page, scope, {judges, …}): judges is required. It names the judged motion as {target: Locator, property, pseudoElement?}, or a list of them.
  • held() rejects when the hold took no animation of a judged motion on that exact target. The error names the judged motion, the count, and every animation the hold took, so the author can see what met the count instead.
  • count, newOnly, minProgressMs and timeout keep their meaning: they still decide when the hold takes. judges only checks what it took.
  • judges: 'count-only' checks nothing. It marks a call site whose hold does not take its judged motion yet.
  • A call without judges rejects with a message that says what to pass (a type error first; the runtime check is for untyped callers).
  • Every existing call site names its judged motion: the harness's own tests, and the component tests listed below.

Audit

Each component call site names the motion it judges (what the test samples or films). In this pull request's CI, with the guard on, every one of them holds its judged motion: none was vacuous on main, so no call site needs 'count-only'.

Call site Judged motion
CheckboxList row press: the box fades with the row the pressed row's ::before opacity
List row press: release follows the exit easing the row's ::before opacity
Lightbox fine pointer: the zoom settles on the spring the photo's scale
Popover touch motion: input while it grows the layer's scale; under Reduce Motion, its opacity cross-fade
Popover touch motion: the dismissal's exit copy the copy's scale; under Reduce Motion, its opacity
ProgressBar storyboard: the fill moves the fill's transform
usePager: a lift's or goTo's motion the track's translate; under Reduce Motion, its opacity cross-fade
PageControl: the window cross-fades the strip's opacity
PageControl storyboard: the window slides one slot the strip's translate and page 26's scale

The guard caught one wrong description while this was written: usePager's Reduce Motion test first named translate, and held() rejected, because that test's motion is the cross-fade. playHeld and goToHeld now take the judged property, and playHeld re-arms only a hold that ran out of time, not one that took the wrong motion. Popover's openHeldWhileGrowing and armExitCopyHold take the judged property the same way.

Writing rubric results

Over docs/architecture/component-test-sufficiency.md, the edited lines:

  • R1 narration: none; the INV6 sentence states what a motion judgement does, in the present tense.
  • R2 research: none.
  • R3 evidence: the new verification cells name a state and a failure, not a pull request.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

Evidence

  • Failure before the change: the new self-test "an armed hold rejects when other animations meet its count before the judged motion starts" starts a press fade on a box and, 150 ms later, the travel on its thumb. A count of 1 is met by the press. The hold takes only the press, and the travel then runs free. held() on main returns the press, so a storyboard of this hold films the press. The 'count-only' self-test runs the same scene on main's path and shows that result.
  • Success after the change: the same scene now rejects, naming translate on #thumb and the press it took. With count: 2, the hold waits for the travel, takes both, and resolves.
  • 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

  • Interaction proofs, Chromium (6 legs) and WebKit (5 legs), in this pull request's CI: the four new self-tests pass in both browsers, and every call site above passes with its judged motion.
  • Accessibility browser specs (ci:run-a11y): the CheckboxList, Lightbox and ProgressBar call sites pass with their judged motions.
  • tsc --noEmit for the harness passes. Core and Lab report no errors in the changed files.

@vercel

vercel Bot commented Nov 6, 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 1:29am UTC

Request Review

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

astracat-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 685b290

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
ProgressBar · Storybook 11.5 kB (0) · 6.2 kB CSS (0) 568 (0) — · ✗ · —
CheckboxList 54.6 kB (0) · 8.0 kB CSS (0) — — · ✓ · —
CheckboxListItem 66.3 kB (0) · 11.1 kB CSS (0) — — · — · —
5 more components
Component Size LoC Visual · A11y · RTL
Lightbox · Storybook 103.5 kB (0) · 10.1 kB CSS (0) 2,472 (+3) — · ✓ · —
List 5.4 kB (0) · 469 B CSS (0) — — · ✓ · —
ListItem 65.3 kB (0) · 11.1 kB CSS (0) — — · — · —
Popover · Storybook 80.1 kB (0) · 13.7 kB CSS (0) 1,488 (0) — · ✓ · —
lab/PageControl · Storybook 71.7 kB (0) · 709 B CSS (0) 999 (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 24 rows; run pnpm api:report.

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

Accessibility: 2 violation(s)

Accessibility Audit

Status: 2 accessibility violation(s) found — 2 serious.

ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Progressbar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/1 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | View full report

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 6, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 6, 2026 21:50

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

Approval waits on an engineering owner's decision on the architecture:component-test-sufficiency edit, and one test needs a fix.

Spec decision: the new INV6 sentence ("A motion judgement holds and asserts the judged motion itself…"), its two verification-row cells and internal/interaction-harness/ in applies_to are new normative text that the current record does not state. An engineering owner records the decision by commenting /approve-spec 46557d6292d9617be6a710a89ffdb4b6fc344471 on this pull request; the author may do so as an engineering owner. The harness and test changes already rest on the existing INV6.

Blocking:

  • The usePager Reduce Motion proof (usePager.interaction.browser.spec.ts:901) now fails in Chromium and WebKit, because playHeld and goToHeld judge {target: track, property: 'translate'} (:365, :394-396) while that motion is an opacity cross-fade; let both helpers take the judged motion, pass property: 'opacity' from that test, and let playHeld rethrow the hold's own error instead of replacing it with "no motion under the track started within 5 s".

The audit table's usePager row should also name the opacity cross-fade for the Reduce Motion case.

[Automated review]

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 6, 2026
@cixzhang
cixzhang marked this pull request as draft November 7, 2026 00:22
@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 00:25
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 8268ba4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 7, 2026

@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 fix against main before this lands. The INV6 record edit is approved for this head.

  • Regression: merged into main, Popover's armExitCopyHold (added on main in PopoverTouchMotion.interaction.browser.spec.ts) still calls armHold without judges, and openHeldWhileGrowing judges scale for main's Reduce Motion caller where the layer only cross-fades, so core's type check and the exit-tokens dismissal, Reduce Motion and tap-to-present storyboard proofs fail; merge main, pass judges: {target: exitCopyOf(page), property} in armExitCopyHold, and let openHeldWhileGrowing take the property as usePager's helpers now do.

CI stays green on this head because its typecheck and interaction jobs test the head commit, not the merge with main. The earlier usePager Reduce Motion failure is fixed. Optional: playHeld's second hold still replaces a wrong-motion rejection with the 5 s timeout message (usePager.interaction.browser.spec.ts:390-394).

[Automated review]

@cixzhang
cixzhang marked this pull request as draft November 7, 2026 01:20
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 685b290

@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 01:23

@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 finished on this head yet.

The earlier blocker is fixed: Popover's armExitCopyHold and openHeldWhileGrowing now name the judged motion and take opacity for the Reduce Motion proof, so the merge with main no longer breaks the type check or the Popover proofs. The re-armed usePager hold also keeps the judged-motion error now. The INV6 record edit carries an engineering owner's approval for this head.

[Automated review]

@cixzhang
cixzhang merged commit 28270c1 into main Nov 7, 2026
122 checks passed
@github-actions
github-actions Bot deleted the test/armhold-judged-motion branch November 7, 2026 06:03
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 7, 2026
Under a primary finger the calendar is now MonthPager, which a scroll
event does not move, so meta#10231's swipe hand-off test never reached the
range end. It runs as the other native-scroller tests here do: on a
touchscreen laptop with the sheet pinned. MonthPager reports its
settled month to the same callback.

meta#10386 has an armed hold name the motion it judges. The pager's four
holds judge the track's translate, which a step and a settle move.
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 7, 2026
meta#10231 moves focus off a month arrow that hides at the range end. Two
tests check that the hand-off still runs through what the toggle keeps:

- the arrows, which the toggle does not re-render: a press after the
  toggle still moves focus to the other arrow;
- the month grid's callback, which the toggle leaves unchanged, so the
  memoized pager does not re-render: a month the pager settles on
  after the toggle still moves focus the same way.

Each test fails if the toggle re-renders what it keeps, or if the
hand-off is lost.

meta#10386 has an armed hold name the motion it judges. The toggle
storyboard's hold judges the wheels' opacity, which the fade moves.

This branch was successfully deployed

1 active deployment
Preview — 685b290d 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