Repository navigation
fix(cli): check skips a contrast sample measured over a layer that is mid-motion - #7205
Merged
miguel-heygen merged 3 commits intoNov 5, 2026
Merged
Conversation
Contributor
Edit accuracy: accurate 267 (base branch 267), smooth 110 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit · head aa007e39
I confirmed the fails without the fix: claim. With contrastMotion.ts reverted to its source on main, the two named tests fail (2 failed, 20 passed). At this head, all 22 pass.
- nit (
contrastMotion.ts:99):tweensUndercounts any overlapping tweened element, so a layer above the text counts too, not only one under it. That is arguably right, since an overlay moving across the text also changes the measured pixels. The name and the comment onmeasuredInMotionsay "under", though.
Scope
- Read
contrastMotion.tsend to end and the new tests. seekedWithParentcomparestime()withparent.time() - startTime(). A nested timeline withtimeScale≠ 1 or repeats will not match, so it falls back to the old "paused means stopped" result. That is conservative: the sample still gets checked.tweensUnderuses only closure locals, soreadContrastMotionstill works when serialized into the page.- The skip still applies only when the host opts in with
skipContrastInMotion. - CI: every Actions run at this head finished with success.
miguel-heygen
deleted the
fix/contrast-skips-sample-over-moving-backdrop
branch
November 5, 2026 04:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a host asks
checkto skip contrast samples taken mid-motion (thecheck-reviewcapability'sskipContrastInMotion, which Desktop's agent sets), the motion read now also counts two cases it missed:Why
check --jsoncould flag text at a sample where the light card behind it was still fading in (1.25:1 on dark text over a half-faded card), although every later sample passes. The skip already covered motion on the text and its ancestors, but not the layer the text is measured against, and it never saw motion inside a sub-composition.Related work
Follows the skip added in the contrast motion policy (
contrastMotion.ts); no open PR touches it.How
readContrastMotion: a nested timeline counts as running when it is registered (window.__timelines) and its clock is where its parent's puts it. An unregistered timeline that was paused stays stopped, as the existing test requires.sampleOf: tweens on an element whose box overlaps the text's box are added to the text's tweens, someasuredInMotionsees a moving backdrop. An element that is an ancestor or a descendant of the text is skipped, as before, and a layer beside the text does not count.Test plan
fails without the fix: packages/cli/src/utils/contrastMotion.test.ts › a layer under the text › counts as motion while it fades in under still text, and not once it has settled; and › a sub-composition's timeline › is moving when it is registered paused and seeked with the root, and stopped when its clock is elsewhere. With the source change reverted both fail (2 failed, 20 pass); with it all 22 pass, including the existing paused-nested-timeline and ambient-motion cases.
Ran for real (Linux,
check --jsonwith thecheck-reviewcapability on, a dark page with a light sub-composition card whose background fades in from 1 s over 1.5 s, text still): hyperframes 0.9.13 flagscontrast_aa_failure1.25:1 at 1.111 s; the CLI built from this branch reports no contrast finding, and the later samples still pass. Not run: a Desktop app session; without the capability set,checkstill checks every sample as before.Size
A lone small fix in one module with its tests; nothing open to fold it into.