Repository navigation
fix(core): a Reduce Motion landing waits for a held fade - #10378
Conversation
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.
|
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 |
|---|---|---|
| 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
|
/approve-spec b3cbc13 |
There was a problem hiding this comment.
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 whentakeOverLandingslands 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 indesign:reduced-motionDR2.- 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]
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.
There was a problem hiding this comment.
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 nostartTime, andfadeHeldFor()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]
|
/approve-spec 79c89cb |
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.
|
/approve-spec 38eda77 |
There was a problem hiding this comment.
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:3029restates the check below it; the inline suggestion keeps only the reason.
[Automated review]
| // 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. |
There was a problem hiding this comment.
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:
| // 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. |
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
due = start + at) and never looks at its fade.settleAtEnd). The landing, which settles its call, did not.The landing's timer now waits for a held fade, as
settleAtEnddoes.Expected behavior and authority
design:reduced-motionDR2: opacity only; a leaving element fades out where it is.finishednever resolves under motion still on screen".Smallest restoration
The landing's timer first asks
fadeHeldFor(landing)about the landing's own fade:While it waits,
duemoves 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
Scope
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.