Repository navigation
fix(core): a spring retarget committed late starts at its frame - #10607
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| SegmentedControl | 95.9 kB (+1.4 kB) · 6.9 kB CSS (0) | — | — · — · — |
| PowerSearch | 286.4 kB (+1.4 kB) · 24.1 kB CSS (0) | — | — · — · — |
| BottomSheet | 67.8 kB (+1.3 kB) · 7.7 kB CSS (0) | — | — · — · — |
32 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateInput | 186.2 kB (+1.3 kB) · 17.0 kB CSS (0) | — | — · — · — |
| Lightbox | 122.3 kB (+1.3 kB) · 10.6 kB CSS (0) | — | — · — · — |
| Slider | 109.0 kB (+1.3 kB) · 8.8 kB CSS (0) | — | — · — · — |
| DateTimeInput | 207.9 kB (+1.3 kB) · 18.7 kB CSS (0) | — | — · — · — |
| Switch · Storybook | 103.6 kB (+1.3 kB) · 9.9 kB CSS (0) | 1,734 (0) | ✓ · ✓ · ✓ |
| TimeInput | 161.6 kB (+1.3 kB) · 16.0 kB CSS (0) | — | — · — · — |
| ChatLayout | 82.7 kB (+1.3 kB) · 10.5 kB CSS (0) | — | — · — · — |
| SideNav | 113.9 kB (+1.3 kB) · 11.4 kB CSS (0) | — | — · — · — |
| Popover | 90.7 kB (+1.2 kB) · 14.2 kB CSS (0) | — | — · — · — |
| Markdown | 187.2 kB (+1 B) · 20.6 kB CSS (0) | — | — · — · — |
| Table | 124.5 kB (+1 B) · 18.3 kB CSS (0) | — | — · — · — |
| ContextMenu | 108.1 kB (0) · 17.4 kB CSS (0) | — | — · — · — |
| DropdownMenu | 97.0 kB (0) · 17.6 kB CSS (0) | — | — · — · — |
| MultiSelector | 94.7 kB (0) · 16.8 kB CSS (0) | — | — · — · — |
| Pagination | 109.7 kB (0) · 17.8 kB CSS (0) | — | — · — · — |
| Selector | 99.6 kB (0) · 17.4 kB CSS (0) | — | — · — · — |
| TableCell | 109.4 kB (0) · 17.9 kB CSS (0) | — | — · — · — |
| Tokenizer | 91.4 kB (0) · 18.8 kB CSS (0) | — | — · — · — |
| MoreMenu | 97.2 kB (−1 B) · 17.6 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 109.0 kB (−1 B) · 17.7 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 105.4 kB (new) · 773 B CSS (new) | — | — · — · — |
| lab/ChatReactionBar | 106.6 kB (new) · 1.1 kB CSS (new) | — | — · — · — |
| lab/CommentComposer | 150.8 kB (new) · 1.9 kB CSS (new) | — | — · — · — |
| lab/Comments | 349.7 kB (new) · 2.5 kB CSS (new) | — | — · — · — |
| lab/CommentThread | 342.9 kB (new) · 2.4 kB CSS (new) | — | — · — · — |
| lab/NavigationScreen | 82.1 kB (new) · 1.5 kB CSS (new) | — | — · — · — |
| lab/NavigationStack | 82.1 kB (new) · 1.5 kB CSS (new) | — | — · — · — |
| lab/PageControl | 75.0 kB (new) · 709 B CSS (new) | — | — · — · — |
| lab/TabBar | 76.7 kB (new) · 1.8 kB CSS (new) | — | — · — · — |
| lab/TabBarItem | 3.8 kB (new) · 1.8 kB CSS (new) | — | — · — · — |
| lab/TourStep | 97.1 kB (new) · 590 B CSS (new) | — | — · — · — |
| richtext/RichTextEditorToolbar | 277.7 kB (new) · 454 B CSS (new) | — | — · — · — |
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: cli +22 · ~7 · −0 (against the merge base's committed report); theme-butter +1 · ~0 · −0 (against the merge base's committed report); theme-y2k +1 · ~0 · −0 (against the merge base's committed report)
Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
31 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./api · Functions · function exportSearchIndex |
function exportSearchIndex @experimental: (options?: { cwd?: string | undefined; package?: string | undefined }) => Promise<SearchIndex> |
import {exportSearchIndex} from '@astryxdesign/cli/api'; exportSearchIndex(…) |
| + | cli |
./api · Functions · function rankSearchIndex |
function rankSearchIndex @experimental: (query: string, indexes: SearchIndex | SearchIndex[], options?: { type?: SearchDomain | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {rankSearchIndex} from '@astryxdesign/cli/api'; rankSearchIndex(…) |
| + | cli |
./api · Types · type DocsListChild |
type DocsListChild = DocsNodeChild & { topic: string; description: string; children?: DocsListChild[]; childCount?: number } |
import type {DocsListChild} from '@astryxdesign/cli/api' |
| + | cli |
./api · Types · type DocsListNamespace |
childCount?: number | undefined |
import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {childCount: …} |
| + | cli |
./api · Types · type DocsListNamespace |
children?: DocsListChild[] | undefined |
import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {children: …} |
| + | cli |
./api · Types · type SearchIndex |
type SearchIndex |
import type {SearchIndex} from '@astryxdesign/cli/api' |
| + | 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 |
./json · Also exported from an earlier entry point · DocsListChild |
DocsListChild (./api) |
import {DocsListChild} from '@astryxdesign/cli/json' |
| + | cli |
./json · Also exported from an earlier entry point · SearchIndex |
SearchIndex (./api) |
import {SearchIndex} from '@astryxdesign/cli/json' |
| + | 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>; marker … #84d9505b |
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: …} |
| + | theme-butter |
Public attributes · attr data-astryx-pressable |
attr data-astryx-pressable (public data attribute) |
[data-astryx-pressable] { … } |
| + | theme-y2k |
Public attributes · attr data-astryx-pressable |
attr data-astryx-pressable (public data attribute) |
[data-astryx-pressable] { … } |
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
|
AI review status for this pull request.
|
|
/approve-spec cdc8442 |
There was a problem hiding this comment.
Requesting changes. The FR6 amendment has an engineering owner's approval at this head, and the late-commit restart works for retargets made in ordinary tasks (the new Chromium case passes here and fails on the base branch), but these issues need fixing first:
- A retarget made inside a page
requestAnimationFrameorResizeObservercallback commits in that frame, yetnoteShowncounts from the next frame, so a late next frame restarts the spring from the old curve and the element jumps back (26 px in one frame in Chromium). - At a late frame
lookAtShownreplaces a velocity the call passed, such as a release velocity, with the on-screen velocity, which contradicts FR6's release clause and the documentedvelocityoption. - Where the animator's frames stop while the element's document stays visible (a Document Picture-in-Picture window whose opener tab is hidden), a continuing call never finishes and later replays from the old curve, because the hidden-page check reads only the element's document.
- The changeset and the new FR6 sentence say every late retarget starts at its commit frame, but played curves and coasts keep the call's clock, so either extend the restart to them or narrow both texts.
- The new "FR6 late commit" row cites a loaded-Switch frame proof that this pull request does not contain, so add the proof or drop it from the row.
Any fix commit needs a fresh /approve-spec for the amended record, and CI has not run on this draft head yet.
[Automated review]
cdc8442 to
25f8fee
Compare
25f8fee to
80101f4
Compare
|
/approve-spec 80101f4 |
There was a problem hiding this comment.
Requesting changes. This head fixes all five earlier findings, and an engineering owner approved the FR6 amendment at this head; two items remain.
- A second property's retarget before the same late frame keeps its own clock: with an
xretarget, ayretarget 20 ms later and the frame 45 ms after the first call,xrestarts from the screen butysteps 17 px, while the approved FR6 measures lateness from "the first call that frame commits" (animator.ts:3386), so judge it once per frame and add a two-property case. - Miss: the title "a retarget starts at the frame that commits it" claims every retarget at any commit, but on-time commits, played curves and coasts keep the call's clock (FR6, and the tests at
animator.test.ts:2387and:2492), so retitle it to the late spring case.
A fix commit needs a new /approve-spec at its head. CI has not run on this draft head.
[Automated review]
80101f4 to
83cfae2
Compare
|
/approve-spec 83cfae2 |
There was a problem hiding this comment.
Requesting changes: the FR6 amendment has an engineering owner's approval at this head, and the late-commit restart works, but one item remains.
- Calls in one task do not share one clock, as the approved FR6 ("Calls made in one task share the clock of its first call"), its "FR6 late commit" row and the changeset say:
callTime(animator.ts:781-798) ends the clock at the next microtask checkpoint, which a browser runs after every event-listener, frame and observer callback, so two callbacks 5 ms apart start 5 ms apart; keep the clock until the task ends and add a two-callback case, or narrow FR6, its row and the changeset to one callback.
The earlier findings are fixed: lateness is now judged once per frame across properties and animators, and the title names only the late spring case. A fix commit needs a new /approve-spec at its head. CI has not run on this draft head.
[Automated review]
A call that continues motion keeps the clock of the call. When the browser commits it late, behind a busy main thread, the screen shows the old curve until that frame, and the new curve then shows already advanced: the element jumps. A retarget behind a 200 ms block stepped back 42 px in one frame. Such a call now notes what the screen shows of each property that it changes: the old curve or the value at rest, and any rebase since. Its channels wait for the animator's next frame callback, which rebuilds them from the call's own time. When that frame comes more than LATE_START_MS after the first call it commits, on any animator, each spring that the calls leave starts there instead, from the value on screen, as UIKit's added spring starts at its commit. It keeps a velocity that its call handed it, such as a release's, and otherwise takes the one on screen. An additive spring adds to the curve on screen from there. A played curve or a coast keeps the call's clock. Motion calls made in one callback share the clock of its first call, so the children of a pager line up after a retarget. A call more than LATE_START_MS after that first call starts a new clock. A call made inside a frame callback of the page waits for the next frame too, so it shows its new curve one frame later. A rebase before that frame moves the old curve with the element. stop() before a late frame freezes where the screen shows, and the call finishes at the end of the curve it starts. A hidden page draws no frames, nor does the frame source of a hidden opener, so its calls keep their own clock. AST-094 FR6 drops its limit for other retargets, restarts only a spring that the browser commits late (more than 34 ms after the first call), shares one clock per callback, names the one-frame-later case and a starved compositor's lag as gaps, and gains a verification row for a late commit.
With a retarget that starts at the frame that commits it, the late-lift proof no longer allows a skip at a late commit. The page notes every translate curve of the thumb: when it was made, when the browser started it or the page set its start, when it ended, and its keyframes. Each presented frame must show, within 1 px, the curve the compositor has at that frame's own time. That is the travel, a curve started after the lift, or the off side's rest after the last one ends. Curves replace one another only in order. A frame that matches no curve fails as UnprescribedFrameError. Each turn back that the frames show starts within 1 px of the newest curve the browser started before it, and after the held lift. It plays TRACKING or TRAVEL to the off side. A lift that lands out of place still fails as LiftPlacementError, and too few frames as starved. The proof does not check when a curve is committed. Under the freeze and the held lift, the page cannot tell where a curve was made. That is a frame's callbacks, or a task after that frame. So a turn back on its call's clock that meets the curve before it, but whose frame came late, can pass here. The animator's unit tests of a spring retarget committed late pin that rule. An on-time frame keeps the call's clock, and a late frame starts the spring there from the screen.
83cfae2 to
036b00d
Compare
|
/approve-spec 036b00d |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this draft head yet, so the required checks still have to pass before merge.
The FR6 amendment has an engineering owner's approval at this head, and the earlier finding is fixed: FR6, its row and the changeset now scope the shared clock to one callback, which is what callTime does, and a new case pins the microtask-checkpoint boundary. Behind a 200 ms block in Chromium, the retarget now starts within 0.8 px of a spring from the screen, where main steps 42 px.
- Optional: FR6's "a call more than 34 ms after that first call starts a new clock" has no unit case yet; one with a second call 40 ms into the same run would pin it.
[Automated review]
|
/approve-spec 8d36049 |
There was a problem hiding this comment.
Approved: the FR6 amendment has an engineering owner's approval for this revision, and every CI check has passed.
Merging main leaves this change's own patch as it was, and the motion and SnapPaging suites pass together on the merged code, including both 200 ms block cases in Chromium.
- Optional:
shifted()inanimator.tskeeps a played curve'ssource, whichmain'srebaseclears, so two animators rebased by different offsets in one task can share one interim bake; addingsource: undefinedthere keeps the keyframe cache's contract. - Worth knowing: a SnapPaging settle that retargets a running settle is now rebuilt in each child's own frame callback, so it no longer gets
main's single shared bake.
[Automated review]
| const shifted = (segment: Segment, offset: number): Segment => | ||
| offset === 0 | ||
| ? segment | ||
| : { | ||
| ...segment, | ||
| target: segment.target + offset, | ||
| at: t => segment.at(t) + offset, | ||
| }; |
There was a problem hiding this comment.
Non-blocking: main's rebase clears source when it moves a played curve (source: undefined), as Segment.source's JSDoc asks. This copy keeps it, and the per-task keyframe cache keys on source, not on the offset. So when two animators play one curve object, then each retargets and rebases (by 10 and 30 px) in one task, rebuildShown gives the second one the first one's interim keyframes: 55 px where its shifted curve is at 75 px, until the next frame replaces them. Adding source: undefined here keeps the cache's contract.
User impact
A retarget committed late, behind a busy main thread, jumps: 42 px in one frame behind a 200 ms block, up to 15.5 px on a loaded Switch.
Problem and solution fit
Expected behavior and authority
spec:AST-094FR6, amended here for the spec owners' stamp: "A retarget's spring that the browser commits late starts at that frame, from the value on screen there… Calls made in one callback… share the clock of its first call…" Row "FR6 late commit" verifies it.Smallest restoration
Evidence
Scope
Testing
uiproject (20,812 tests); core TypeScript (rc 0).auditspec files of the 22 Core folders that import the animator, in Chromium, on a Storybook built and stamped at 83cfae2: 205 of 205.check:knowledgeandcheck:changesets.Writing rubric results