Skip to content

fix(core): the calls from rest that one frame commits start at one time - #10584

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:fix/animator-one-frame-one-start
Nov 7, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:fix/animator-one-frame-one-start

Conversation

@vjeux

@vjeux vjeux commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #10584 → #10568

User impact

Elements that start moving from rest in the same frame, such as a carousel's pages as they settle, could start at different times. Each animator read the clock in its own frame callback to date its start. A callback between two of them delayed the later one. In Chromium, a 3 ms callback between two calls kept their animations 3.1 to 3.3 ms apart for the whole motion.

Problem and solution fit

  • A call from rest starts when the browser commits its animations. Where the first frame cannot read that start yet (Chromium reports it later), the animator dates the call when that frame runs.
  • Now the first callback in a frame reads the time, and every animator's callback in that frame takes it.

Expected behavior and authority

spec:AST-108 FR4a: animations that run together "start and land together". The animator's contract: one motion's parts made as separate calls start together (TaskMark). A browser commits a frame's pending animations at one time.

Smallest restoration

  • frameTime(frame): one read per frame timestamp, where the first-frame callback dates a call and its channels' interim reads. The read clears at the next task, so a source that repeats a timestamp still reads each frame anew.
  • requestFrame passes the frame's timestamp on; a frame source without one reads the clock, as before.
  • Unchanged: a call on a moving element keeps its own clock (spec:AST-094 FR6); a later frame reads anew. No API, curve or timing value changes.

Evidence

  • Before: two calls from one task, with a 3 ms page frame callback between them. In Chromium the starts were 3.1 to 3.3 ms apart (3 of 3), a gap kept on every frame. In the unit model the starts were 1016 and 1019.
  • After: one start and no gap on any frame, in Chromium 11 of 11. The unit model reads 1016 for both, from one task and from two tasks before one frame.
  • Carousel's three-up story, 9 items settling after a touch flick, in Chromium: their starts spread 0.5 ms before and 0 after (3 of 3 each). Their places spread up to 0.8 px, then 0. WebKit gave them one start both ways.
  • Mutation-sensitive: the new cases fail on main's animator (27382d8096); the repeated-timestamp case fails with the read kept across tasks (c12a19d16f).

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

  • Unit: the animator file (239 tests); core's whole ui project (22,482 tests).
  • Browser: the new case ×10 in Chromium and ×5 in WebKit at CI's settings; the carousel flick ×3 per engine, before and after; every motion spec (Chromium 151 of 151; WebKit 144 of 144, 7 skipped) and the Carousel and SnapPaging specs (Chromium 44 of 44, 5 skipped; WebKit 48 of 48, 1 skipped).
  • ESLint, Prettier, TypeScript (core, rc 0) and the changeset checks.

Each animator dated a call from rest in its own frame callback, with
its own read of the clock, so calls one frame committed started apart
by as long as the callbacks between them ran. The first callback in a
frame now reads the time, and every animator's callback in that frame
takes that read.
@vercel

vercel Bot commented Nov 7, 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 9:22pm UTC

Request Review

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

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 9:28 PM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 2390b53

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
Lightbox 111.1 kB (+121 B) · 10.3 kB CSS (0) —
BottomSheet 65.2 kB (+92 B) · 7.5 kB CSS (0) —
SegmentedControl 92.4 kB (+92 B) · 6.8 kB CSS (0) —
30 more components
Component Size LoC
Slider 106.0 kB (+92 B) · 8.7 kB CSS (0) —
Switch 100.6 kB (+92 B) · 9.9 kB CSS (0) —
DateInput 182.4 kB (+82 B) · 16.7 kB CSS (0) —
Popover 87.7 kB (+82 B) · 13.9 kB CSS (0) —
PowerSearch 281.3 kB (+81 B) · 23.5 kB CSS (0) —
DateTimeInput 204.0 kB (+78 B) · 18.4 kB CSS (0) —
TimeInput 158.3 kB (+72 B) · 15.7 kB CSS (0) —
DropdownMenu 95.6 kB (+1 B) · 17.1 kB CSS (0) —
ContextMenu 106.2 kB (0) · 17.0 kB CSS (0) —
Markdown 179.4 kB (0) · 20.0 kB CSS (0) —
MoreMenu 95.9 kB (0) · 17.1 kB CSS (0) —
MultiSelector 93.6 kB (0) · 16.6 kB CSS (0) —
Pagination 108.2 kB (0) · 17.5 kB CSS (0) —
Selector 98.2 kB (0) · 17.1 kB CSS (0) —
Table 116.3 kB (0) · 17.7 kB CSS (0) —
TableHeaderCell 107.0 kB (0) · 17.2 kB CSS (0) —
Tokenizer 90.2 kB (0) · 18.3 kB CSS (0) —
TableCell 107.4 kB (−1 B) · 17.4 kB CSS (0) —
lab/ChatEmojiPicker 102.2 kB (new) · 773 B CSS (new) —
lab/ChatReactionBar 103.3 kB (new) · 1.1 kB CSS (new) —
lab/CommentComposer 144.2 kB (new) · 1.9 kB CSS (new) —
lab/Comments 324.7 kB (new) · 2.5 kB CSS (new) —
lab/CommentThread 319.6 kB (new) · 2.4 kB CSS (new) —
lab/NavigationScreen 79.5 kB (new) · 1.5 kB CSS (new) —
lab/NavigationStack 79.5 kB (new) · 1.5 kB CSS (new) —
lab/PageControl 72.7 kB (new) · 709 B CSS (new) —
lab/TabBar 74.0 kB (new) · 1.8 kB CSS (new) —
lab/TabBarItem 3.8 kB (new) · 1.8 kB CSS (new) —
lab/TourStep 94.0 kB (new) · 590 B CSS (new) —
richtext/RichTextEditorToolbar 250.1 kB (new) · 454 B CSS (new) —

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

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

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

21 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 ./api · Types · type SwizzleCopyResponse data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; feedback?: SwizzleFeedback | undefined } → data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; dependencies: Record<string, string>; feedback?: SwizzleFeedback | undefined } import type {SwizzleCopyResponse} from '@astryxdesign/cli/api'; const x: SwizzleCopyResponse = {data: …}
~ 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 ./authoring · Types · type TemplateCategory type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #e7c18378 → type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #a8be998f import type {TemplateCategory} from '@astryxdesign/cli/authoring'
~ 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

@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 for one wording fix. The fix itself checks out: the new unit and Chromium tests fail on main and pass here. Two calls from rest that one frame commits now share one start (3.1–3.4 ms apart before, 0 after), as spec:AST-108 FR4a requires.

  • The changeset (.changeset/motion-one-frame-one-start.md) and the title say every motion that starts in the same frame now starts at one time. A call on an element that is already moving still starts at its own clock read: in Chromium, two moving boxes retargeted by two frame callbacks around a 3 ms callback start about 4 ms apart. Please scope both to calls from rest, for example "elements that start moving from rest in the same frame now start at one time".

CI has not run on this head yet: it is a draft from a fork, and a maintainer adds the ci:run label so CI runs.

[Automated review]

A call on a moving element keeps its own clock, so the changeset, the
frame read's comment and the two test titles now say calls from rest.
@vjeux vjeux changed the title fix(core): the calls one frame commits start at one time fix(core): the calls from rest that one frame commits start at one time 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.

Approved pending CI: CI has not run on this head yet. A maintainer adds the ci:run label so CI runs.

The wording fix is in: the changeset and the title now scope the change to calls from rest, which matches what the code does. The fix itself checks out: the new unit and Chromium tests fail with main's animator, where two calls from rest start 3.1–3.3 ms apart for the whole motion, and pass here with one shared start, as spec:AST-108 FR4a requires.

One optional wording suggestion for the frameTime comment is inline.

[Automated review]

Comment on lines +764 to +765
* before them does not move their start. A call on a moving element keeps
* its own clock. The read ends with the frame's task, so a frame

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: this sentence holds for the default start only. A call on a moving element with start: 'commit' skips the at-rest check (for (const channel of start === 'commit' ? [] : channels)), gets a start group, and its first-frame callback takes this shared read too. No production caller passes 'commit' today, so nothing breaks; suggested wording:

A call on a moving element keeps its own clock, unless it asks for start: 'commit'.

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 7, 2026
@vjeux
vjeux marked this pull request as ready for review November 7, 2026 22:16
@cixzhang
cixzhang merged commit 7b8dc58 into meta:main Nov 7, 2026
131 checks passed
@vjeux
vjeux deleted the fix/animator-one-frame-one-start branch November 7, 2026 23:25

This branch was successfully deployed

1 active deployment
Preview — 2390b535 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 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