Repository navigation
test(interaction-harness): an armed hold names the motion it judges - #10386
Conversation
|
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 |
|---|---|---|---|
| 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)
- Rule:
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)
- Rule:
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
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, becauseplayHeldandgoToHeldjudge{target: track, property: 'translate'}(:365,:394-396) while that motion is an opacity cross-fade; let both helpers take the judged motion, passproperty: 'opacity'from that test, and letplayHeldrethrow 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]
|
/approve-spec 8268ba4 |
There was a problem hiding this comment.
Changes requested: one fix against main before this lands. The INV6 record edit is approved for this head.
- Regression: merged into
main, Popover'sarmExitCopyHold(added onmaininPopoverTouchMotion.interaction.browser.spec.ts) still callsarmHoldwithoutjudges, andopenHeldWhileGrowingjudgesscaleformain'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; mergemain, passjudges: {target: exitCopyOf(page), property}inarmExitCopyHold, and letopenHeldWhileGrowingtake 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]
|
/approve-spec 685b290 |
There was a problem hiding this comment.
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]
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.
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.
Maintainer impact
A storyboard or curve test can pass without holding the motion it judges.
armHoldwaits 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
armHoldcall site can fail the same way.Intended invariant
architecture:component-test-sufficiencyINV6: 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-harnessbefore this change, and none stated this rule. This pull request adds it toarchitecture:component-test-sufficiency:applies_togainsinternal/interaction-harness/.Change
armHold(page, scope, {judges, …}):judgesis 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,minProgressMsandtimeoutkeep their meaning: they still decide when the hold takes.judgesonly checks what it took.judges: 'count-only'checks nothing. It marks a call site whose hold does not take its judged motion yet.judgesrejects with a message that says what to pass (a type error first; the runtime check is for untyped callers).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'.::beforeopacity::beforeopacityscalescale; under Reduce Motion, itsopacitycross-fadescale; under Reduce Motion, itsopacitytransformgoTo's motiontranslate; under Reduce Motion, itsopacitycross-fadeopacitytranslateand page 26'sscaleThe guard caught one wrong description while this was written: usePager's Reduce Motion test first named
translate, andheld()rejected, because that test's motion is the cross-fade.playHeldandgoToHeldnow take the judged property, andplayHeldre-arms only a hold that ran out of time, not one that took the wrong motion. Popover'sopenHeldWhileGrowingandarmExitCopyHoldtake the judged property the same way.Writing rubric results
Over
docs/architecture/component-test-sufficiency.md, the edited lines:Evidence
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.translate on #thumband the press it took. Withcount: 2, the hold waits for the travel, takes both, and resolves.Scope
Testing
ci:run-a11y): the CheckboxList, Lightbox and ProgressBar call sites pass with their judged motions.tsc --noEmitfor the harness passes. Core and Lab report no errors in the changed files.