Repository navigation
fix(core): a retarget before Chromium reports a call's start continues from the screen - #9255
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | core |
. · Types · interface SearchContext |
interface SearchContext<T extends SearchableItem = SearchableItem> |
import type {SearchContext} from '@astryxdesign/core' |
| + | core |
./Typeahead · Also exported from an earlier entry point · SearchContext |
SearchContext (.) |
import {SearchContext} from '@astryxdesign/core/Typeahead' |
| ~ | core |
. · Types · interface SearchSource |
search: (query: string) => Promise<T[]> | T[] → search: (query: string, context?: SearchContext<T>) => Promise<T[]> | T[] |
import type {SearchSource} from '@astryxdesign/core'; const x: SearchSource = {search: …} |
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
There was a problem hiding this comment.
Changes requested: the fix works for the case it targets (the new Chromium proof fails on main and passes here), but it adds a jump on a neighbouring path, and the release note overstates the impact.
- A call created inside an animation-frame callback, whether a plain
animate()fromrequestAnimationFrameorstart: 'presented', is already committed when its first frame callback runs a frame later, so after a busy task the new branch dates it after the block and the element jumps back about 120 px in Chromium (3 of 10 runs each, none on main); please limit the first-frame start to calls created before that frame and cover the callback case in the unit harness and the proof. - No component uses the animator yet and it is not exported, so the changeset's Switch example describes a change consumers cannot see; please word it as an internal animator change, like
.changeset/uikit-motion-animator-pseudo-element.md.
[Automated review]
| if ( | ||
| !group.resolved && | ||
| group.animations.some( | ||
| animation => | ||
| animation.startTime == null && animation.playState === 'running', | ||
| ) | ||
| ) { | ||
| resolveGroup(group, now()); |
There was a problem hiding this comment.
This assumes the first frame callback runs in the frame that commits the animations. For a call created inside a frame callback (the start: 'presented' path through flushDeferredThrough, or a caller's own requestAnimationFrame), the browser commits it in that same frame and this callback runs one frame later. When a busy task delays that frame, Chromium has still not reported the start, so the call is dated after the block and the element jumps back to its start: about 120 px in 3 of 10 Chromium runs each for a plain animate() and for presented, and in none on main. Could this branch apply only to calls created before this frame, and leave the browser's start alone otherwise?
| * `startUnread`, the frame's callbacks run before the page can read those | ||
| * starts, as in Chromium, whose compositor starts a composited animation at | ||
| * the frame that commits it and tells the page that start a frame or more | ||
| * later (`noticeStarts`). |
There was a problem hiding this comment.
Nothing named noticeStarts exists in the repository at this head; point to the startUnread option instead.
dda4a38 to
272366d
Compare
|
Addressed in 272366d:
|
272366d to
e3128e2
Compare
|
/approve-spec e3128e2 |
There was a problem hiding this comment.
Changes requested: the animator fix itself checks out (the new Chromium proof fails on main and passes here, and calls made in a frame callback keep the browser's start as before), but the changeset again announces a Switch fix. No component uses the animator yet and it is not exported, so please restore the internal [chore] wording from your previous revision, in the style of .changeset/uikit-motion-animator-pseudo-element.md.
[Automated review]
…s from the screen A call from rest has no start time until the browser commits it. Chromium's compositor starts a composited animation at the frame that commits it, but tells the page that start a frame or more later, longer under load. In that window the animator read the call as not started, so a retarget or a rebase replayed the curve from its start while the screen had moved on: the box stepped back 61 px in one frame (spec:AST-094 FR6). In the frame that commits a call still waiting for its start, the animator now starts it at that frame, the start the compositor takes. Only a call made in a task whose first frame is the one that commits it: a call made in a frame callback was committed by that frame, and after a block before the first frame the two cannot be told apart, so both keep the browser's start.
e3128e2 to
5e8517e
Compare
|
/approve-spec 5e8517e |
There was a problem hiding this comment.
This looks ready to approve: the new Chromium proof steps back from 61 px to 0 px on main and never on this branch, and calls made in a frame callback, plain or start: 'presented', keep the browser's start as before. The changeset is the internal note again, and the FR6 verification-row addition carries an engineering owner's approval for this head, so nothing else is needed from you.
[Automated review]
User impact
Core's touch animator (internal, and not yet driving a shipped component) lost its place in Chromium when a motion it started from rest was retargeted or rebased right after the start: it replayed the curve from its beginning while the screen had moved on, so the element stepped back for a frame before going on (61 px in the proof below). A retarget must continue from what the screen shows (
spec:AST-094FR6), so every touch component built on the animator would show that jump at the moment the user acts.Problem and solution fit
LATE_START_MS, the animator's existing measure of a block), that frame cannot tell a call made in a task from one a page's own frame callback made. Both keep the browser's start, as before.Expected behavior and authority
spec:AST-094FR6: a retarget continues from the current value and velocity. Its verification row gains this state ("a retarget before the browser reports the call's start"), the test below being its evidence.Smallest restoration
One condition in the first-frame callback of a call from rest (
motion/animator.ts), plus a count of the animator's own frame callbacks so a call made in one is known. TherequestFrameoption, the animator's API and every other path are unchanged.Evidence
Status at this head: every gate has finished; the tree is identical to 272366d, where they ran. Build, type check, CI-strict lint,
check:knowledge,check:changesets,test:ui(17,185) andcheck:repopass; the node suites fail only the twocache.test.mjslock cases that fail on main. The animator's browser spec passes ×10 in Chromium pinned to 2 cores at 1 worker (170), ×10 under the CI WebKit job's command withLP_NUM_THREADS=4(130, with 40 Chromium-only skips), and once at 3 CPUs with 1 and 16 workers (13 each, 4 skips).Scope
Testing
For WebKit, use the CI WebKit job's container command (
internal/interaction-harness/scripts/webkit-container.mjs) with podman--cpus=4,CI=1,LP_NUM_THREADS=4and 1 worker.Writing rubric results
The record touched is
spec:AST-094, with one representative state added to its FR6 verification row.proposes,we decided,previously,a port of); the added state is present tense.#followed by digits,/pull/or/issues/).