Repository navigation
chore(core): the motion and gesture internals that Lab's refresh pull reads - #9807
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested for one fix in the table-imports guard. The internal-entry re-exports, the refreshControl table and the new catalog key match the current specs.
isInternalEntryinpackages/core/src/motion/uikit/tableImports.test.ts(lines 60–62) exempts every.tsfile underinternal/, includingindicatorPress.stylex.ts,sheetDraft.tsanduseDismissSearchOnTouchDrag.ts, whichCheckboxInput,TokenizerBottomSheetandPowerSearchBottomSheetimport; please exempt only internal files no Core source imports (orinternal/touch.tsalone) and correct the JSDoc that says no Core source imports one.
Optional: the comment at internal/touch.ts:45 can drop its first sentence, which restates the export list (suggestion inline). When RefreshControl leaves Lab, its springs, reveal curve and durations will need motion roles under the touch-presentations spec (FR4).
[Automated review]
0ddf2dc to
d4832f8
Compare
There was a problem hiding this comment.
Ready to approve. The internal-entry re-exports, the refreshControl table and the new catalog key match the current specs, and the table-imports guard now exempts only internal files no Core source imports, which resolves the earlier comment on isInternalEntry.
- Optional: the
internal/touch.tsheader is now 21 lines, and its@outputstill describes only the gesture core's primitives; moving the new@inputtext into@outputkeeps it accurate (suggestion inline). - When RefreshControl leaves Lab, its springs, reveal curve and durations need motion roles named in its component record (touch-presentations FR4).
[Automated review]
| * @input The gesture core: the arena, the recognizers, and their geometry; | ||
| * the motion math and UIKit tables that Lab's RefreshControl reads; the | ||
| * page's scroll-style claims | ||
| * @output `@astryxdesign/core/internal/touch`: the gesture core's primitives |
There was a problem hiding this comment.
Optional (comment style): @output still describes only the gesture core's primitives, while the entry now also serves the motion math, UIKit tables, touch presentation hook and scroll-style claims, and the header is now 21 lines. Moving the new @input text here and keeping @input to what the file reads keeps the header accurate and shorter.
d4832f8 to
8537352
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft from a fork, so once it is marked ready for review, a maintainer adds the ci:run label so CI runs.
The internal-entry re-exports, the refreshControl table and the new catalog key match the current specs, and the table-imports guard exempts only internal files that no Core source imports.
- Optional: the
internal/touch.tsheader is 21 lines, and its@outputstill describes only the gesture core's primitives; moving the new@inputtext into@outputkeeps it accurate (see the earlier inline suggestion). - When RefreshControl leaves Lab, its springs, reveal curve and durations need motion roles named in its component record (touch-presentations FR4).
[Automated review]
8537352 to
01db4bf
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft from a fork, so once it is marked ready for review, a maintainer adds the ci:run label so CI runs.
The internal-entry re-exports (now including startsOnSelectableText), the refreshControl table and the new catalog key match the current specs, and the table-imports guard exempts only internal files that no Core source imports.
- Optional: the
internal/touch.tsheader is 21 lines, and its@outputstill describes only the gesture core's primitives; moving the new@inputtext into@outputkeeps it accurate (see the earlier inline suggestion). - When RefreshControl leaves Lab, its springs, reveal curve and durations need motion roles named in its component record (touch-presentations FR4).
[Automated review]
01db4bf to
5a45b8d
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft from a fork, so once it is marked ready for review, a maintainer adds the ci:run label so CI runs.
The internal-entry re-exports (now including lockDragSelection and selectionRangesOf), the refreshControl table and the new catalog key match the current specs, and the table-imports guard exempts only internal files that no Core source imports.
- Optional: the
internal/touch.tsheader is 22 lines, and its@outputstill describes only the gesture core's primitives; moving the new@inputtext into@outputkeeps it accurate (see the earlier inline suggestion). - When RefreshControl leaves Lab, its springs, reveal curve and durations need motion roles named in its component record (touch-presentations FR4).
[Automated review]
5a45b8d to
4a3074b
Compare
|
/approve-spec 4a3074b |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. This is a draft from a fork, so a maintainer adds the ci:run label, and marking it ready for review then starts CI.
The new names on Core's internal touch entry match the current specs for internal subpaths, and the new tests show that none of them reaches the public entry.
- Optional: two comments in
packages/core/src/internal/touch.ts(lines 45–47 and 56–57) restate the exports or a name, and the header's@outputstill describes only the gesture core's primitives; suggestions are inline.
[Automated review]
| // Lab's useRefreshControl reads these: its pull's pan and the hook that | ||
| // starts it. It also reads the motion animator, math and UIKit tables of its | ||
| // pull, settle and end. |
There was a problem hiding this comment.
Optional (comment style): after the colon, the comment lists the exports below it again. A version that keeps only the reason:
// Lab's useRefreshControl reads these.| // The animator's internal factory. The public one, `createAnimator`, plays | ||
| // only the theme's state-change motion. |
There was a problem hiding this comment.
Miss: optional (comment style): "The animator's internal factory." restates the name createMotionAnimator. A version that keeps only the reason:
// The public `createAnimator` plays only the theme's state-change motion.|
/approve-spec 263234f |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. This is a draft from a fork, so a maintainer adds the ci:run label so CI runs; marking it ready for review then starts the run.
The new names on Core's internal touch entry, including the two motion-role parsers, match the current specs for internal subpaths, and the new tests show that none of them reaches the public entry.
- Optional: in
packages/core/src/internal/touch.ts, the comments at lines 45–48 and 57–58 restate the exports or a name, and the header's@outputstill describes only the gesture core's primitives.
[Automated review]
| // Lab's useRefreshControl reads these: its pull's pan and the hook that | ||
| // starts it. It also reads the motion animator and math, and the scroll | ||
| // view's bounce spring, for its pull, settle and end. The motion-role | ||
| // parsers read the theme's tokens for its end. |
There was a problem hiding this comment.
Optional (comment style): after its first clause, this comment lists the exports below it again, and the new last sentence does the same for the parsers. A version that keeps only the reason:
// Lab's useRefreshControl reads these.263234f to
8db95c8
Compare
|
/approve-spec 8db95c8 |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #9865.
8db95c8 to
bbd153f
Compare
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #9865.
|
/approve-spec bbd153f |
… reads Core's internal touch entry re-exports, by name, what Lab's useRefreshControl imports: the pan recognizer, its hook and the gesture types; the motion animator; the cubic Bézier, the rubber band with its inverse and slope, and the map of a companion curve; the UIKit scroll table; and the motion-role parsers. Each one is an existing internal, and Core's behavior does not change. A bundle test checks that the public entry exports none of them.
bbd153f to
aaeeced
Compare
|
/approve-spec aaeeced |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #9865.
Internal entries land with their first user, per meta#8562. Lab's PageControl, NavigationStack and TabBar animate with Core's motion engine and read the touch presentation and the writing direction as Core does. `@astryxdesign/core/internal/touch`, which already carries the pan recognizer, its hook, the engine and the rubber band for Lab's refresh control (meta#9807), gains by name: - `useTouchPresentation` and `TOUCH_QUERY`, the finger-or-mouse decision in render and outside it; - `isRtlElement`, the writing direction a pan mirrors by; - UIKit's `UIKIT_GESTURES` table. The engine's factory is renamed from `createMotionAnimator` to `createMotionEngine` at its source and in every internal caller, with its types `MotionEngine` and `MotionEngineOptions` (the engine's `Animator` and `AnimatorOptions`), so the engine and the public `createAnimator` differ by more than one word (architecture:react-component-runtime INV13). Named re-exports of code already on main, plus that rename: no behavior changes, no public docs, no root re-export, and the `@astryx/no-core-internal-import` lint rule already limits the entry to Core and Lab. The entry's tests check it re-exports the same values Core imports by path and carries no public factory's name; the touch-support bundle test keeps every Lab-only name out of the root entry. One Lab module those components share comes with them: `internal/useMotionEngine`, a stable motion engine bound to an element through a callback ref. Lab's refresh control now uses it in place of its own identical `RefreshControl/useMotionAnimator.ts`.
Internal entries land with their first user, per meta#8562. Lab's PageControl, NavigationStack and TabBar animate with Core's motion engine and read the touch presentation and the writing direction as Core does. `@astryxdesign/core/internal/touch`, which already carries the pan recognizer, its hook, the engine and the rubber band for Lab's refresh control (meta#9807), gains by name: - `useTouchPresentation` and `TOUCH_QUERY`, the finger-or-mouse decision in render and outside it; - `isRtlElement`, the writing direction a pan mirrors by; - UIKit's `UIKIT_GESTURES` table. The engine's factory is renamed from `createMotionAnimator` to `createMotionEngine` at its source and in every internal caller, with its types `MotionEngine` and `MotionEngineOptions` (the engine's `Animator` and `AnimatorOptions`), so the engine and the public `createAnimator` differ by more than one word (architecture:react-component-runtime INV13). Named re-exports of code already on main, plus that rename: no behavior changes, no public docs, no root re-export, and the `@astryx/no-core-internal-import` lint rule already limits the entry to Core and Lab. The entry's tests check it re-exports the same values Core imports by path and carries no public factory's name; the touch-support bundle test keeps every Lab-only name out of the root entry. One Lab module those components share comes with them: `internal/useMotionEngine`, a stable motion engine bound to an element through a callback ref. Lab's refresh control now uses it in place of its own identical `RefreshControl/useMotionAnimator.ts`.
) * chore(lab): Lab's animator hook, over Core's internal touch entry Internal entries land with their first user, per #8562. Lab components, TabBar first, animate with Core's motion engine and read the touch presentation and the writing direction as Core does. `@astryxdesign/core/internal/touch`, which already carries the pan recognizer, its hook, the engine and the rubber band for Lab's refresh control (#9807), gains by name: - `useTouchPresentation` and `TOUCH_QUERY`, the finger-or-mouse decision in render and outside it; - `isRtlElement`, the writing direction a pan mirrors by; - UIKit's `UIKIT_GESTURES` table. The engine's factory is renamed from `createMotionAnimator` to `createMotionEngine` at its source and in every internal caller, with its types `MotionEngine` and `MotionEngineOptions` (the engine's `Animator` and `AnimatorOptions`), so the engine and the public `createAnimator` differ by more than one word (architecture:react-component-runtime INV13). Named re-exports of code already on main, plus that rename: no behavior changes, no public docs, no root re-export, and the `@astryx/no-core-internal-import` lint rule already limits the entry to Core and Lab. The entry's tests check it re-exports the same values Core imports by path and carries no public factory's name; the touch-support bundle test keeps every Lab-only name out of the root entry. One Lab module those components share comes with them: `internal/useMotionEngine`, a stable motion engine bound to an element through a callback ref. Lab's refresh control now uses it in place of its own identical `RefreshControl/useMotionAnimator.ts`. * Merge branch 'main' into c09/core-touch-entry-lab-animator Co-authored-by: Cindy Zhang <cindyxz@meta.com>
RefreshControl's Core part: internal re-exports only. Supersedes #8086. It lands right before its first user, Lab's pull to refresh.
Stack: #9807 → #9865
Maintainer impact
Lab's
useRefreshControlreads Core's pan recognizer, its hook and the motion engine through the internal touch entry. Lab reaches Core internals only through such entries.Intended invariant
No behavior change in Core: named re-exports only, with no gathering object, root re-export or docs. Lint allows the entry only in Core and Lab.
Change
internal/touch.tsre-exports exactly the 18 names that Lab's hook imports from it at #9865's head d511e52. Importing files are underpackages/lab/src/RefreshControl/:PanGestureRecognizergestures/PanGestureRecognizerRefreshPullRecognizer.tsPanGestureRecognizerOptionsgestures/PanGestureRecognizerRefreshPullRecognizer.tsGestureEventContextgestures/typesRefreshPullRecognizer.tsGestureTouchgestures/typesRefreshPullRecognizer.tsPointerKindgestures/typesRefreshPullRecognizer.ts,refreshTouchController.tsuseGestureRecognizergestures/useGestureRecognizerrefreshTouchController.tscreateMotionAnimatormotion/animatoruseMotionAnimator.tsMotionAnimatormotion/animatoruseMotionAnimator.tsMotionAnimatorOptionsmotion/animatoruseMotionAnimator.tsMotionCurvemotion/animatorrefreshTouchController.tscubicBeziermotion/bezierrefreshPull.ts,refreshTouchController.tsmapProgressmotion/progressrefreshTouchController.tsparseCssEasingmotion/rolesrefreshPull.tsparseMotionRoleValuemotion/rolesrefreshPull.tsrubberBandmotion/rubberBandrefreshPull.tsrubberBandInversemotion/rubberBandrefreshPull.tsrubberBandSlopemotion/rubberBandrefreshPull.tsscrollmotion/uikit/scrollrefreshTouchController.tsCheck: I parsed the export names of
internal/touch.tsat main 9a4627b and at this head. The 18 names it gains equal the 18 those files import; it drops none, and none was on main's entry.observeResizeis public (utils).Evidence
touch.test.tsfails against main's entry.Buttonis the control).Scope
Testing
Gates at this head, on main 9a4627b: typecheck, lint and
review:preclean; 1,795 unit tests pass. The bundle test passes, and its mutant fails.Overlap: #9669, #9696 and #9699 add some of these names; the later merge drops its duplicates. If #9754 lands first, the
createMotionAnimatorexport here takes its name,createMotionEngine.