Skip to content

fix(core): a Reduce Motion landing waits for a held fade - #10378

Merged
cixzhang merged 3 commits into
meta:mainfrom
vjeux:uikit/f1-landing-held-fade
Nov 7, 2026
Merged

cixzhang merged 3 commits into
meta:mainfrom
vjeux:uikit/f1-landing-held-fade

Conversation

@vjeux

@vjeux vjeux commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Under Reduce Motion, a cross-fade's move now waits for its fade, so a Popover no longer removes its exit copy while the fade still shows.

User impact

Under DR2 a Reduce Motion transition changes opacity only, and a leaving element fades out where it is. The landing that writes a cross-fade's move, and settles its call, ran on the wall clock alone. When a test harness held the fade, Popover's exit copy was removed about 200 ms later, under the visible fade, and the proof failed with nothing wrong.

Problem and solution fit

  • The landing is armed from the call's start (due = start + at) and never looks at its fade.
  • A handle's end already waits for a held animation (settleAtEnd). The landing, which settles its call, did not.
  • A component that removes an element when its call settles removes it while it still shows.

The landing's timer now waits for a held fade, as settleAtEnd does.

Expected behavior and authority

  • design:reduced-motion DR2: opacity only; a leaving element fades out where it is.
  • The animator's own rule for a handle's end: "finished never resolves under motion still on screen".

Smallest restoration

The landing's timer first asks fadeHeldFor(landing) about the landing's own fade:

  • paused or resuming: check again shortly;
  • running past the landing's due time, as after a pause: wait for the rest of the curve on the live clock;
  • otherwise: no wait, as before.

While it waits, due moves with it, so the fade back in is not cut short. A call that takes the landing over still lands it at once. No API or timing changes.

Evidence

  • Reproduction before the change: the arm at vjeux@364510b36c holds the exit copy's fade after its start. The copy is removed in 3 of 3 runs in both engines.
  • Result after the change: the same arm over this change (vjeux@bdc618135e) passes 6 of 6 in both engines.
  • Representative unchanged path: DateInput's Wheel case "under reduced motion, a tap's cross-fade never shows the old row again while the main thread is blocked" still lands at once after its block, and a Switch's dip still ends within 200 ms (18 of 18 measured).
  • Regression test or other mutation-sensitive proof: two unit tests, a dip and an exit whose fade is paused after its start, fail without this change.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • animator.test.ts: 222 of 222. Its test animations now report their timing, as a browser's do, so "a move taken back mid-dip fades straight back up" also covers the timer path. Motion and every animator adopter's unit tests: 3,952 of 3,952.
  • Interaction specs of the animator and its adopters (Popover, BottomSheet, Switch, Lightbox, SegmentedControl, Slider, SnapPaging, DateInput): Chromium 283 passed and 9 skipped, WebKit 244 passed and 48 skipped in the CI profile.
  • The wait reads the live clock, not the fade's current time. After a long task Chromium's timeline still reads the frame before it.
  • ESLint, Prettier and TypeScript on the changed files.

A landing wrote its move and settled on the wall clock, even while a
sampler held its fade on screen, and Popover then removed its exit copy
under the held fade. The landing now waits for its fade: a paused fade
checks again later, and a running fade that has not ended on the live
clock waits out the rest.
@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 6, 2026 11:41pm 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 6, 2026, 11:56 PM UTC

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 38eda77

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
DateTimeInput 196.3 kB (+185 B) · 18.1 kB CSS (0) —
TimeInput 150.7 kB (+173 B) · 15.5 kB CSS (0) —
Slider 102.0 kB (+161 B) · 8.7 kB CSS (0) —
28 more components
Component Size LoC
BottomSheet 59.6 kB (+158 B) · 7.5 kB CSS (0) —
DateInput 173.9 kB (+155 B) · 16.4 kB CSS (0) —
PowerSearch 272.4 kB (+143 B) · 23.1 kB CSS (0) —
SegmentedControl 89.7 kB (+142 B) · 6.8 kB CSS (0) —
Switch 96.5 kB (+136 B) · 9.8 kB CSS (0) —
Lightbox 103.2 kB (+127 B) · 9.8 kB CSS (0) —
Popover 78.8 kB (+123 B) · 13.4 kB CSS (0) —
ContextMenu 90.6 kB (+1 B) · 16.6 kB CSS (0) —
Markdown 162.4 kB (+1 B) · 19.5 kB CSS (0) —
DropdownMenu 86.3 kB (0) · 16.7 kB CSS (0) —
MultiSelector 88.8 kB (0) · 16.3 kB CSS (0) —
Pagination 103.4 kB (0) · 17.3 kB CSS (0) —
Table 100.0 kB (0) · 17.3 kB CSS (0) —
TableCell 91.8 kB (0) · 17.0 kB CSS (0) —
TableHeaderCell 91.4 kB (0) · 16.8 kB CSS (0) —
Tokenizer 84.9 kB (0) · 18.1 kB CSS (0) —
MoreMenu 86.6 kB (−1 B) · 16.7 kB CSS (0) —
Selector 93.2 kB (−1 B) · 16.9 kB CSS (0) —
lab/ChatEmojiPicker 96.9 kB (new) · 773 B CSS (new) —
lab/ChatReactionBar 98.0 kB (new) · 1.1 kB CSS (new) —
lab/CommentComposer 138.2 kB (new) · 1.9 kB CSS (new) —
lab/Comments 307.3 kB (new) · 2.5 kB CSS (new) —
lab/CommentThread 302.1 kB (new) · 2.4 kB CSS (new) —
lab/NavigationScreen 78.6 kB (new) · 1.5 kB CSS (new) —
lab/NavigationStack 78.6 kB (new) · 1.5 kB CSS (new) —
lab/PageControl 71.9 kB (new) · 709 B CSS (new) —
lab/TourStep 85.1 kB (new) · 590 B CSS (new) —
richtext/RichTextEditorToolbar 244.4 kB (new) · 454 B CSS (new) —

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: cli +14 · ~5 · −0 (against the merge base's committed report)

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

19 API changes (advisory)
Package Where Signature Usage
+ cli ./api · Types · type SearchResultEntry deprecated?: ComponentDeprecation | undefined import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …}
+ cli ./authoring · Types · interface ComponentDeprecation interface ComponentDeprecation import type {ComponentDeprecation} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface ComponentIconSlotDoc interface ComponentIconSlotDoc import type {ComponentIconSlotDoc} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface ComponentIconSlotStateDoc interface ComponentIconSlotStateDoc import type {ComponentIconSlotStateDoc} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface MultiComponentDoc deprecated?: ComponentDeprecation import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …}
+ cli ./authoring · Types · interface SingleComponentDoc deprecated?: ComponentDeprecation import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …}
+ cli ./doc · Types · interface ComponentBaseDoc deprecated?: ComponentDeprecation import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …}
+ cli ./doc · Types · interface SubComponentDoc deprecated?: ComponentDeprecation import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …}
+ cli ./doc · Also exported from an earlier entry point · ComponentDeprecation ComponentDeprecation (./authoring) import {ComponentDeprecation} from '@astryxdesign/cli/doc'
+ cli ./doc · Also exported from an earlier entry point · ComponentIconSlotDoc ComponentIconSlotDoc (./authoring) import {ComponentIconSlotDoc} from '@astryxdesign/cli/doc'
+ cli ./doc · Also exported from an earlier entry point · ComponentIconSlotStateDoc ComponentIconSlotStateDoc (./authoring) import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/doc'
+ cli ./template · Also exported from an earlier entry point · ComponentDeprecation ComponentDeprecation (./authoring) import {ComponentDeprecation} from '@astryxdesign/cli/template'
+ cli ./template · Also exported from an earlier entry point · ComponentIconSlotDoc ComponentIconSlotDoc (./authoring) import {ComponentIconSlotDoc} from '@astryxdesign/cli/template'
+ cli ./template · Also exported from an earlier entry point · ComponentIconSlotStateDoc ComponentIconSlotStateDoc (./authoring) import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/template'
~ cli ./api · Functions · function search function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> import {search} from '@astryxdesign/cli/api'; search(…)
~ cli ./authoring · Types · interface MultiComponentDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {theming: …}
~ cli ./authoring · Types · interface SingleComponentDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {theming: …}
~ cli ./doc · Types · interface ComponentBaseDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {theming: …}
~ cli ./doc · Types · interface SubComponentDoc theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {theming: …}

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec b3cbc13

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

Requesting changes: the paused-fade fix works, but the new wait also changes two ordinary Reduce Motion cases on touch.

  • Because the hold check sits inside land(), it also runs when takeOverLandings lands a move that was taken back mid-dip, so instead of fading straight back up the element fades fully out and, in 19 of 30 Chromium runs, then snaps from transparent to fully shown in one frame.
  • fadeHeldFor() floors its wait at one frame (Math.max(left, END_RECHECK_MS)), and the landing's timer usually fires a fraction of a millisecond before the fade ends, so 34 of 40 plain dips in Chromium end at about 216 ms, over the 200 ms limit in design:reduced-motion DR2.
  • The changeset and the description say a fade the browser starts late used to let the element jump, but the base already lands at the end of a fade started 300 ms late (40 of 40 runs) and the tests cover only a paused fade, so please narrow the wording to the paused case.

Running the hold check only on the landing's timer and comparing the fade's end with landing.due fixes both code issues and keeps both new tests passing; the inline comments carry the snippet. The unit-test fake has no effect, so no test reaches the running-fade branch; with effect.getTiming() the existing take-back test fails on this head.

[Automated review]

Comment thread packages/core/src/motion/animator.ts Resolved
Comment thread packages/core/src/motion/animator.ts Resolved
A call that takes a landing over lands it directly, at once, so the
wait now sits on the landing's timer only. A fade that ends by the
landing's due time holds nothing, with no frame's wait added: a timer
often fires a fraction of a millisecond early, and that wait pushed a
dip past 200 ms. The test animations now report their timing, as a
browser's do.

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

Requesting changes: the three earlier findings are fixed (a reversed move fades straight back up, plain dips end within 200 ms, and the changeset describes the paused case), but one gap remains when a held fade resumes.

  • Miss: for one frame after a sampler resumes the held fade with play(), the browser reports no startTime, and fadeHeldFor() returns 0 then (packages/core/src/motion/animator.ts:3021), so in Chromium an exit's call settles at opacity 0.87 in 20 of 20 resumes that land in that frame, and a dip's travel is written at opacity 0.5 in 5 of 40 random resumes.

Holding a pending start for a frame (if (start == null) return animation.pending ? END_RECHECK_MS : 0;, keeping the duration check) fixes both in the same runs and leaves plain dips and take-backs unchanged. Please add a regression proof for a resume whose start is still pending; the unit fake keeps a paused animation's start, so it cannot show this yet.

[Automated review]

Comment thread packages/core/src/motion/animator.ts Resolved
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 79c89cb

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 6, 2026
For a frame after a sampler resumes a paused fade, the fade has no
start yet, and the landing read that as a fade at its end. It wrote the
move, or settled its call, while the fade still showed its paused
frame. It now checks again a frame later.
@cixzhang

cixzhang commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 38eda77

@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. It starts once the pull request is marked ready for review and a maintainer adds the ci:run label.

The landing now waits for a paused fade and for the frame after play() resumes it, so a held exit fades out where it is instead of disappearing. The new tests fail without the change, and the earlier review findings are fixed.

  • Optional: the first sentence of the comment at packages/core/src/motion/animator.ts:3029 restates the check below it; the inline suggestion keeps only the reason.

[Automated review]

Comment on lines +3029 to +3030
// A fade that ends by the landing's due time holds nothing. A timer runs
// in whole milliseconds, so it often fires a fraction early.

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.

Optional (comment style): the first sentence restates the end <= landing.due check below; only the second sentence explains why the check compares with the due time and not with now(). Keeping just the reason:

Suggested change
// A fade that ends by the landing's due time holds nothing. A timer runs
// in whole milliseconds, so it often fires a fraction early.
// A timer runs in whole milliseconds and often fires a fraction early.
// The due time, not now, decides whether the fade has ended.

@vjeux
vjeux marked this pull request as ready for review November 7, 2026 00:29
@cixzhang
cixzhang merged commit ed0adf3 into meta:main Nov 7, 2026
125 checks passed
@vjeux
vjeux deleted the uikit/f1-landing-held-fade branch November 7, 2026 01:20

This branch was successfully deployed

1 active deployment
Preview — 38eda77e Deployed Nov 6, 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