Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewComponent Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual Regression55 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 35 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Changes requested: against main, this pull request carries #8076's whole unmerged chain, 22,516 changed lines across 127 files, while the progress module itself is 334 lines and fits spec:AST-094 FR3 and FR6. Please land the chain first, or rebase once it has landed, so the diff is progress.ts, its test and its changeset alone.
- Add a
progress.tsrow to the motion README's Files table, which the module's SYNC rule names, and replace the header's references torectMorph.tsand "laws M2, M3", neither of which exists in the repository. - Update the description:
presentedProgressVelocitytakes(animator, channels, now?), not(animator, property, from, to).
[Automated review]
| * progress per second; each channel's own velocity stays in the channel's | ||
| * units per second. | ||
| * | ||
| * An interrupted motion continues from what is on screen (laws M2, M3): the |
There was a problem hiding this comment.
"laws M2, M3" are not defined anywhere in the repository, and rectMorph.ts (line 12) does not exist yet. Citing spec:AST-094 FR6 ("A new target MUST keep the current velocity") names the rule this paragraph implements; the rect morph can be named once it lands.
| * (or one shared `at` for both calls); two calls from rest otherwise each | ||
| * start at their own commit. | ||
| * | ||
| * SYNC: When modified, update /packages/core/src/motion/progress.test.ts and |
There was a problem hiding this comment.
This SYNC rule names the motion README, but its Files table has no row for progress.ts; add one so the folder's map lists the module.
There was a problem hiding this comment.
Changes requested: against main, this pull request still carries #8076's unmerged chain, 21,772 changed lines across 120 files, while the progress module itself is 335 lines and fits spec:AST-094 FR3 and FR6. Please land #8076's chain first, or rebase once it has landed, so the diff is progress.ts, its test, its changeset and the README row alone. The README row, the header's references and the description's signature raised on the earlier head are fixed.
[Automated review]
There was a problem hiding this comment.
Changes requested: against main this pull request still carries #8076's unmerged chain, 21,781 changed lines across 117 files, while the progress module itself is 335 lines and fits spec:AST-094 FR3 and FR6. The chain's gesture host also predates DEC-8, now current on main: GestureHost.onScroll lets any scroll take an unclaimed touch without the 10 px take distance FR20 requires, and applyStyle writes the derived touch-action over the author's value instead of intersecting it as FR18 requires. Please bring the chain in line with DEC-8 and land it through #8076, then rebase so this diff is progress.ts, its test, its changeset and the README row alone.
[Automated review]
| }); | ||
| } | ||
|
|
||
| private readonly onScroll = (event: Event): void => { |
There was a problem hiding this comment.
spec:AST-094 FR20 (DEC-8, current on main) now counts a native scroll as the browser taking a touch only once that finger has moved the 10 px scroll take distance (FR2). This handler hands every unclaimed touch inside the scrolling container to browserTookOver on the first scroll event, so a still finger whose scroller moves loses its tap and click; the test at __tests__/GestureHost.test.ts lines 209–215 pins that. Gate it on the finger's own travel from where it went down, in #8076's chain.
| } | ||
| } | ||
|
|
||
| private applyStyle(element: HTMLElement, registration: Registration): void { |
There was a problem hiding this comment.
spec:AST-094 FR18 (DEC-8, current on main) now requires the derived touch-action to be intersected with the element's own author value and never wider than it. applyStyle writes gestureHostStyle(...) inline over the author's value, so a tap recognizer turns an author's pan-y into manipulation and hands back the pinch-zoom the author removed. Intersect with the computed author touch-action before writing, in #8076's chain.
There was a problem hiding this comment.
Changes requested: against main this pull request still carries #8076's unmerged chain, 20,447 changed lines across 119 files, while the progress module itself is 335 lines and fits spec:AST-094 FR3 and FR6. The chain also contradicts current specs: GestureHost.onScroll lets any scroll take an unclaimed touch without the 10 px take distance FR20 requires, applyStyle writes the derived touch-action over the author's value instead of intersecting it as FR18 requires, and useGestureRecognizer calls onGesture from an Effect when a node replacement or unmount cancels a gesture, against architecture:react-component-runtime INV2. Please fix these in #8076's chain and land it there, then rebase so this diff is progress.ts, its test, its changeset and the README row alone. The description also lists mapRange(value, from, to); the function is mapRange(input, output, {clamp}) and returns the map.
[Automated review]
There was a problem hiding this comment.
Changes requested: against main this pull request still carries #8076's unmerged chain, 20,170 changed lines across 120 files, while the progress module itself is 335 lines and fits spec:AST-094 FR3 and FR6. That chain also contradicts current specs, so please fix these in #8076 and land it there, then rebase so this diff is progress.ts, its test, its changeset and the README row:
GestureHost.onScrolllets any scroll take an unclaimed touch without the 10 px take distance FR20 (DEC-8) requires.applyStylewrites the derivedtouch-actionover the author's value instead of intersecting it, as FR18 requires.useGestureRecognizercallsonGesturefrom an Effect when a node replacement or unmount cancels a gesture, againstarchitecture:react-component-runtimeINV2.
[Automated review]
| ) { | ||
| return; | ||
| } | ||
| current?.detach?.(); |
There was a problem hiding this comment.
architecture:react-component-runtime INV2: this detach, like the unmount cleanup at line 247, runs the host's detach, which cancels a recognizer that is mid-gesture (GestureHost.ts line 342). cancelled reaches the listener at lines 75–79 synchronously and isSyncingRef is not set here, so the caller's onGesture fires from this Effect. Run the detach under isSyncingRef, as setEnabled is (lines 86–93), and add a mid-gesture unmount and replacement test, in #8076's chain.
…th its last marked element The touch-action writer records which elements it marked in each document or shadow root, and when the last one is unmarked (its last recognizer detached) it removes that root's adopted sheet or style element, so nothing touch-related remains after the last instance unmounts (spec:AST-094 FR24). A later mark writes the rules again; an element marked in another root first lets go of the old one.
… the inline style it reads - The motion registry, the host's engine gate and the README name the presented hit test as an engine workaround (spec:AST-013 FR6) with its review condition (re-measure on each iOS release; remove it once iOS WebKit hit-tests a compositor-moved element where it is drawn) and its regression fixture. - While a curve runs the animator holds the value it starts from inline, so presentation.ts and the README no longer say the inline style holds the end.
…core/internal/touch Core ships the internal entry @astryxdesign/core/internal/touch, which re-exports the gesture primitives for Astryx's own packages, and the Lab-import guard fails a Lab import of core outside core's exports (architecture:react-component-runtime INV13). The README and the barrel's header named internal workspace imports and said nothing here is exported; they now name that entry.
…ill needs the element, and the listeners that cancel The release note, the stream's header, the host's comment and the README said the stream is one passive listener per event type and that a document-capture stopPropagation no longer starves the recognizers. Such a stop never hid a listener on the same node, and some subscriptions cancel. They now say what changed: an app's window-capture stopPropagation, or a document-capture stopImmediatePropagation registered before core, no longer hides a touch; a recognizer that must claim still needs the touch to reach its element; the gesture host's touchend, click and contextmenu cancel while a claimer is attached and the page hold's touchmove while it holds; and the stream stays ahead of an app's window-capture listener only until a type's listener is re-added. The README's list of blocking touchmove listeners gains the claimed touch's target and the document while a claiming element moves.
…default it moves
The {stylexOptions} form of astryxStylex now passes StyleX
treeshakeCompensation: true unless the caller sets it. spec:AST-017 FR3
asks the release note to name the old and new default and the option
that restores the old one; it now does.
…er and for the two stops the input stream fixes - A still finger with sub-pixel jitter over a scroll view keeps its tap and scrolls nothing (spec:AST-094 FR18–FR22). - A tap is still recognized under an app's window-capture stopPropagation, and under a document-capture stopImmediatePropagation registered before core's: the recognizers hear touches on the window's capture phase. Chromium and WebKit pass.
…s once Where nothing that claims is attached, the host's touchend listener is passive and cannot cancel the engine's own click after a retargeted tap clicks what is drawn. The shared click guard swallows that late click whatever is attached; this case pins it, as asked on meta#8293.
…esture host's subscriptions The gesture host subscribes no click: the one cancelling click subscriber is the click guard's, added at a window's first arm and kept. The release note, the stream's header and the gestures README listed click with the host's touchend and contextmenu; they now name the guard's own.
Folds this pull request onto the canonical gesture foundation, meta#8360's head, which carries meta#8076, and onto main, in place of the old meta#8076 and harness copies it carried. The one conflict is the motion README's Files table: meta#8360's table, with this pull request's progress.ts row added after presentation.ts.
There was a problem hiding this comment.
Changes requested: the progress module itself looks right and fits spec:AST-094 FR3 and FR6, but against main this branch now carries #8360's whole open chain, 27,237 of its 27,572 changed lines. Please land #8360 first, then rebase so this diff is only progress.ts, its test, the changeset and the README row, and update the description, which still names #8076 and an earlier push. The gesture-host issues raised on earlier revisions (touch-action intersection, a scroll under a still finger, the teardown callback and the screen-edge band) are fixed in the carried code.
[Automated review]
Folds this pull request onto the canonical gesture foundation, meta#8360's head, which carries meta#8076, and onto main, in place of the old meta#8076 and harness copies it carried. The one conflict is the motion README's Files table: meta#8360's table, with this pull request's progress.ts row added after presentation.ts.
Folds this pull request onto the canonical gesture foundation, meta#8360's head, which carries meta#8076, and onto main, in place of the old meta#8076 and harness copies it carried. The one conflict is the motion README's Files table: meta#8360's table, with this pull request's progress.ts row added after presentation.ts.
Depends on #8360 (and its predecessors). Review only this PR's change: vjeux/astryx@cba0ad9...3c42849; the merges after take #8360's head and main.
Why
Motions that move several properties along one path, such as a popover growing out of its button while it fades in, all need the same four pieces of math. Each presentation had its own copy of them.
What led to it
This comes from the work to make Astryx's touch components behave as native iOS ones do (sheets, menus, gestures and their motion). The shared rect morph (#8329) needed these pieces; splitting them out keeps that pull request to the morph itself.
Options and tradeoffs
Why this choice
One unit everywhere is what lets an interruption continue instead of restart, and a separate module lets the presentations that follow a spring (a scrim's dim behind a sheet) use the same curve.
What changes
motion/progress.ts, internal, with:progressCurve(spring, {velocity, epsilon}): a spring's progress from 0 to 1 as a closed-form curve, exactly 1 once it settles;mapProgress(driver, f): a curve that follows another throughf;mapRange(input, output, {clamp}): the clamped linear mapfusually is;presentedProgressVelocity(animator, channels, now?): the velocity on screen, so an interruption continues rather than restarts.No component imports it yet; #8329's rect morph is its first caller.
How to check it
pnpm exec vitest run packages/core/src/motion/progress.test.ts.Evidence
Scope