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.
This needs an engineering owner's decision before it can be approved, and it also needs changes. Draft spec:AST-094 is the only spec behind the RefreshControl pull model and the gesture and motion code it builds on. An engineering owner can approve it by commenting /approve-spec 60bb893ee495917f66b54f61b0e04bd524b8af26 on this pull request (the author may do so as an engineering owner), or say which requirements must change. Independently of that decision:
- Please land the stacked predecessor pull requests (#8045 and #8052 through #8086) first, so this one carries only its own 672-line RefreshControl commit instead of the whole 25,000-line stack.
- Please keep
presentation="adaptive"and the default sub-menu drill-in on the shipped rule (a coarse pointer at 768px wide and below), since the new size rule swaps the surface on an iPad mini in portrait and a phone in landscape, which the Selector spec and the compatibility policy do not allow in a patch release. - Please fix AST-094 FR7, which cites
spec:AST-090, a record that is not in the repository.
[Automated review]
| // and large touch displays stay anchored, phones in either orientation get | ||
| // the sheet. The query is the shared touch presentation's | ||
| // (utils/touchPresentation.ts). | ||
| export const COMPACT_TOUCH_PRESENTATION_QUERY = COMPACT_TOUCH_QUERY; |
There was a problem hiding this comment.
This moves shipped presentation="adaptive" (and the default sub-menu drill-in, which reads the same constant) from (max-width: 768px) and (pointer: coarse) to the 744px/500px rule: an iPad mini in portrait loses the sheet and a phone in landscape gains it. The Selector spec keeps adaptive on its width-and-pointer query, and the patch changeset names no option that restores the old rule. Keep the shipped query here and let COMPACT_TOUCH_QUERY serve new touch presentations; the redefinition can land on its own with the spec amended.
| follows. | ||
| - **FR7 — Exits animate as UIKit's do.** A touch presentation MUST play the | ||
| exit its UIKit counterpart plays. **Proposed; pending owner review:** this | ||
| departs from the draft `spec:AST-090` FR1 (exits off by default) and FR10 |
There was a problem hiding this comment.
spec:AST-090 is not in the repository (neither main nor this branch has docs/specs/AST-090*), so the FR1 and FR10 this departs from cannot be read. Cite it once it lands, or drop the clause; the same applies to the Current-state impact bullet.
60bb893 to
79345fd
Compare
There was a problem hiding this comment.
This needs an engineering owner's decision before it can be approved, and it also needs changes. Draft spec:AST-094 is the only spec behind the RefreshControl pull model and the gesture and motion code beneath it, and its FR4 and DEC-1 say themes never retune touch motion while this branch adds theme motion roles; an engineering owner can approve the record as written by commenting /approve-spec 79345fd00b9921b4ee19479f4b313adb27bb8257 on this pull request (the author may do so as an engineering owner), or say which requirements must change. Independently of that decision:
- Please land the stacked predecessor pull requests first, so this one carries only its own 672-line RefreshControl commit instead of about 29,000 lines.
- Please keep
presentation="adaptive"and the default sub-menu drill-in on the shipped 768px rule, since the new rule swaps the surface on an iPad mini in portrait and a phone in landscape, which the Selector spec and the compatibility policy do not allow in a patch release. - Please correct
astryx docs motion, which says shipped sheets, menus and navigation read motion roles when none does, and makedefineThemereject unknown or misplaced role names. - Please fix AST-094 FR7, which cites
spec:AST-090, a record that is not in the repository.
[Automated review]
| - **FR4 — Physics are not themable in touch presentations.** A touch | ||
| presentation MUST read its motion from the table on every theme. Themes keep |
There was a problem hiding this comment.
FR4 (and DEC-1's "Rejected: tuning touch motion per theme" at line 271) says touch motion is never themable, but this branch adds defineTheme({motion: {springs, durations, curves}}), a platform adaptation condition, and an animator that resolves every spring and curve through the theme's --motion-* variables. One of the two has to change before an owner can approve this record as the authority for that code.
| const registered = motionRole(id); | ||
| if (registered !== undefined && registered.kind !== kind) { |
There was a problem hiding this comment.
The kind check only runs once a role's table is registered, and tables register when motion/uikit is imported, which @astryxdesign/core/theme never does. With only defineTheme loaded, springs: {'springs.sheetPresnt': …} and springs: {'timing.reducedMotionCrossFadeMs': …} are both accepted and write variables that nothing reads. Validating ids and kinds against a static role list (the generated table) and rejecting unknown ids would catch both; expandMotionRoles.test.ts imports the tables first, so it cannot see this.
| content: [ | ||
| { | ||
| type: 'prose', | ||
| text: 'On a touch screen, sheets, alerts, menus, navigation and scrolling play the springs, durations and curves measured from iOS. Each value is a motion role named by its table path, such as `springs.sheetPresent` or `timing.curves.easeInOut`. A theme retunes a role through `motion.springs`, `motion.durations` or `motion.curves`, at its root or in an adaptation rule; a role it leaves alone keeps its measured default.', |
There was a problem hiding this comment.
No shipped component reads a motion role yet: outside motion/ and gestures/, nothing in core or lab calls resolveMotion or the animator, so a theme that retunes springs.sheetPresent changes nothing on today's BottomSheet, menus or navigation. Saying that only touch presentations built on the experimental animator read roles, and that none ships yet, would keep the guide accurate (the same applies to "Components read the variable" at line 180).
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `presentation="adaptive"` on DropdownMenu, ContextMenu, MoreMenu, Selector and MultiSelector chooses the bottom sheet on a compact touch screen: a coarse primary pointer and a viewport narrower than 744px or shorter than 500px (it was 768px wide and below). An iPad mini in portrait keeps the anchored popover; a phone in landscape now gets the sheet. |
There was a problem hiding this comment.
On the base an iPad mini in portrait (744 × 1133, coarse pointer) gets the sheet, because (max-width: 768px) matches; with this change it gets the popover, so it does not "keep" the anchored popover. The note also leaves out the sub-menu drill-in, which reads the same query, and names no option that restores the 768px rule, which spec:AST-017 FR3 asks a default change's changeset to name.
79345fd to
bb5bf37
Compare
There was a problem hiding this comment.
This needs an engineering owner's decision before it can be approved, and it also needs changes. Draft spec:AST-094 is the only spec behind the RefreshControl pull model and the gesture and motion code beneath it, and its FR4 and DEC-1 say themes never retune touch motion while this branch adds theme motion roles and a platform condition that the closed when vocabulary of spec:AST-012 FR2 does not admit; an engineering owner can approve the record as written by commenting /approve-spec bb5bf37a99feada5613887645e2fdef85a5cffca on this pull request (the author may do so as an engineering owner), or say which requirements must change. Independently of that decision:
- Please land the stacked predecessor pull requests first, so this one carries only its own 672-line RefreshControl commit instead of about 30,000 lines.
- Please make the adaptive menus follow the active theme's
mdbreakpoint, asspec:AST-012FR9 requires and the release note promises, or say 768px in the note and the docs. - Please bring AST-094 FR8 to the opacity-only Reduce Motion fade of 200 ms or less that
design:reduced-motionDR2 requires, and drop the citations ofspec:AST-090, which is not in the repository. - Please correct
astryx docs motion, the theme-roles release note and thedefineThemeexample, which promise roles no shipped component reads, and makedefineThemereject unknown role names.
[Automated review]
| // and large touch displays stay anchored, phones in either orientation get | ||
| // the sheet. The query is the shared touch presentation's | ||
| // (utils/touchPresentation.ts). | ||
| export const COMPACT_TOUCH_PRESENTATION_QUERY = COMPACT_TOUCH_QUERY; |
There was a problem hiding this comment.
This reads DEFAULT_COMPACT_DEFINITION, so a theme that overrides adaptations.widthBreakpoints.md still switches at 768px, while spec:AST-012 FR9 measures "the effective md point" and the release note promises "the theme's md point". Building the query from the nearest theme's breakpoints (compactDefinition(points)) would close that; otherwise the release note and the hook docs should say 768px.
| ); | ||
| } | ||
| const registered = motionRole(id); | ||
| if (registered !== undefined && registered.kind !== kind) { |
There was a problem hiding this comment.
An id that no table registers passes this check, so a misspelled role (springs.sheetPresnt) or a retired one (timing.reducedMotionCrossFadeMs) writes a --motion-* variable that nothing reads, with no error, whatever has loaded. Validating ids and kinds against a static role list and rejecting unknown ids would catch both.
| '@astryxdesign/cli': patch | ||
| --- | ||
|
|
||
| [feat] Themes can retune touch motion. `defineTheme({motion})` takes `springs`, `durations` and `curves` keyed by motion role, the table path of a value touch presentations play (`springs.sheetPresent`, `timing.reducedMotionCrossFadeMs`), at the root or in an adaptation rule. A role the theme leaves out keeps its measured default, and the duration scale (`fast`, `medium`, `ratio`) is optional when a theme sets only roles. Adaptation rules gain a `platform` condition, `ios` or `other`. `astryx docs motion` lists every motion role with its CSS variable and default, and the theme authoring guide and template describe the new fields. |
There was a problem hiding this comment.
timing.reducedMotionCrossFadeMs is no longer a motion role (timing.ts excludes it, and reduced-motion-record.md says so), so this example points theme authors at a value they cannot retune.
| on: a transition that travels becomes a cross-fade carrying the same change | ||
| of state. An entrance lands in place and fades in, an exit fades out in | ||
| place, and any other move fades through. A navigation push or pop | ||
| cross-fades over 0.5 s on the ease-in-out curve; a sheet, a full-screen |
There was a problem hiding this comment.
design:reduced-motion DR2 (current) limits a touch transition under Reduce Motion to an opacity-only fade of 200 ms or less, and DR1 rules out springs; a 0.5 s cross-fade and fades on presentation springs contradict it, while the animator on this branch already plays 200 ms. Could FR8 follow DR2 and cite it?
| @@ -247,9 +255,15 @@ export interface DefineThemeInput { | |||
| * // Snappy: { fast: 100, medium: 250, ratio: 0.75 } | |||
| * // Default: { fast: 175, medium: 410, slow: 975, ratio: 0.75 } | |||
| * // Cinematic: { fast: 200, medium: 500, slow: 1200, ratio: 0.7 } | |||
| * | |||
| * // A softer sheet and a slower reduced-motion fade: | |||
There was a problem hiding this comment.
navigation.transitionMs paces completion callbacks rather than a Reduce Motion fade, and 300 is shorter than its 350 default; design:reduced-motion DR4 also says no theme value lengthens an animation under reduced motion. A comment that matches what the example does would avoid misleading theme authors.
bb5bf37 to
ccf1692
Compare
ccf1692 to
21d1405
Compare
There was a problem hiding this comment.
This needs an engineering owner's decision before it can be approved, and it also needs changes. No current spec governs the RefreshControl pull model or the touch foundation beneath it (spec:AST-094 is on neither main nor this branch), and the stable defineTheme motion roles have no spec while architecture:theme-tokens INV1 does not admit their --motion-* tokens; an engineering owner can approve this direction by commenting /approve-spec 21d1405e76b7eab0780924282fbe2aa68e5c6458 on this pull request (the author may do so as an engineering owner), or say which part must wait for AST-094 or leave this branch. Independently of that decision:
- Please land the stacked predecessor pull requests first, so this one carries only its own 670-line RefreshControl commit instead of about 30,600 lines, with the interaction harness and the build-plugin option in their own pull requests.
- Please give
refreshPull.tsan import path that@astryxdesign/coreexports before the RefreshControl export lands: its@astryxdesign/core/motion/*imports resolve only through Lab's tsconfig paths and test aliases. - Please fix the
defineThememotion example, which calls a 300 msnavigation.transitionMslonger than its 350 ms default.
[Automated review]
| import {cubicBezier} from '@astryxdesign/core/motion/bezier'; | ||
| import { | ||
| rubberBand, | ||
| rubberBandInverse, | ||
| } from '@astryxdesign/core/motion/rubberBand'; | ||
| import {refreshControl} from '@astryxdesign/core/motion/uikit/refresh'; |
There was a problem hiding this comment.
@astryxdesign/core does not export ./motion/*: these imports resolve only through Lab’s tsconfig paths (to core’s dist) and the Vitest alias, while Lab’s Babel build ships the bare specifiers. Once RefreshControl is exported from Lab’s entry, a published Lab that loads this module fails to resolve them wherever exports is enforced. Could this math come through an import path core exports, or stay inside Lab?
| * // A softer sheet, and a longer navigation transition (it paces | ||
| * // completion callbacks): | ||
| * motion: { | ||
| * springs: { 'springs.sheetPresent': { duration: 0.6, bounce: 0.1 } }, | ||
| * durations: { 'navigation.transitionMs': 300 }, |
There was a problem hiding this comment.
navigation.transitionMs defaults to 350 (motion/uikit/navigation.ts:62, and astryx docs motion lists 350ms), so 300 is a shorter transition, not a longer one. Could the comment say "shorter", or the example use a value above 350?
21d1405 to
4b7cb5d
Compare
meta#8076's new head carries main 70ea859 with meta#8073's writer of the press attribute on main's press controller, and its README names both writers. utils/pressFeedback.ts keeps that controller with this line's own changes on it: the pointer, drag, scroll and visibility listeners through the shared input stream (meta#8356) and touchcancel only while the primary pointer is coarse (meta#8270); the key path stays at the window's bubble phase, so a Space press the page cancels paints nothing. usePressTracker stays in its own module, one tracker for a component's life (meta#8315), so meta#8073's rebuilt-tracker hook and its test are not taken. The harness files are meta#8076's.
…s, and the action-group tracker writes its own The header and writePress called it the one writer of the press attribute, but main's action-group tracker writes its groups' presses itself. They now say what holds, as meta#8076's gestures README does.
…he press attribute The release note said every press painter writes data-astryx-press through one internal writer, but the action-group tracker (hooks/actionGroupTracker.ts) writes its groups' presses itself, as the gestures README and utils/pressFeedback.ts already say. The note now says paintPress writes every press it tracks and the action-group tracker writes its own.
…llowance under every primary pointer The useMenuPress record's FR9 puts the trigger's held finger under spec:AST-094 FR29 under every primary pointer (FR43), so a finger on a touchscreen laptop may drift 13 pt before the open, as on a phone. The trigger read (pointer: coarse) as its press started and took the long press's 10 px where the pointer was fine. Three cases fail until it does not: a 12 pt drift opens under a fine pointer too, a (12, 12) settle opens there, and nothing reads a pointer query, the trigger's press included.
…lowance under every primary pointer The useMenuPress record's FR9 governs the trigger's held finger by spec:AST-094 FR29 under every primary pointer (FR43). The trigger now hands the long press FR29's 13 px drift allowance whatever the primary pointer, so it no longer reads (pointer: coarse) as its press starts, and the menus drop their coarsePointer import. ContextMenu keeps the long press's own allowable movement. The changeset says the same.
Strict ESLint reported six unused bindings in files this pull request carries: the host's HAPTIC_SWITCH_ATTRIBUTE import, two unused imports in the pan's tests (scrollProbe, ScreenEdgePanGestureRecognizer), the swipe test's drift, the presented-hit-testing test's gestures, and a GestureHost test's before, which now asserts what it was read for: a second finger's moves leave the pan where it was.
…eal angular speed The release velocity of a rotation whose listener sets rotation = 0 on each change, at 2 degrees every 16 ms, read 4.363 rad/s against the 2.182 rad/s of the same stream without a re-base: the test asserted only more than 1.5. It now asserts the 2.18 rad/s (spec:AST-100 FR2), and fails.
The rotation's velocity tracker samples the raw unwrapped angle, which setting rotation does not move, so the setter's shift of the samples read each re-base as extra turn and doubled the release velocity of a listener that re-bases on every change. The setter no longer touches the tracker.
…mates while it runs The proof read the element's animations 230 ms in, after the dip had ended, and asserted only that every animated key is opacity, which an empty list passes: with the cross-fade removed from the plan (the move still landing), the proof still passed. It now reads the keyframe keys right after the call starts and asserts they include opacity and nothing else; the same mutant fails it. Chromium and WebKit pass. (F1's in-flight read from c648034.)
…roller, and its claimed moves are cancelled under pointer events Two comparisons stop at the shadow boundary, each failing a case: - once the host's listener on a recognizer's inner node has seen the finger, isFingerDownIn reads it as outside a light-DOM scroller around that root, so a scroll under it is not the finger's (FR20); - under inputMode 'pointer-events', a claimed pan on a shadow host cancels none of its finger's moves over the inner content, since the finger's target is the inner node and its touches reach the host retargeted (FR19).
…the flat tree isFingerDownIn and the pointer-events finger match compare with containsAlongFlatTree, as the scroll watch already does: a finger on content inside an open shadow root is down in the scroller around that root, and its touches, retargeted to the shadow host, match its pointer finger, so a claimed pan cancels its moves there (spec:AST-094 FR19, FR20).
…achments asks, and only then The host let the last attachment decide whether an element is an action group (useGestureRecognizer always passes the option), and never recomputed it at a detach: a plain attachment after the group's turned the group off, and a group's attachment released left a recognizer that never asked taking presses under a fine pointer. Fails until the host counts the attachments that ask.
…ents asks The host counts the attachments that pass actionGroup: true and keeps the element a group while one remains, recomputed at each detach. An attachment that passes false, as useGestureRecognizer does by default, no longer turns a group off, and a group's last asking attachment taking its leave ends the group.
… that content The presented hit test takes the document's elementFromPoint, which answers a shadow host for anything inside its open root, and compares with Node.contains, which stops at the boundary: a recognizer on a control inside a moving sheet's shadow root gets no finger, and the tap's click goes to the host. Fails until the hit test descends into open roots and compares along the flat tree.
Where a moving element is drawn away from its layout box, the host hit-tests what is drawn under the finger with the document's elementFromPoint, which answers a shadow host for anything inside its open root. The hit test now descends through each open root's own elementFromPoint and compares with the movers along the flat tree, so a recognizer on a control inside a moving sheet's shadow root gets its finger and the tap clicks that control.
…nt lets go The host's touch-action rules sit in an adopted sheet or a style element per document or shadow root, and were never removed, so a page whose last recognizer detached kept them, against spec:AST-094 FR24 (nothing touch-related remains after the last instance unmounts). Fails until a root's rules go with its last marked element.
…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.
There was a problem hiding this comment.
This needs a decision from an engineering owner, and it also needs changes. The refresh model fires while the finger is still down, keeps refreshing after the finger pulls back and settles without the release velocity, while spec:AST-094 FR36–FR38 ask a drag that commits an action to decide at the lift, cancel on a backward release and settle at the release velocity, exempting only the row swipe. An engineering owner records whether pull-to-refresh is exempt by commenting /approve-spec f2b0269481aa802ec21e579112f9977a42886bf9 on this pull request (the author may do so as an engineering owner, and FR36 then needs that exemption on main), or says that the model must follow FR36–FR38. Independently of that decision:
- Land the open predecessor pull requests and update this branch from
main, so it carries only the 670-line RefreshControl change instead of 28,474 authored lines. - The carried gesture host keeps recognizers inactive where the primary pointer is fine unless they opt in with
perEventPointer(GestureHost.ts:909-913), whilespec:AST-094FR19 and FR43 have gestures attach for every pointer.
[Automated review]
| case 'pullMove': { | ||
| // GUESS (M-RC3): a pull while refreshing counts from the inset. | ||
| const reach = state.isRefreshing | ||
| ? event.overscroll - REFRESH_HEIGHT | ||
| : event.overscroll; | ||
| if (!state.isPulling || state.hasTriggered || reach < event.trigger) { | ||
| return {state, effects: []}; | ||
| } | ||
| return { | ||
| state: {...state, isRefreshing: true, hasTriggered: true}, | ||
| effects: [{type: 'trigger'}], | ||
| }; | ||
| } |
There was a problem hiding this comment.
This commits the refresh on the finger-down move that reaches the trigger distance, and pullEnd (lines 92-100) only picks the settle target, so a pull pushed back before the lift still refreshes (refreshModel.test.ts:73-82) and no event carries a release velocity. Current spec:AST-094 FR36–FR38 ask a drag that commits an action to decide once at the lift from its projected travel, cancel on a backward release and settle at the release velocity, exempting only the row swipe. Either an engineering owner exempts pull-to-refresh (and FR36 records it on main), or the decision moves to the lift.
| private isActive(recognizer: GestureRecognizer): boolean { | ||
| return this.isCoarse || this.perEventRecognizers.has(recognizer); | ||
| } |
There was a problem hiding this comment.
Where the primary pointer is fine, this keeps every recognizer not attached with perEventPointer inactive, so nothing is installed for a mouse, a trackpad or a pen (lines 12-22). Current spec:AST-094 FR19 says “Recognizers attach for every pointer, with FR43's exceptions”, and FR43 has gestures attach for a mouse, a pen and a finger, with a pan taking wheel and trackpad scrolling. Could the host attach for every pointer within FR24's fine-pointer listener budget, or should FR19 and FR43 be amended on main first?
Depends on #8086. Carries #8562 (Core's internal entries) as a dependency; if the entries land differently, this follows her decision. Review only this PR's change: vjeux/astryx@1125110...f2b0269
Why
The lab RefreshControl has to move the content as iOS does: how much the pull resists, when the refresh fires, and what happens on release, at the end and on a second pull. Guessed numbers would make the pull feel off next to a native one.
What led to it
Part of the touch-presentations program (
spec:AST-094). #8086 added UIRefreshControl's measured values; this turns them into behavior, as pure code checked against UIKit's own frames, for the hook (#8171) and the component (#8175).Options and tradeoffs
Why this choice
Each value either matches UIKit's measured frames or is a labelled guess with a measurement task. The state machine is a pure reducer that returns effects: one trigger per pull, with the finger down and never from momentum; a pull while refreshing triggers again past the inset, as UIKit fires
valueChanged; a release settles onto the inset or back to the top; a programmatic begin calls the handler only for the user's request; a second end does nothing. Nothing is exported yet.How to check it
Run
refreshPull.test.tsandrefreshModel.test.ts. They replay every drag frame of two UIKit pulls on a 334 pt scroll view and check:Evidence
CodeBlockHeaderPlugin.test.tsxred on atest-uishard is the race test(richtext): the code block header tests wait for the copy button's tooltip #8569 fixes.Stack (merge in this order): #8360 gesture foundation (carries #8076) → #8086 refresh values → this PR → #8171 useRefreshControl (also needs #8098) → #8175 RefreshControl.