Skip to content

feat(lab): RefreshControl draws UIRefreshControl's measured indicator - #8251

Draft
vjeux wants to merge 1938 commits into
meta:mainfrom
vjeux:uikit/c07-refresh-drawing
Draft

vjeux wants to merge 1938 commits into
meta:mainfrom
vjeux:uikit/c07-refresh-drawing

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #8175. Review only this PR's change: vjeux/astryx@2c7fc52...6b391ad

User impact

Part of making Astryx match iOS under a finger (spec:AST-094): #8175 added pull-to-refresh to Lab with a stand-in indicator. iOS's differs: larger spokes, a trail fading behind a clockwise head, springing in after the pull triggers. This PR draws iOS's on every touch device.

Options and tradeoffs:

  • Keep the stand-in: it reads as another control.
  • Animate iOS's drawing from script: it stalls on a busy page, as right after a pull.
  • One Web Animation per spoke (this PR): it keeps moving. Cost: at the trigger a copy of the spokes fades out over them (a glyph ::after would tick Chromium's main thread).

Visual authority

  • Existing component/module DD row reused or amended.
  • Durable component-local intent added to the optional Design decisions table by a team design owner.
  • Correction already settled by current family, design, theme, or objective accessibility authority.
  • New shared or cross-component direction settled in docs/design/.

Settled by spec:AST-094 FR1–FR4, with UIKit's measured values. Under Reduce Motion the trail applies at once (design:reduced-motion DR2, DEC-3).

Open with the owners: the brief copy (an INV7 exception), and the drawing under a fine pointer, which every pointer now pulls (FR43).

Before and after

Mobile Safari: the trigger, then a full pull:
The trigger cross-fade, close up
Pull, trigger, spin and end in Mobile Safari

UIKit, then this PR, mid-spring:
UIKit's refresh indicator Ours mid-crossfade in Mobile Safari

A 0.7 s busy script at the trigger, then mid-spin:
A main-thread block right after the trigger in Mobile Safari
A main-thread block during the spin in Mobile Safari

Android, then one turn in Chromium:
A pull on Android
Eight steps of the spin

State matrix

  • Forced colors: CanvasText. Right to left: not measured.
  • 8 elements at rest (50 before), 17 during the fade.

Size (import gzip, #8175 → head): JavaScript 55,841 → 56,413 B (+572), CSS 621 → 962 B (+341), lab.css 11,527 → 11,865 B (+338).

Scope

  • Appearance is the primary intent.
  • Behavior, API, interaction model, and unrelated layout changes were removed or split.
  • The evidence shows the changed pixels actively running, not only source or computed styles.
  • Public text and artifacts contain no internal Meta context.

Testing

What I ran and what it showed:

  1. RefreshControl story, iOS 26.2 simulator, pull and release: it matches UIKit's side by side and keeps moving through a 0.7 s busy script; on an Android emulator, at most one dropped frame.
  2. Reduce Motion on: the trail appears at once.
  3. Chromium tests replay both (the Reduce Motion one fails on the previous build), plus no layout or paint while it moves.
  4. Known red, not from this PR: touch-support-bundle's root and hooks cases, broken by fix(useScrollLock): keep the page where it is while an overlay is open #8098's page hold; test(core): a touch component's import carries its gesture code, and nothing else does #8671 rewrites that test per component.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 30, 2026 12:35am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 30, 2026, 12:51 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

New Components

RefreshControl (@astryxdesign/lab) · View in Storybook
Metric Value
Entry File (ESM) 430B
Lines of Code 1297
Source Files 8
Complexity Low (3)
Exports RefreshControl, useRefreshControl
Props Count N/A
Has Tests Yes
Has Stories Yes

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/AlertDialog 56.9KB 58.8KB +1.9KB 12.4KB 12.4KB 0B
core/AppShell 57.9KB 58.6KB +780B 11.6KB 11.6KB 0B
core/AvatarGroupOverflow 39.9KB 40.2KB +320B 6.4KB 6.4KB 0B
core/Banner 47.8KB 48.1KB +305B 9.9KB 9.9KB 0B
core/BaseTypeahead 54.3KB 54.6KB +264B 9.9KB 9.9KB 0B
core/BottomSheet 34.0KB 35.6KB +1.6KB 7.9KB 7.9KB 0B
core/BottomSheetSwitcher 14.8KB 16.5KB +1.7KB 3.3KB 3.3KB 0B
core/BreadcrumbItem 66.4KB 66.7KB +316B 11.0KB 11.0KB 0B
core/Button 43.3KB 43.6KB +287B 9.2KB 9.2KB 0B
core/Calendar 54.9KB 55.2KB +306B 10.0KB 10.0KB 0B
core/Carousel 50.2KB 50.5KB +340B 10.2KB 10.2KB 0B
core/ChatComposer 60.6KB 60.9KB +286B 10.8KB 10.8KB 0B
core/ChatComposerInput 55.7KB 56.0KB +279B 10.1KB 10.1KB 0B
core/ChatComposerTokenElement 55.7KB 56.0KB +279B 10.1KB 10.1KB 0B
core/ChatDictationButton 46.5KB 46.8KB +281B 9.5KB 9.5KB 0B
core/ChatLayout 48.8KB 49.1KB +289B 9.9KB 9.9KB 0B
core/ChatLayoutScrollButton 46.4KB 46.7KB +271B 9.6KB 9.6KB 0B
core/ChatSendButton 45.8KB 46.1KB +280B 9.2KB 9.2KB 0B
core/CheckboxInput 49.9KB 50.2KB +283B 9.3KB 9.3KB 0B
core/CheckboxListItem 54.0KB 54.3KB +253B 10.5KB 10.5KB 0B
core/ClickableCard 12.8KB 13.1KB +289B 6.9KB 6.9KB 0B
core/CodeBlock 60.5KB 60.8KB +292B 10.7KB 10.7KB 0B
core/Collapsible 11.7KB 12.0KB +291B 4.2KB 4.2KB 0B
core/CommandPalette 50.9KB 52.7KB +1.8KB 11.8KB 11.8KB 0B
core/CommandPaletteItem 8.4KB 8.7KB +280B 3.5KB 3.5KB 0B
core/ComplexSelector 55.8KB 56.1KB +330B 10.6KB 10.6KB 0B
core/ContextMenu 77.7KB 79.5KB +1.8KB 14.6KB 14.6KB 0B
core/ContextMenuItem 16.6KB 16.8KB +290B 5.2KB 5.2KB 0B
core/DateInput 99.9KB 101.7KB +1.8KB 14.8KB 14.8KB 0B
core/DateRangeInput 69.4KB 71.2KB +1.8KB 11.2KB 11.2KB 0B
core/DateTimeInput 110.1KB 111.9KB +1.8KB 15.2KB 15.2KB 0B
core/Dialog 16.2KB 17.9KB +1.7KB 7.1KB 7.1KB 0B
core/DialogHeader 48.8KB 49.1KB +294B 9.8KB 9.8KB 0B
core/Drawer 31.6KB 33.3KB +1.6KB 8.0KB 8.0KB 0B
core/DrawerHeader 48.9KB 49.2KB +265B 11.2KB 11.2KB 0B
core/DropdownMenu 72.7KB 73.0KB +301B 14.7KB 14.7KB 0B
core/DropdownMenuCheckboxItem 16.1KB 16.4KB +284B 5.6KB 5.6KB 0B
core/DropdownMenuItem 15.4KB 15.7KB +287B 5.2KB 5.2KB 0B
core/DropdownMenuRadioItem 16.2KB 16.5KB +275B 5.6KB 5.6KB 0B
core/DropdownMenuSubMenu 58.1KB 58.4KB +285B 9.5KB 9.5KB 0B
core/FileInput 54.1KB 54.4KB +269B 10.3KB 10.3KB 0B
core/IconButton 43.3KB 43.6KB +287B 9.2KB 9.2KB 0B
core/Item 11.4KB 11.6KB +273B 4.7KB 4.7KB 0B
core/LayerProvider 63.3KB 63.6KB +302B 10.1KB 10.1KB 0B
core/Lightbox 51.2KB 53.0KB +1.8KB 9.8KB 9.8KB 0B
core/Link 43.5KB 43.8KB +303B 7.6KB 7.6KB 0B
core/ListItem 53.5KB 53.7KB +274B 10.5KB 10.5KB 0B
core/Markdown 144.5KB 146.2KB +1.7KB 17.4KB 17.4KB 0B
core/MobileNav 51.0KB 51.8KB +802B 10.1KB 10.1KB 0B
core/MobileNavToggle 46.2KB 46.5KB +275B 9.4KB 9.4KB 0B
core/MoreMenu 72.9KB 73.2KB +297B 14.7KB 14.7KB 0B
core/MultiSelector 76.2KB 77.9KB +1.8KB 14.6KB 14.6KB 0B
core/NumberInput 55.7KB 56.0KB +282B 10.7KB 10.7KB 0B
core/Outline 28.6KB 28.9KB +306B 4.0KB 4.0KB 0B
core/Pagination 87.7KB 89.4KB +1.7KB 15.3KB 15.3KB 0B
core/Popover 49.8KB 50.1KB +260B 12.1KB 12.1KB 0B
core/PowerSearch 155.1KB 156.9KB +1.8KB 18.6KB 18.6KB 0B
core/RadioListItem 52.1KB 52.4KB +294B 9.7KB 9.7KB 0B
core/SegmentedControlItem 8.6KB 8.9KB +285B 3.9KB 3.9KB 0B
core/SelectableCard 12.8KB 13.1KB +294B 7.1KB 7.1KB 0B
core/Selector 79.1KB 80.9KB +1.7KB 15.0KB 15.0KB 0B
core/SelectorOption 14.5KB 14.8KB +251B 5.1KB 5.1KB 0B
core/SideNav 58.0KB 58.8KB +815B 10.6KB 10.6KB 0B
core/SideNavCollapseButton 46.6KB 46.9KB +258B 9.5KB 9.5KB 0B
core/SideNavHeading 54.7KB 55.0KB +264B 10.1KB 10.1KB 0B
core/SideNavItem 54.5KB 54.8KB +280B 10.1KB 10.1KB 0B
core/Step 32.4KB 32.7KB +296B 5.3KB 5.3KB 0B
core/Stepper 47.4KB 47.7KB +281B 9.6KB 9.6KB 0B
core/Switch 48.4KB 48.7KB +298B 9.3KB 9.3KB 0B
core/Tab 9.7KB 10.0KB +294B 4.1KB 4.1KB 0B
core/TabMenu 51.6KB 51.9KB +291B 10.0KB 10.0KB 0B
core/Table 84.0KB 85.7KB +1.7KB 15.1KB 15.1KB 0B
core/TableCell 78.8KB 80.5KB +1.7KB 14.8KB 14.8KB 0B
core/TableHeaderCell 78.6KB 80.3KB +1.7KB 14.8KB 14.8KB 0B
core/TableSelectionToolbar 52.4KB 52.6KB +291B 11.2KB 11.2KB 0B
core/TextInput 53.5KB 53.8KB +288B 10.5KB 10.5KB 0B
core/Thumbnail 50.7KB 50.9KB +290B 11.0KB 11.0KB 0B
core/TimeInput 86.8KB 88.7KB +1.9KB 13.8KB 13.8KB 0B
core/Timestamp 27.5KB 27.5KB +16B 9.5KB 9.5KB 0B
core/Toast 59.8KB 60.1KB +273B 9.7KB 9.7KB 0B
core/ToggleButton 44.1KB 44.4KB +257B 9.3KB 9.3KB 0B
core/Token 29.6KB 29.9KB +305B 4.5KB 4.5KB 0B
core/Tokenizer 64.8KB 65.1KB +322B 11.7KB 11.7KB 0B
core/TopNav 51.9KB 52.6KB +802B 10.4KB 10.4KB 0B
core/TopNavHeading 54.2KB 54.4KB +244B 9.9KB 9.9KB 0B
core/TopNavItem 9.0KB 9.3KB +283B 3.8KB 3.8KB 0B
core/TopNavMegaMenu 54.2KB 54.5KB +283B 10.8KB 10.8KB 0B
core/TopNavMegaMenuItem 9.1KB 9.4KB +281B 4.1KB 4.1KB 0B
core/TopNavMenu 53.6KB 53.9KB +274B 10.1KB 10.1KB 0B
core/TreeList 32.5KB 32.8KB +290B 4.7KB 4.7KB 0B
core/Typeahead 61.5KB 61.7KB +283B 11.3KB 11.3KB 0B
lab/RefreshControl N/A 55.1KB N/A N/A 962B N/A

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 Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
@astryxdesign/lab 4.8KB 1.9KB 2.0KB +76B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.6KB 0B
@astryxdesign/lab 11.1KB 11.6KB +492B

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

55 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 739,916
RichTextEditor Markdown parity: side by side probe dark 558,840
RichTextEditor Markdown parity: side by side probe light 540,756
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 35 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is on hold for an owner decision: its indicator values are marked proposed and pending owner review and rest on the draft spec:AST-094, which also amends the current theme-tokens record, user-states DR1 and AST-025 FR14 (its FR4, FR11 and FR14). An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request once the draft is approved as the governing spec for these values and those existing records are updated for its amendments (or the amendments are dropped), or by saying which claims or values must change; the author may do so if they are an engineering owner. Independently of that decision, please:

  • Split the branch: it carries 30,264 authored lines from the pull requests beneath it (#8045, #8074, #8062, #8098, #8175), so land those first, rebase, and leave only the 1,029-line drawing commit here.
  • Derive a controlled isRefreshing during render in useRefreshControl.ts (lines 677–684) instead of copying it into state from an Effect, so aria-busy is right on the first render, and name what the state-setting Effects synchronize.
  • Render the title outside the aria-hidden indicator in RefreshControl.tsx so screen readers can reach it.

[Automated review]

Comment on lines +677 to +684
useEffect(() => {
if (isRefreshingProp === undefined) {
return;
}
dispatch(
isRefreshingProp ? {type: 'begin', source: 'program'} : {type: 'end'},
);
}, [dispatch, isRefreshingProp]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A controlled isRefreshing only reaches state through this Effect (dispatch runs the begin effect, which calls setIsRefreshing(true) at line 527), so with isRefreshing={true} at mount the first render returns isRefreshing: false and RefreshControl paints no aria-busy, then repairs it on the next render. The repository's React runtime architecture (INV1) asks that a component never render a known-wrong state and repair it in an Effect, and INV3 asks each Effect to name what it synchronizes. Deriving the value during render when controlled keeps it right from the first render:

const isRefreshingNow = isRefreshingProp ?? isRefreshing;

The Effect can then stay for the inset, the spin attribute and the announcement, with a comment naming them.

Comment on lines +401 to +404
useEffect(() => {
setIsLocked(isScrollLockActive());
return subscribeScrollLock(setIsLocked);
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Effect copies the scroll-lock store into state without naming it (INV3 of the React runtime architecture). useSyncExternalStore(subscribeScrollLock, isScrollLockActive, () => false) would read the store during render and drop the Effect.

Comment on lines +562 to +564
{title != null ? (
<span {...stylex.props(styles.title)}>{title}</span>
) : null}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title renders inside the indicator, which is aria-hidden (line 548), so text such as “Updated just now” is visible during a pull or a refresh but never reaches a screen reader. Keeping the glyph hidden and rendering the title outside it, or folding it into the “Refreshing” announcement, keeps that information available to everyone.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is on hold for an engineering owner's decision: its RefreshControl indicator values are marked proposed and pending owner review, and they rest on draft spec:AST-094, which also amends the current theme-tokens, user-states (DR1, DR3), buttons, interaction-modality and AST-025 FR14 records. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request once the draft is approved as the governing spec for these values and those records are updated for its amendments (or the amendments are dropped), or by saying which claims or values must change; as an engineering owner, the author may do so. Independently of that decision, please:

  • Split the branch: it carries 30,366 authored lines from #8045, #8074, #8062, #8098 and #8175, and its copies of #8045 and #8074 are already older than those pull requests, so land them first and leave only the drawing here.
  • Put the @astryxdesign/core/motion/experimental and @astryxdesign/core/gestures/experimental exports behind a boundary AST-017 FR21 recognises (an owning component's /experimental subpath), or have FR21 amended to admit module-level subpaths.
  • Derive a controlled isRefreshing during render in useRefreshControl.ts (lines 677–684) so aria-busy is right on the first render, and name what the state-setting Effects synchronize.
  • Render the title outside the aria-hidden indicator in RefreshControl.tsx so screen readers can reach it.
  • Run the interaction proofs under an existing CI lane instead of the new self-routed pr-interaction job, as AST-030 FR11 requires.

[Automated review]

Comment thread scripts/sync-exports.js Outdated
@@ -72,6 +72,19 @@ const STATIC_EXPORTS = {
types: './dist/naming.d.ts',
default: './dist/naming.js',
},
// Experimental subpaths (spec:AST-017 FR21): outside the stable

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two subpaths are not a boundary spec:AST-017 FR21 recognises: it says experimental hooks, functions and types “use the owning component's /experimental import subpath”, and neither motion nor gestures is a component. Until an owner amends FR21 to admit module-level experimental subpaths, the next stable release would publish their 30 runtime exports and 53 types with no recognised experimental status, so FR25's compatibility default would apply despite the changesets' promise that they may change or be removed in a patch.

Comment thread .github/workflows/ci.yml Outdated

# The helper comes from the base, since an older PR head lacks it.
# Exit 1 means out of scope; 0 in scope; 2 unknown, so run.
- name: Check interaction scope

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step gives pr-interaction its own routing for coverage of components in existing packages. spec:AST-030 FR11: “New coverage inside an existing surface MUST join those owners and MUST NOT create a separately routed lane or required context.” Running the interaction proofs under the owning surfaces' existing lanes (or getting the lane admitted in AST-030) would keep CI routing to one owner per surface.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is on hold for an engineering owner's decision: its RefreshControl indicator values are marked proposed and pending owner review, and they rest on draft spec:AST-094, which also amends the current theme-tokens, user-states (DR1, DR3), buttons, interaction-modality and AST-025 FR14 records. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, or by saying which claims or values must change; as an engineering owner, the author may do so. Independently of that decision, please:

  • Split the branch: it carries 30,505 authored lines from #8045, #8074, #8062, #8098 and #8175, and its copies of #8045, #8074 and #8062 are already older than those pull requests.
  • Put the @astryxdesign/core/motion/experimental and @astryxdesign/core/gestures/experimental exports behind a boundary AST-017 FR21 recognises, or have FR21 amended to admit them.
  • Render the title outside the aria-hidden indicator, and derive a controlled isRefreshing during render so aria-busy is right on the first render.
  • Let the scroll-lock touch guard pass one-finger pans while the page is pinch-zoomed, so people who zoom in can still reach every part of an open dialog.
  • Remove the claim that a theme retunes triggerGradientSpring, and drop --motion-refresh-control-spin-ms unless the draft's FR4 is amended to allow it.
  • Run the interaction proofs under an existing CI lane (AST-030 FR11), and point AST-094 FR7 at a record that exists instead of AST-090.

[Automated review]

spinTiming: {
willChange: 'opacity',
animationDuration:
'calc(8 * var(--motion-refresh-control-spin-ms, 1000ms))',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing in the repository declares, documents or writes --motion-refresh-control-spin-ms; it appears only here and in RefreshControl.test.tsx. A theme that did set it would retune a touch motion, which this pull request's own draft spec:AST-094 FR4 forbids (“A touch presentation MUST read its motion from the table on every theme”). The docblock's “a theme that retunes refreshControl.triggerGradientSpring retunes it” (lines 24–27) is also not the case: the hook reads the spring from the constant table (useRefreshControl.ts:85). Unless FR4 is amended, consider going back to the table's period (a literal, or a private --_ variable written from refreshControl.spinMs) and correcting the docblock.

@vjeux vjeux Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both points depend on a theming path this branch already has, so I've left the docblock and the variable unchanged:

  • The spring. The hook passes the table's spring object to the animator, and the animator resolves a table spring against the theme each time a segment starts: animator.ts L1301–L1302, const resolved = resolveMotion(target, spring). So a theme that sets refreshControl.triggerGradientSpring does change this cross-fade. Passing the table constant is how a role is read.
  • The variable. refreshControl is registered as a motion table (refresh.ts L225), which makes refreshControl.spinMs a role. The generated motion docs list it with --motion-refresh-control-spin-ms (motion.doc.mjs L200–L201), and a theme that sets the role writes that variable.

Touch motion is retunable per theme (spec:AST-094 FR4 and DEC-3, #8378), so both stay as they are.

: 'cancel';
}
if (verdict === 'cancel' && event.cancelable) {
event.preventDefault();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cancels every one-finger pan that no scroller absorbs, and the guard never reads visualViewport.scale, so it also cancels the pan that moves a pinch-zoomed view. With a dialog open, someone who has zoomed in can still zoom but cannot pan to the dialog's header or actions (WCAG 2.2 SC 1.4.4), which the old body pin did not block. Consider letting the pan through while visualViewport.scale > 1, with a test beside the two-finger one.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spec:AST-090 record exists at this head or on main, so this departure (and the proposed amendment in Current-state impact, line 235) has nothing for its owners to rule on. Cite the record that holds those exit rules, or drop the departure.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is on hold for an engineering owner's decision: its RefreshControl indicator values are marked proposed and pending owner review and rest on draft spec:AST-094, whose FR4 and DEC-1 forbid retuning touch motion per theme, while this branch now adds theme motion roles that do exactly that. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or by saying which claims or values must change, including whether FR4 or the motion roles stand; as an engineering owner, the author may do so. Independently of that decision, please:

  • Split the branch: it carries 34,299 authored lines from #8045, #8074, #8062, #8098, #8086, #8175, #8257 and #8258 for a 1,589-line drawing.
  • Leave the platform adaptation condition and the --motion-* role tokens to #8257 and #8258 until AST-012 FR2 and theme-tokens INV1 admit them, and validate role ids instead of keying a stable defineTheme field by experimental table paths.
  • Put the two experimental core subpaths behind a boundary AST-017 FR21 recognises, or have FR21 amended to admit them.
  • Derive a controlled isRefreshing during render, render the title outside the aria-hidden indicator, and let the scroll-lock guard pass one-finger pans on a pinch-zoomed page.
  • Run the interaction proofs under an existing CI lane (AST-030 FR11), and point AST-094 FR7 at a record that exists instead of AST-090.

[Automated review]

* is everything else. Pair `ios` with `pointer: 'coarse'` for a touch
* profile, such as touch motion tuned per platform.
*/
platform?: 'ios' | 'other';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a fifth field to the adaptation conditions. spec:AST-012 FR2 lists width, pointer, contrast and motion and says “Future environment fields require explicit additions to this closed vocabulary”, so platform needs that amendment from the theme owners (with #8257) before it ships, or it should leave this branch.

Comment on lines +140 to +141
const registered = motionRole(id);
if (registered !== undefined && registered.kind !== kind) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An id that no table has registered passes this check and writes a --motion-* variable nothing reads, so a mistyped role, or one an experimental table renames in a patch, silently stops applying to a stable theme. Validating ids against the registered tables (or keeping role keys out of the stable defineTheme surface until the tables are stable) keeps theme authors from shipping motion settings that do nothing.


// Each spring, duration and curve above is a motion role a theme may retune
// (motion/roles.ts).
registerMotionTable('refreshControl', refreshControl, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registering refreshControl makes spinMs, triggerGradientSpring, triggerTurnSpring and endMs theme roles, while this pull request's own draft spec:AST-094 FR4 says “A touch presentation MUST read its motion from the table on every theme” and DEC-1 rejects tuning touch motion per theme. One of the two has to give; that is the owner decision this review waits on.

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
…ulator (page area only) and Chrome on Android (below its bar)
@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

@vjeux
vjeux force-pushed the uikit/c07-refresh-drawing branch from 5efe2d0 to 42b5675 Compare October 25, 2026 00:38
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 25, 2026
@vjeux

vjeux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Done in 42b5675, on #8175's split touch layer: the cross-fade passes no reduced-motion option and takes the animator's policy, and a browser test records the trigger's fades under Reduce Motion as opacity only, within 200 ms.

@vjeux
vjeux force-pushed the uikit/c07-refresh-drawing branch from 42b5675 to dfc87c7 Compare October 25, 2026 01:08
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
…ware GL), with meta#8251's drawing: a scroll area, and the page with no reload
vjeux added 24 commits October 29, 2026 10:08
…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.
jsdom serves no cross-origin sheet, so the catch around the indicator tests' stylesheet reader could only hide a real error.
…eencast delivered

A loaded machine's screencast skips frames the compositor still presents, so the proof no longer counts delivered frames against the screencast's cadence. As in the harness's busyWindowProof, every delivered frame must show the fade progressing, and a gap between two changed frames is measured between the compositor's own frames, recorded with startCompositorTrace. A fade driven from the main thread still fails it.
…he page presented

Two proofs failed on a loaded machine with no defect in the control:
- the busy-main-thread settle counted the screencast's delivered frames
  against its cadence. It now hands the compositor's own frame record to
  busyWindowProof, whose verdict alone judges the settle; a settle paused
  before the block fails it.
- the catch read the settle's position before the touch, which lands later
  under load. A capture listener now records where the settle stood as the
  finger landed; a catch that restarts from zero travel fails it.
@vjeux
vjeux marked this pull request as draft October 29, 2026 22:34

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is on hold for an engineering owner's decision: whether RefreshControl's trigger cross-fade may keep the copy of the spokes it makes itself as an exception to architecture:component-style-authoring INV7, recorded as an owner decision until Core's shared transient-copy mechanism exists, or must drop it. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request and saying where the exception is recorded, or by saying the copy must go; the author may do so as an engineering owner. Independently of that decision, please:

  • Land or drop #8175 and the stack beneath it and rebase onto main, so this pull request carries the 1,715-line drawing instead of 36,501 authored lines.
  • Make useRefreshControl's spinnerRef match its docs for custom indicators: it steps every child as one of eight spokes, so a one-child glyph vanishes for 125 ms of each turn and never passes 0.56 opacity.
  • Reach the animator and the motion helpers through @astryxdesign/core/internal/touch, as architecture:react-component-runtime INV13 says, or amend INV13 first.
  • Back the iOS Safari and Android Chrome claims with real-device evidence or narrow them to the simulator and emulator, and run the busy-thread proofs through the 1 s block that spec:AST-094's FR5 verification names.

[Automated review]

return;
}
const turnMs = refreshControl.spinMs;
spin.current = Array.from(glyph.children)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every child of the spinnerRef element gets spoke index's keyframes here, and line 473 clones every child at the trigger, so a custom glyph, which RefreshControl.doc.mjs:67 offers the hook for, is stepped as UIKit spokes: a one-child glyph runs 0, 0.56, 0.48 … 0.08 opacity, invisible for 125 ms of every turn. Step only the drawing's own spokes (a data attribute on the eight spans), or narrow the docs and the spinnerRef comment to an eight-spoke glyph.

spokeCopy.style.opacity = '1';
copy.append(spokeCopy);
}
glyph.append(copy);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appends a component-made copy of the spokes (a span and eight clones) for the 5.3 s fade, so the glyph holds 17 elements instead of 8. architecture:component-style-authoring INV7 allows a second copy only from one shared Core mechanism, and its gap clause covers only a layer's exit, presentation-switch and handoff copies and a reorderable collection's drag preview, so keeping it needs an engineering owner's recorded exception.

import {refreshControl} from '@astryxdesign/core/internal/motion';
import {scroll} from '@astryxdesign/core/internal/motion';
import {registerTimingTable, timing} from '@astryxdesign/core/internal/motion';
import {useAnimator} from '@astryxdesign/core/internal/motion';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

architecture:react-component-runtime INV13 routes the animator, the spring and curve helpers and UIKit's tables through @astryxdesign/core/internal/touch; importing them from internal/motion gives Lab a second internal route into the same modules. Re-export them from internal/touch and import them there, or amend INV13 first.

});
const cast = await startScreencast(page);
await page.waitForTimeout(150);
const block = await blockMainThread(page, 700);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec:AST-094's FR5 verification asks for an animation that keeps advancing through a 1 s main-thread block; this proof, and the cross-fade's at line 1937, block for 700 ms. Run both through 1 s.

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 30, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 30, 2026

This branch was successfully deployed

1 active deployment
Preview — 6b391ad7 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants