Repository navigation
chore(core): the animator takes start: 'next-frame' in an input event - #9261
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
c4466e3 to
695ec9b
Compare
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC |
|---|---|---|
| ChatLayout | 86.9 kB (+76 B) · 10.9 kB CSS (0) | — |
| TimeInput | 168.5 kB (+69 B) · 16.4 kB CSS (0) | — |
| BottomSheet | 69.9 kB (+67 B) · 7.7 kB CSS (0) | — |
32 more components
| Component | Size | LoC |
|---|---|---|
| lab/NavigationStack | 84.4 kB (+67 B) · 1.5 kB CSS (0) | — |
| Lightbox | 127.7 kB (+66 B) · 10.9 kB CSS (0) | — |
| lab/NavigationScreen | 84.4 kB (+66 B) · 1.5 kB CSS (0) | — |
| lab/TabBar | 82.9 kB (+65 B) · 1.8 kB CSS (0) | — |
| SegmentedControl | 101.2 kB (+64 B) · 6.9 kB CSS (0) | — |
| lab/CommentComposer | 157.0 kB (+64 B) · 1.9 kB CSS (0) | — |
| lab/ChatEmojiPicker | 111.3 kB (+62 B) · 773 B CSS (0) | — |
| lab/ChatReactionBar | 112.5 kB (+62 B) · 1.1 kB CSS (0) | — |
| SideNav | 119.0 kB (+58 B) · 11.7 kB CSS (0) | — |
| lab/TourStep | 102.3 kB (+58 B) · 590 B CSS (0) | — |
| Slider | 113.4 kB (+57 B) · 8.8 kB CSS (0) | — |
| lab/Comments | 360.4 kB (+57 B) · 2.5 kB CSS (0) | — |
| DateTimeInput | 217.0 kB (+56 B) · 19.1 kB CSS (0) | — |
| Popover | 96.0 kB (+56 B) · 14.6 kB CSS (0) | — |
| Switch | 107.9 kB (+56 B) · 10.0 kB CSS (0) | — |
| lab/CommentThread | 353.7 kB (+54 B) · 2.4 kB CSS (0) | — |
| lab/PageControl | 77.5 kB (+54 B) · 709 B CSS (0) | — |
| DateInput | 194.5 kB (+53 B) · 17.4 kB CSS (0) | — |
| PowerSearch | 301.0 kB (+48 B) · 24.7 kB CSS (0) | — |
| MoreMenu | 102.8 kB (+1 B) · 17.9 kB CSS (0) | — |
| MultiSelector | 99.9 kB (+1 B) · 17.2 kB CSS (0) | — |
| Selector | 105.5 kB (+1 B) · 17.8 kB CSS (0) | — |
| ContextMenu | 113.4 kB (0) · 17.8 kB CSS (0) | — |
| DropdownMenu | 102.6 kB (0) · 17.9 kB CSS (0) | — |
| Markdown | 193.6 kB (0) · 21.0 kB CSS (0) | — |
| Pagination | 115.7 kB (0) · 18.2 kB CSS (0) | — |
| Table | 130.6 kB (0) · 18.7 kB CSS (0) | — |
| TableCell | 114.6 kB (0) · 18.2 kB CSS (0) | — |
| TableHeaderCell | 114.2 kB (0) · 18.0 kB CSS (0) | — |
| lab/TabBarItem | 3.9 kB (0) · 1.8 kB CSS (0) | — |
| richtext/RichTextEditorToolbar | 284.9 kB (0) · 454 B CSS (0) | — |
| Tokenizer | 102.2 kB (−1 B) · 19.5 kB CSS (0) | — |
Package size: @astryxdesign/core 7.40 MB packed (+1.0 kB); no new dependencies.
Not run on this PR: add ci:run-visual or ci:run-rtl to run them.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested for one small fix. start: 'next-frame' is set on whatever start group beginGroup returns, so a call with an explicit at that joins an earlier call still waiting for its start switches that earlier call to the next-frame rule, although the option's doc says it is ignored with at (animator.ts:247; set at :3201 and :3333). Guard the flag with at == null for both animate and play and add a unit case for the join. Separately, the description quotes spec:AST-094 FR6 for the start rule, but FR6 is "Motion is interruptible"; architecture:react-component-runtime INV13 (an internal chosen start) with FR5 is the governing text.
[Automated review]
695ec9b to
f2795a9
Compare
|
On the description: fixed. It now cites |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about three spec edits this branch carries from #8360: the new tap rule in spec:AST-094 FR11, the document-level non-passive touchmove listener in FR19, and the single window capture-phase listener in architecture:react-component-runtime INV13. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, which the author may do if they are an engineering owner. Two changes are needed either way:
- Rebase onto
mainso this pull request holds only the animator commit, which applies cleanly there with its animator tests passing; at this head the diff is about 26,000 lines from five other open pull requests and adds six public APIs the description says it does not. - Have
usePanGestureanduseDragToSnapPointscalluseAttachmentinstead of copying its attach-and-release lifecycle.
The at guard on start: 'next-frame' resolves the earlier finding.
[Automated review]
f2795a9 to
980f0d1
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about three spec edits this branch carries from #8360: the new tap rule in spec:AST-094 FR11, the document-level blocking touchmove listener in FR19, and the single window capture-phase listener in architecture:react-component-runtime INV13; an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, which the author may do if they are an engineering owner. Two changes are needed either way:
- Rebase onto
mainso this pull request holds only the animator commit, which applies cleanly there with its animator tests passing; at this head the diff is about 26,000 lines from five other open pull requests. - Have
usePanGesture,useDragToSnapPointsanduseFingerScrollcalluseAttachmentinstead of copying its attach-and-release lifecycle.
[Automated review]
980f0d1 to
0aa861f
Compare
There was a problem hiding this comment.
Changes requested: the start: 'next-frame' option looks right and its three new cases fail without it, but this branch still carries #8676, #8653, #8655 and #8658, so the diff is about 9,300 authored lines instead of the option's 192. Please rebase onto main once that stack merges, and fix these two issues in the pull requests they come from:
usePanGesturere-implements the attach and release lifecycle thatuseAttachmentowns, whichuseDragToSnapPointsalready calls; callinguseAttachmentkeyed onaxiskeeps one lifecycle.- In both animator playing-card templates, a second Discard press during the first discard deals two cards (the ace goes straight to the queen); the pan templates' one-throw-at-a-time guard, with a double-press test, fixes it.
[Automated review]
0aa861f to
bb0ea84
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft; it already carries ci:run, so CI runs once it is marked ready for review.
The internal start: 'next-frame' option sits under the runtime record's internal chosen start for touch motion that keeps advancing through a main-thread block, and the new INV13 sentence naming it is approved for this head. This push only merges main, and the option's own lines are unchanged.
Non-blocking:
packages/core/src/motion/animator.ts:3028-3030: the comment limits the task-end rule to "a call made with" the option, but the branch reads the task mark's flag, so a plain call that shares the mark ends there too.docs/architecture/react-component-runtime.md:328-330: "Components import them statically" now reads as if "them" werecreateAnimator's options; "these modules" fixes it.packages/core/src/motion/animator.ts:92-94and:3008-3010: both still say a read other tasks delay keeps the browser's start; for a task with a'next-frame'call that read now moves the start (:3031), as the slow-first-frame case pins.
Claims and files checked
- Changeset: the touch animator takes an internal next-frame start for a call made in an input event's own task: verified (
animator.ts:303,:4532-4539,:4677-4684). - Changeset: such a call from rest starts at the first frame after that task in Chromium and WebKit: verified (
animator.ts:2843-2845,:3031; cases atanimator.test.ts:1318and:1334). - Changeset: a later listener's block delays the motion instead of skipping into it: verified by the seven option cases.
- Changeset: not exported from the package entry point: verified (
createAnimator's options have nostart; the engine is exported only from the internal touch entry). - Description: today the first frame after a block shows the motion skipped into its curve by about the block's length: consistent with the base start rules the tests exercise.
- Description: the first caller is the swipe row rebuild and no caller exists here: verified (no caller outside
animator.ts). - Description: a page's own frame callback can make the same call before a busy task, where the browser's start is right, while an input handler runs in its event's own task: consistent with
animator.ts:295-301and:2826-2834. - Description: the governing claims are touch motion advancing through a main-thread block and the runtime record's internal chosen start, which now names the option: verified.
- Description: the option sits beside
'commit'and'presented'; Chromium starts such a call at its first frame and WebKit reads the task's end at the call's first read: verified (animator.ts:303,:2843-2845,:3031). - Description: the calls made before the task's first microtask move together and a later call keeps its rule: verified (
animator.ts:2793-2798,:778-788; cases atanimator.test.ts:1380-1432). - Description: four commits on top of
main(the option, two record edits, one wording fix), and the earlier stack is onmainwith the engine factory renamed: verified. - Description: on
mainwith only the new cases, 7 of the 10 fail: verified by reading which cases depend on the option. - Description: suite totals, interaction proofs and the knowledge checks pass: not re-run here.
- Description: +269/-5 lines in 4 files, product code +53/-4: verified.
- Description: about +50 B app-level bytes: not re-measured.
- Description: no public API, no module or hook added, and Lab reaches the engine only through the internal touch entry: verified.
- Description: both merges of
mainare clean and leave the option's lines unchanged; the record commits change only records and the wording commit only comments and test titles: verified. - Files:
.changeset/animator-input-event-start.mdclear;docs/architecture/react-component-runtime.mdnon-blocking pronoun note;packages/core/src/motion/animator.test.tsclear;packages/core/src/motion/animator.tstwo non-blocking comment notes.
|
/approve-spec 9be9757 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft; it already carries ci:run, so CI runs once it is marked ready for review.
The internal start: 'next-frame' option sits under the runtime record's internal chosen start for touch motion that keeps advancing through a main-thread block, and the new INV13 sentence naming it is approved for this head. This push only merges main, and the option's own lines are unchanged.
Non-blocking:
packages/core/src/motion/animator.ts:3028-3030: the comment limits the task-end rule to "a call made with" the option, but the branch reads the task mark's flag, so a plain call that shares the mark ends there too.docs/architecture/react-component-runtime.md:329-330: "Components import them statically" now reads as if "them" werecreateAnimator's options; "these modules" fixes it.packages/core/src/motion/animator.ts:92-93and:3009-3010: both still say a read other tasks delay keeps the browser's start; for a task with a'next-frame'call that read now moves the start (:3031), as the slow-first-frame case pins.
Claims and files checked
- Changeset: the touch animator takes an internal next-frame start for a call made in an input event's own task: verified (
animator.ts:303,:4532-4539,:4677-4684). - Changeset: such a call from rest starts at the first frame after that task in Chromium and WebKit: verified (
animator.ts:2843-2845,:3031; cases atanimator.test.ts:1318and:1334). - Changeset: a later listener's block delays the motion instead of skipping into it: verified by the seven option cases.
- Changeset: not exported from the package entry point: verified (
createAnimator's options have nostart; the engine and its options type are exported only from the internal touch entry). - Description: today the first frame after a block shows the motion skipped into its curve by about the block's length: consistent with the base start rules the tests exercise.
- Description: the first caller is the swipe row rebuild and no caller exists here: verified (no caller outside
animator.ts). - Description: a page's own frame callback can make the same call before a busy task, where the browser's start is right, while an input handler runs in its event's own task: consistent with
animator.ts:295-301and:2826-2834. - Description: the governing claims are touch motion advancing through a main-thread block and the runtime record's internal chosen start, which now names the option: verified.
- Description: the option sits beside
'commit'and'presented'; Chromium starts such a call at its first frame and WebKit reads the task's end at the call's first read: verified (animator.ts:303,:2843-2845,:3031). - Description: the calls made before the task's first microtask move together and a later call keeps its rule: verified (
animator.ts:2793-2798,:778-788; cases atanimator.test.ts:1380-1432). - Description: four commits on top of
main(the option, two record edits, one wording fix), and the earlier stack is onmainwith the engine factory renamed: verified. - Description: on
mainwith only the new cases, 7 of the 10 fail: verified by tracing which cases depend on the option. - Description: every merge of
mainis clean, INV13 keeps thetimingnote beside the new sentence, and the option's lines are unchanged: verified. - Description: suite totals, interaction proofs and the knowledge checks pass: not re-run here.
- Description: +269/-5 lines in 4 files, product code +53/-4: verified.
- Description: about +50 B app-level bytes: not re-measured.
- Description: no public API, no module or hook added, and Lab reaches the engine only through the internal touch entry: verified.
- Files:
.changeset/animator-input-event-start.mdclear;docs/architecture/react-component-runtime.mdnon-blocking pronoun note;packages/core/src/motion/animator.test.tsclear;packages/core/src/motion/animator.tstwo non-blocking comment notes.
|
/approve-spec 2c412cb |
|
Decision: D-20261112-415 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft; it already carries ci:run, so CI runs once it is marked ready for review.
The internal start: 'next-frame' option falls under the runtime record's internal chosen start for motion that keeps advancing through a main-thread block, and the record sentence that names it is approved by an engineering owner for this head. Nothing blocks; three optional wording fixes remain:
- In
animator.ts, the comment aboveconst endedinstartAfterBlocksays the task ends at this read "for a call made withstart: 'next-frame'", but a plain call that shares the task mark ends there too; "when a call of the task asked forstart: 'next-frame'" says it exactly. - In INV13, "Components import them statically" now reads as if "them" were
createAnimator's options; "these modules" fixes it. - The module header and
startAfterBlock's doc still say a read that other tasks delay keeps the browser's start, but for a task with a'next-frame'call that read now moves the start, as the slow-first-frame case pins.
Claims and files checked
- Changeset: the internal option exists for a call in an input event's own task: verified in the option type and in
animateandplay. - Changeset: such a call from rest starts on the first frame after the task in Chromium and WebKit: verified in the two start rules and the unit cases that model each engine.
- Changeset: a later listener's block delays the motion instead of skipping it: verified by the seven option cases.
- Changeset: not exported from the package entry point: verified; only the internal touch entry exports the engine.
- Description: the first frame after a block shows the motion about a block's length into its curve today: consistent with the start rule's 34 ms threshold.
- Description: the swipe row rebuild in #8690 is the first caller: verified; nothing passes the option here.
- Description: the browser dates the start inside the block, while a page's own frame callback gets the right browser start: consistent with the engine's documented start rules.
- Description: the governing claims are touch motion advancing through a block and the runtime record's internal chosen start: verified.
- Description: the option moves the calls made before the task's first microtask together, and a later call keeps its rule: verified in the task mark and the same-task cases in both orders.
- Description: four commits beside clean merges of main, with the record and wording commits changing only records, comments and test titles: verified.
- Description: the merged custom-property channel and this change coexist, and the runtime record keeps main's notes beside the new sentence: verified.
- Description: seven of the new cases fail without the option and the file holds 274 cases: verified by trace and count; the suite tallies, browser proofs and bundle sizes were not re-run.
- Description: +269/-5 lines in four files and no public API, module or hook: verified.
- Description: scope checkboxes and writing rubric: verified.
- Files:
.changeset/animator-input-event-start.mdclear;docs/architecture/react-component-runtime.mdwording note;packages/core/src/motion/animator.test.tsclear;packages/core/src/motion/animator.tswording notes.
User impact
A touch motion started from rest by a key, a click or a tap should play from its start. Today a later listener of the same event can hold the main thread. The first frame after that block then shows the motion about 100 ms into its curve.
Its first caller is the swipe row rebuild, #8690.
Problem and solution fit
Expected behavior and authority
spec:AST-094FR5: touch motion keeps advancing at display rate through a main-thread block. The animator's start is an internal job:architecture:react-component-runtimeINV13 namesstart: 'next-frame'. #8690, where the swipe row's close lands, cites it inspec:AST-094FR6.Smallest restoration
The animator's internal
startoption gains'next-frame', beside'commit'and'presented'.The option marks the call's task: the calls made before its first microtask move together. A later call keeps its rule.
What this branch carries
Four commits on main: the option, two records, one wording fix. The rest of the earlier stack is on main: the public animator (#8653), pan (#8655) and snap-point drag (#8658), with
createMotionAnimatorrenamedcreateMotionEngine.Evidence
at, or one that continues motion, keeps its rule.animator.test.ts. Seven are red on main, and the four same-task cases are red with a per-call flag.Scope
Testing
This head,
2c412cbe13, merges main06b7e61f5einto9be9757ee1. That head merged main2311577561into03cae0f237, which merged main08b751a6df;fd01e7220abefore it merged5398a993c1into914b690aff. No merge has a conflict. Main's06b7e61f5eis #9720's squash, which also changesanimator.ts: it adds thecustomPropertychannel. The merged file keeps both changes, and this change's own lines are as they were. INV13 keeps main'stimingnote and #9720's gap entries beside this change's next-frame note.3d9c1ec10dandb252e3250echange only records, and914b690affonly comments and test titles. The suites ran at this head:animator.test.ts: 274 of 274 pass. On mainb6b0c68ad5with only the new cases, 7 of 274 fail. At the earlier head b6a3929, the four same-task cases fail (4 of 274).createAnimatorinteraction proofs, 1 worker: Chromium 28 pass; WebKit 21 pass and 7 skip. Each skip is atest.skipthe spec declares for that engine's driver.customPropertychannel, 1 worker: Chromium 4 pass, WebKit 4 pass.pnpm check:knowledgepasses, andpnpm review:prereports 0 findings.Public and internal API delta
Size: +269/−5 lines in 4 files (
06b7e61f5e..2c412cbe13); product code +53/−4.App-level bytes, gzip, React and StyleX left out, with this change's code measured on main
5398a993c1. The page has Button, Heading, Text, TextInput, Selector, DropdownMenu, MoreMenu, Popover, Tooltip, Dialog, BottomSheet and TabList. It loads 195,942 B up front on main and 195,992 B with this change (+50 B). With aListadded: 211,679 B and 211,728 B (+49 B).Public: none. The public animator,
createAnimator, does not take the option.Internal; no public entry exports it:
animateandplaytakestart: 'next-frame', beside'commit'and'presented'. Why: a call from an input event's own task then starts at the first frame after that task. A later listener that holds the page delays the motion instead of skipping it into its curve. No module or hook is added. The engine reaches Lab only through the internal./internal/touchentry, outside the public API.engine.animate({x: 0}, transition, {start: 'next-frame'})architecture:react-component-runtimeINV13 names the option, the motion it exists for, and that it stays internal.Writing rubric results
Records edited:
architecture:react-component-runtimeINV13: a sentence namesstart: 'next-frame'among the animator's internal jobs. It exists for motion an interaction starts in an input event's own task; on a busy page such motion starts on the first frame after that task, so it does not skip ahead.createAnimator's options do not have it, and no public entry exports it.Results: