Skip to content

perf(core): SegmentedControl, Switch and BottomSheet load the touch animator after first paint - #11450

Draft
cixzhang wants to merge 38 commits into
mainfrom
perf/defer-touch-runtime
Draft

cixzhang wants to merge 38 commits into
mainfrom
perf/defer-touch-runtime

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Performance: the shared touch runtime leaves the first load of every page that imports a SegmentedControl or a Switch (the animator and the gesture host), a BottomSheet (the animator; its own drag code stays), or a TextInput, TextArea or NumberInput (the on-screen keyboard code), and loads once per page after first paint instead, as the owner decided: "I think we could defer load but not lazy load". It is not a bug fix (nothing was broken) or a new feature (no API changes), so the "other" template fits. This is the bottom of a stack: it lands the loader, the records and the tests, and follow-ups move the remaining static importers onto the same loader.

Fixes #13502: text fields no longer put the keyboard ride's motion code (keyboard/useMobileKeyboard, keyboard/keyboardTarget, motion/animator) in a page's first-load JS; it loads after first paint with the shared touch runtime. Thanks to @duytbp for the report and the measurement (+26,085 B gzip first-load JS on a FormLayout, TextInput and TextArea page from 0.7.16 to 0.7.17).

User or maintainer impact

  • People loading a page that imports one of these components download less JavaScript before first paint. At 5f67816, against main 3ad8639 (scripts/measure-reference-pages.mjs, gzip, 1 kB = 1,000 B): 44.2 kB less for a SegmentedControl, 37.5 kB for a Switch, 12.8 kB for a BottomSheet, 20.7 to 21.0 kB for a TextInput, TextArea or NumberInput, and 21.4 kB for the form reference page; the docs, menu and table reference pages change by under 0.3 kB. The rest of the stack (to perf(core): Slider's touch tracking comes with the touch runtime #11544) takes the remaining static importers behind the loader; each of those pull requests reports its own four-bundler numbers.
  • People on touch devices: until the runtime has loaded (first paint, then idle, at most 2 s after first paint), SegmentedControl and Switch work by taps, clicks and keys, with no drag tracking and no spring, and a tap under a finger or under Reduce Motion changes them at once, with no cross-fade; a press the browser cancels still selects nothing. A bottom sheet still drags; one dragged closed takes its normal stylesheet exit instead of the spring. A press already in flight when the load lands finishes that way, and the next press takes the touch path, so motion never switches mid-gesture. The static touch presentation (the lens, hit areas, coarse-pointer layout) does not change at the load, so nothing jumps.
  • A field focused before the load keeps the browser's own reveal: a TextInput, TextArea or NumberInput gets Core's keyboard handling only once its keyboard module has loaded, and a field in a bottom sheet does not ride the on-screen keyboard until then (spec:AST-099 Gap 22).
  • Builders: no API change.

Problem and solution fit

  • Why did first load grow? SegmentedControl, Switch and BottomSheet statically imported motion/animator and gestures/GestureHost, so every page rendering one of them shipped the touch runtime, even on desktop.
  • Why does that harm? It's bytes on the critical path (an app that adopted these components measured its largest contentful paint about 0.3 s later) for code a mouse user never runs, and that a touch user doesn't need before the page settles.
  • Why does a deferred load fit? The owner ruled out lazy-loading per interaction (an input never starts or hurries the load) and asked for one load per page after first paint. utils/touchRuntime.ts is that one loader. The touch hooks are unchanged: the loader's own module holds the shared core (the animator), which BottomSheet and the keyboard read at use time. SegmentedControl and Switch each hand the loader their own touch part, which mounts their unchanged touch hooks once loaded, so a page loads only the parts of the components it imports. TextInput, TextArea and NumberInput share one keyboard part (keyboard/keyboardFieldPart.tsx, through keyboard/useDeferredMobileKeyboard.tsx), which mounts the unchanged useMobileKeyboard once loaded; its options pass through unchanged.

Authority

  • spec:AST-080 DEC-5, amended by the owner (appended, existing text unchanged).
  • architecture:react-component-runtime INV13: the loader sentences, the before-load behavior per component, the page after a failed chunk, the verification row, and a gap line naming every module that still imports the touch modules statically at this head (AlertDialog, Toast, Popover, hooks/useActionGroupTracking, hooks/usePager, Lightbox, Resizable, Slider, SnapPaging, Chat, and the date and time fields' wheels). The follow-ups in the stack above remove their own names from it; AlertDialog's comes off in a separate follow-up.
  • architecture:component-import-boundaries INV8: the loader is the one import() of the touch modules, and of a component's touch part through it, at most once per page.
  • architecture:react-component-runtime INV13 (touch parts): the loader targets the shared core and the touch part a component hands it, the text fields' keyboard part included; every touch load goes through the one loader; motion/motionQueries.ts keeps the Reduce Motion policy's two media-query reads apart from the animator; verification row added.
  • spec:AST-099 Gap 22: a field focused before the load (TextInput, TextArea and NumberInput load their keyboard module with the touch runtime).
  • component:SegmentedControl FR3, FR9, FR10, FR13 and FR14, and component:Switch FR9, FR10, FR13 and FR15: each states its before-load behavior.
  • component:BottomSheet FR19: a drag-close before the load takes the stylesheet exit.
  • spec:AST-094 FR43 and FR44: the loader's input rule and the cancelled press before the load (verification row and failure column).

Change and evidence

At this head (scripts/measure-reference-pages.mjs, first-load JS minified / gzip, against main 59fd415):

Page Base Head Change
docs 234,123 / 76,674 234,213 / 76,688 +90 / +14
form 316,002 / 106,781 258,288 / 85,356 −57,714 / −21,425
menu 324,188 / 109,101 324,515 / 109,130 +327 / +29
table 357,064 / 121,262 357,969 / 121,571 +905 / +309
one TextInput 283,901 / 96,943 226,279 / 76,217 −57,622 / −20,726
one TextArea 264,837 / 90,310 207,212 / 69,472 −57,625 / −20,838
one NumberInput 297,848 / 102,115 240,157 / 80,976 −57,691 / −21,139
one Switch 327,524 / 107,929 209,267 / 70,346 −118,257 / −37,583
one SegmentedControl 311,072 / 100,200 167,162 / 56,236 −143,910 / −43,964
one BottomSheet 213,471 / 71,921 176,502 / 59,207 −36,969 / −12,714

The tables below are from earlier heads (ff55fb2 and before) and stay as the four-bundler record; a re-take of that matrix at this head is pending.

  • The keyboard part: keyboard/useDeferredMobileKeyboard.tsx registers keyboard/keyboardFieldPart.tsx with the loader (createTouchPart) and returns the element that mounts useMobileKeyboard once loaded; each field renders it inside its Field, so the field's own tree does not change.
  • motion/motionQueries.ts holds defaultPrefersReducedMotion and defaultIsCoarsePointer; the animator re-exports them. motion/reducedMotion.ts imported them from the animator, which brought the animator into BottomSheet's and the keyboard module's first load after the main merge.

A production app's own first-load estimator (an esbuild estimate, which can overstate what real bundlers ship; the four-bundler matrix below is the measure this PR claims) (esbuild, minify, splitting, sideEffects honored, first-load chunks gzipped as one stream; Core built from main and from this branch, each swapped into the app's node_modules), in gzip bytes for three whole routes:

Route main this PR all static importers deferred (counterfactual)
Embed view 1,198,161 1,188,165 (−10.0 KB) ~1,155,796 (−42.4 KB)
Document view 1,381,535 1,369,630 (−11.9 KB) ~1,337,056 (−44.5 KB)
List view 1,325,145 1,311,863 (−13.3 KB) ~1,279,900 (−45.2 KB)

The counterfactual stubs motion/animator and gestures/GestureHost, keeping every other importer. On main the remaining first-load importers are Toast/useToastGesture and Popover/popoverSurfaceMotion (all of the embed view's remainder), plus hooks/useActionGroupTracking, hooks/usePager, Lightbox and Resizable on the other two; the follow-ups take them in that order. Since #8373, AlertDialog's touch motion (AlertDialog/useAlertMotion) also imports the motion engine statically. INV13's gap line names it, and a separate follow-up PR at the top of this stack moves it behind the loader once its before-load record line is approved. These numbers predate it.

Reference pages, all four bundlers (first-load JS gzip, React, React DOM and StyleX external; this PR's head ff55fb2 against main c56d65a, Core built from each; KB = 1,024 B; chunks = first-load requests):

Page Vite 8 (Rolldown) Rolldown, inline common chunks off Rolldown, inline common chunks 64 KiB webpack 5
docs (Text, Heading, Link, Card, Divider, List) 65.4 → 65.4 KB, 1 → 1 (+22 B) 64.7 → 64.7, 1 → 1 (+20 B) 67.3 → 67.3, 2 → 2 (+19 B) 65.7 → 65.7, 1 → 1 (+1 B)
form (Button, IconButton, TextInput, CheckboxInput, Text, Heading, Card) 72.0 → 72.0, 1 → 1 (+14 B) 71.4 → 71.4, 1 → 1 (+31 B) 74.9 → 74.9, 3 → 3 (+17 B) 73.5 → 73.5, 1 → 1 (+28 B)
menu (DropdownMenu, ContextMenu, Button, Text) 99.2 → 99.8, 5 → 6 (+595 B) 98.6 → 99.2, 5 → 6 (+551 B) 105.1 → 105.1, 8 → 8 (+32 B) 101.4 → 101.4, 1 → 1 (−13 B)
table (Table, Text, Button) 109.6 → 110.0, 5 → 6 (+438 B) 109.1 → 109.5, 5 → 6 (+406 B) 115.9 → 116.1, 8 → 8 (+217 B) 111.4 → 111.4, 1 → 1 (−17 B)
one SegmentedControl 90.2 → 44.4, 1 → 1 (−46,953 B) 90.2 → 43.7, 1 → 1 (−47,540 B) 93.1 → 47.0, 1 → 3 (−47,213 B) 89.9 → 45.5, 1 → 1 (−45,450 B)
one Switch 97.6 → 61.3, 1 → 3 (−37,248 B) 97.0 → 60.6, 1 → 3 (−37,258 B) 100.5 → 64.7, 3 → 4 (−36,627 B) 99.7 → 61.7, 1 → 1 (−38,888 B)
one BottomSheet 62.9 → 52.1, 1 → 1 (−11,075 B) 62.9 → 51.4, 1 → 1 (−11,704 B) 65.0 → 53.8, 1 → 2 (−11,425 B) 62.5 → 52.2, 1 → 1 (−10,488 B)
ChatLayout 78.1 → 78.2, 1 → 1 (+77 B) 77.4 → 77.5, 1 → 1 (+32 B) 80.8 → 80.9, 3 → 3 (+119 B) 79.8 → 79.8, 1 → 1 (+8 B)

These match the numbers at 8369d6f within ±20 B. ChatLayout still carries the animator statically at this head (through modules INV13's gap line names); a page that uses only the shared runtime, such as one BottomSheet, carries about 42 B gzip of the touch-part code.

On every page and bundler, motion/animator, gestures/GestureHost and gestures/GestureArena stay out of the first load (lazy). Neither the menu nor the table page carries SegmentedControl's or Switch's touch part. On those two pages, the remaining +0.4 KB in Vite and Rolldown is Rolldown chunk-split glue, with no added Astryx code: with the touch runtime unreachable from those pages, they measure +127 B (menu) and +56 B (table) in five chunks. With it, the minified Astryx bytes are identical, and one group of six modules (utils/sharedRealm, utils/nodeType, utils/flatTree, motion/bezier, motion/roleValue, motion/roles) moves into its own chunk, because the animator's lazy entry reaches them. Before this head (the runtime held SegmentedControl's and Switch's touch code), the same pages grew by +1.6 KB and +2.4 KB in five to six more chunks.

Static first-load graph and pnpm size:pages at the previous head (093c9fc) are below; the touch parts change neither page's static graph.

Page size:pages minified / gzip at 093c9fc
docs +90 / +18
form +90 / +22
menu +1,594 / +299
table +2,065 / +237
  • The loader: utils/touchRuntime.ts schedules once per page from the first component that uses it: a frame, then a task after that paint, then requestIdleCallback with a 2,000 ms timeout (a 0 ms timer where the browser has no idle callback). It loads utils/touchRuntimeModules.tsx (the animator) and the touch parts of the components on the page (createTouchPart, which a component's module calls as it loads, and useTouchPart; a part registered after the page load starts loads at its first mount, never on an input), publishes through useSyncExternalStore (null on the server and at hydration), and swallows a failed chunk (the page stays on taps, clicks and keys).
  • motion/settleThreshold.ts holds SETTLE_THRESHOLD, so BottomSheet and motion/coast size a motion without importing the animator (coast imported nothing else from it, so it isn't in the gap list).
  • Bundle tests: scripts/lazy-sheet-bundle.test.mjs now finds the app's own entry chunk (main already carries the same fix for scripts/core-single-bundle.test.mjs): an import() target is an entry point too, and the first entryPoint they found became the loader's chunk. scripts/snap-paging-bundle.test.mjs counts motion/settleThreshold as motion code.

Static first-load graph (bundler-independent) at 093c9fc: the modules each reference page reaches through static imports, from this PR merged with main 88c4e0a, against that main:

Page Modules (base → head) Import depth (base → head)
docs 251 → 251 10 → 10
form 235 → 235 9 → 9
menu 267 → 267 8 → 8
table 635 → 637 (+2: the touch loader and one small helper) 12 → 12
one SegmentedControl 209 → 175 (−34) 9 → 9
one Switch 218 → 187 (−31) 10 → 10
one BottomSheet 160 → 157 (−3) 10 → 10

On a consumer app's production build (a different bundler): the touch runtime's gesture modules leave the static graph. The bundler still places them in one first-load chunk beside modules the page needs, so the home route's first load nets −9 KB gzip. With #11463 on top, the pair's measured effect on that app is in #11463.

Scope

Components: SegmentedControl, Switch, BottomSheet, TextInput, TextArea, NumberInput, keyboard (useMobileKeyboard, keyboardTarget, useDeferredMobileKeyboard, keyboardFieldPart), utils/touchRuntime, motion/settleThreshold, motion/motionQueries, motion/coast

  • This PR has one primary intent.
  • Independently removable deltas were removed or split (the other static importers are follow-ups).
  • Public text and artifacts contain no internal Meta context.

Testing

Red first, each failing on main:

  • utils/touchRuntime.boundary.test.ts: the SegmentedControl, Switch and BottomSheet entries reach neither motion/animator nor gestures/GestureHost statically, and the TextInput, TextArea and NumberInput entries reach neither those nor keyboard/useMobileKeyboard.ts (on main: TextInput.tsx → keyboard/useMobileKeyboard.ts, and the same for TextArea and NumberInput); the keyboard part loads only from keyboard/useDeferredMobileKeyboard.tsx, through the loader. On main it fails with SegmentedControl → useSegmentedSelectionMotion → motion/animator, useSwitchTouch → GestureHost, and BottomSheetPanel → motion/animator. Only the loader imports the runtime module, through import().
  • utils/touchRuntime.test.tsx: one schedule per page however many readers mount; nothing before first paint; idle with the 2 s cap; no input (pointerdown, touchstart, keydown, focusin) starts or hurries the load; a timer where there is no idle callback.
  • utils/touchRuntime.components.test.tsx: before the load, a Switch toggles by its click with no touch tracking (on main the touch path refuses that cancelled press). A press in flight at the load finishes by its click. After the load, the next press takes the touch path (spec:AST-094 FR44). A SegmentedControl selects by click before and after the load.

Also:

  • Suites that drive touch motion (SegmentedControl, Switch, BottomSheet, BottomSheetDragExit, keyboardTarget, keyboardTarget.guide, boxHold) and the fields' keyboard suites (TextInput, TextArea and NumberInput .keyboard.test.tsx) load the runtime in beforeAll.
  • At this head: the touch runtime, Switch, SegmentedControl, BottomSheet, keyboard, motion, TextInput, TextArea and NumberInput suites (2,595 tests), the bundle scripts (core-single-bundle, lazy-sheet-bundle, snap-paging-bundle, touch-support-bundle, gesture-free-entries, shared-identity), the core typecheck, check:knowledge and check:changesets pass.
  • utils/__tests__/touchRuntimeWindow.a11y.chromium.spec.ts (real Chromium, the runtime chunk held back by route interception, then let through): a mouse press that leaves a SegmentedControl selects nothing before the load, and a click selects after it; a finger tap whose click a caller vetoes selects nothing before the load; a bottom sheet flicked closed before the load leaves the screen and closes.
  • touchRuntime.components.test.tsx: a SegmentedControl press the browser cancels before the load selects nothing (AST-094 FR44's verification row); a finger tap's veto holds before the load and for a tap that is down when the runtime loads.
  • Switch, SegmentedControl, BottomSheet, keyboard, Chat and every Core test file that renders these components: 2,125 + 883 passed.
  • check:component-import-boundaries, check:knowledge, the core typecheck, and the bundle tests above all pass.
  • Real-device feel (an early tap or drag, a gesture across the load, steady state on iPhone and Pixel): no difference at 7f30a61; see Device evidence.

Shared identity (spec:AST-110 FR3)

The loader's module state (runtime, isScheduled, listeners in utils/touchRuntime.ts) is listed in the shared-identity baseline with a reason, which FR3 allows, rather than kept in a shared slot. spec:AST-110 lets "a module whose state only caches work" be duplicated. Each Core copy's components run on that copy's own animator and gesture modules; a shared slot would hand one copy's components another copy's runtime. The state is per-copy load bookkeeping, so the second copy's load costs one chunk and changes no result. The gesture counter is different: press arbitration is one per page across copies, so it stays in sharedState.

Writing rubric results

  • R1 present tense: pass; INV13, INV8, DEC-5's amendment and Gap 22 state what the system does.
  • R2 research: none in the records; the measurements are in this description.
  • R3 evidence: INV13's verification row names the loader tests.
  • R4 rejected alternatives: none added.
  • R5 change references: none in the records.
  • R6 open questions: none.
  • R7 project status: the remaining static importers are an INV13 gap line, not status.

Device evidence (DEC-31)

At 7f30a61, head against its merge base 38ea127: no difference in any cell outcome. A physical iPhone 14 (48 takes), a real Pixel 8 and the emulator N, S and R cells, covering SegmentedControl tap and drag-select, Switch tap and thumb drag, a bottom sheet's drag to close, and a field in a sheet riding the keyboard. A press made before the touch code loads takes effect at once through its click, as on main (14 to 69 ms for a segment and 19 to 122 ms for the switch on the emulator, head and base alike); the touch code then arrives 53 to 100 ms after the release, and nothing waits for it. A press made while the page is still loading takes effect at 138 to 381 ms, against 1,883 to 1,943 ms on main. The earlier heads' results below are kept for history: the emulator N, S and R cells, and on an iPhone 14 and a Pixel 8 the SegmentedControl, Switch, sheet-drag and field-in-a-sheet cells, each head against its merge base.

  • Emulator set on the device farm at head 9974c53: the N, S and R cells pass 5 of 5 each, on the first attempt, with no refusals or re-runs. The deferred touch runtime's chunk is seen loading on the head side. Real phones, head against its merge base: an iPhone 14 (iOS 26.2, Safari) and a Pixel 8 (Android 16, Chrome) behave the SAME for SegmentedControl tap and drag-select, Switch tap and thumb drag, a bottom sheet's drag to close, and a field in a sheet riding the keyboard. A tap right after load selects at both builds once the control has rendered; a timed Pixel follow-up found no tap lost after render at either build.

Number checked: main's AST-099 already has Gaps 13, 19 and 21 (from #9777 and others), so this PR's gap is Gap 22.

Owner and land path

Owner: the Astryx fix loop, lane 4. The records' /approve-spec is a consistency carry, posted per revision. Cindy last approved the deferral itself at 093c9fc, and she approves it again at the final head once the device set there finishes. #9777 has merged; this PR now carries its keyboard deferral too, as one mechanism. The strict preflight, the bundle scripts and the reference-page measure passed at 5f67816; the full device set at 7f30a61 (with #13480) found no difference in any cell outcome; then Cindy's re-approval at that head. Then the rest of the stack in order (#11463, #11466, #11476, #11478, #11508, #11518, #11525, #11530, #11536, #11540, #11544), each after Specs, CodeBunny at its head and green CI; the drain merges.

…component's static graph

SegmentedControl, Switch and BottomSheet no longer import the animator or the gesture host statically. One shared loader, utils/touchRuntime.ts, loads the touch runtime once per page after first paint, at idle within a 2 s cap, and never on an input (spec:AST-080 DEC-5, amended by the owner). Until it loads, these components work by taps, clicks and keys with no drag tracking or spring; a press in flight at the load finishes that way. SegmentedControl and Switch mount their unchanged touch hooks inside small runtime parts after the load. BottomSheet's drag exit takes the normal exit transition before the load. The keyboard ride needs the animator, so a field focused before the load keeps the browser's own reveal (AST-099 Gap 13). motion/settleThreshold.ts holds SETTLE_THRESHOLD so BottomSheet and coast size motion without the animator. Records: AST-080 DEC-5 amendment, react-component-runtime INV13 (loader, gap line for the remaining static importers), component-import-boundaries INV8 exception, AST-099 Gap 13. The bundle tests find the app's own entry chunk, since an import() target is an entry point too.
@vercel

vercel Bot commented Nov 13, 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 Nov 23, 2026 1:23am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 13, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 13, 2026
@astracat-bot

astracat-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 23, 2026, 5:02 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for splitting the touch runtime out of the first load. This can't be approved yet: it rewrites two current records, and the window before the runtime loads has defects that need fixing.

Waiting on an owner decision

  • Approval needs an engineering owner to approve the rewritten records (the static-import rule in the React component runtime record, the package-stylesheets touch decision, the import-boundaries exception and the new mobile-keyboard gap) by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner.
  • The window also contradicts the touch-presentation rules that gestures attach for every pointer and that a cancelled press does nothing, and SegmentedControl's rule that a mouse and a pen drag, none of which this pull request amends; an owner needs to scope them or change the window.
  • The desktop behavior change needs an owner decision: until the runtime loads, or for good after its chunk fails, a mouse can neither drag SegmentedControl's selection nor flip Switch by dragging, and a click no longer slides the selection.

Required fixes

  • Before the load, a mouse or pen press on another SegmentedControl segment selects it at pointerdown when focus is already in the group, so a cancelled press still changes the value (SegmentedControl.tsx:343-346); keep a press guard that works before the load and add that case to the component tests.
  • Before the load, a bottom sheet dragged closed keeps the drag's inline transform over the closing transform and stops where the finger left it until the exit times out (BottomSheetPanel.tsx:974-980); fold the loaded runtime into playedDragExit so the stylesheet exit runs.
  • The new INV13 gap list leaves out Slider, SnapPaging, Chat and the date and time fields, which still import the animator statically, so the record's new failure signal fails at this head.
  • The changeset says BottomSheet sheds its gesture code and drag tracking until the load, but its gesture modules stay in the first load and its drag still works, and the title promises that no component's static graph carries the runtime; narrow both to what changes.
  • SegmentedControl.test.tsx's slide test passes only after earlier tests let the real load finish and fails when run alone; load the runtime in beforeAll as the Switch and BottomSheet suites do.
  • utils/touchRuntime.ts and motion/settleThreshold.ts are new internal shared modules that no current record names; each needs an owner API decision.
  • touchRuntime.ts re-implements the shared module loader (createModuleLoader) and already differs from it by never retrying after a failed chunk; build the load on the shared loader.
  • SegmentedMotion's second layout Effect only copies selection into SegmentedControl's ref; use useCommittedRefInto instead.
  • The window is proven only in jsdom; the runtime record's verification asks for browser tests, so add interaction tests for a press and a sheet drag close before and after the load.
Claims and files checked
  • Changeset: SegmentedControl, Switch and BottomSheet no longer put the animator and gesture code in the first load — false for BottomSheet, whose graph still holds five gesture modules; true for the other two.

  • Changeset: Core loads them once per page after first paint, at idle — verified by the loader tests.

  • Changeset: until then the components work by taps, clicks and keys with no drag tracking — false: the sheet still drags, and a cancelled SegmentedControl press selects at pointerdown.

  • Changeset: a field focused in a bottom sheet keeps the browser's reveal — verified in the keyboard target code.

  • Description: about 10–13 KB gzip less per route — not verifiable from the pull request.

  • Description: the load waits for first paint, then idle, at most 2 s — verified by the loader tests.

  • Description: a press in flight at the load finishes by its click and the next press is tracked — verified for Switch; untested for SegmentedControl.

  • Description: no API change — verified by the API generator (no rows).

  • Description: the touch hooks are unchanged — verified (not in the diff).

  • Description: the gap line names the remaining static importers — false: Slider, SnapPaging, Chat and the date and time fields are missing.

  • Description: coast needed nothing else from the animator — verified.

  • Description: the bundle tests find the app's own entry chunk — verified (they pass).

  • Description: the boundary test fails on main with the named chains — consistent with main's import graph.

  • Description: suites that drive touch motion load the runtime first — incomplete: the SegmentedControl suite does not, and one of its tests fails alone.

  • Description: BottomSheet's drag exit takes the ordinary exit before the load — false: the sheet stops where the finger left it.

  • Description: the touched suites, typecheck and bundle tests pass — verified for the touched suites, the Core typecheck and the bundle tests; the full suite and the knowledge and boundary checks were not re-run.

  • .changeset/touch-runtime-after-first-paint.md — scope finding.

  • docs/architecture/component-import-boundaries.md — waits on spec approval.

  • docs/architecture/react-component-runtime.md — waits on spec approval; incomplete gap list.

  • docs/specs/AST-080-package-stylesheets/spec.md — waits on spec approval.

  • docs/specs/AST-099-mobile-keyboard/spec.md — waits on spec approval.

  • packages/core/src/BottomSheet/BottomSheet.test.tsx — clear.

  • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx — clear.

  • packages/core/src/BottomSheet/BottomSheetPanel.tsx — pre-load drag close finding.

  • packages/core/src/Indicator/boxHold.test.tsx — clear.

  • packages/core/src/SegmentedControl/SegmentedControl.tsx — pre-load press finding.

  • packages/core/src/Switch/Switch.test.tsx — clear.

  • packages/core/src/Switch/Switch.tsx — clear (desktop effect waits on the owner decision).

  • packages/core/src/keyboard/keyboardTarget.guide.test.ts — clear.

  • packages/core/src/keyboard/keyboardTarget.test.ts — clear.

  • packages/core/src/keyboard/keyboardTarget.ts — clear.

  • packages/core/src/keyboard/useMobileKeyboard.ts — clear.

  • packages/core/src/motion/animator.ts — clear.

  • packages/core/src/motion/coast.ts — clear.

  • packages/core/src/motion/settleThreshold.ts — needs a record.

  • packages/core/src/utils/getNodeText.test.ts — unrelated formatting (non-blocking).

  • packages/core/src/utils/touchRuntime.boundary.test.ts — clear.

  • packages/core/src/utils/touchRuntime.components.test.tsx — misses the pre-load SegmentedControl press case.

  • packages/core/src/utils/touchRuntime.test.tsx — clear.

  • packages/core/src/utils/touchRuntime.ts — needs a record; re-implements the shared module loader.

  • packages/core/src/utils/touchRuntimeModules.tsx — ref-copy Effect finding.

  • scripts/core-single-bundle.test.mjs — clear.

  • scripts/lazy-sheet-bundle.test.mjs — clear.

  • scripts/snap-paging-bundle.test.mjs — clear.

Automated review (maintainer link)

Comment thread packages/core/src/utils/touchRuntime.ts Resolved
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec b0e013b

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 13, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The rewritten records carry an engineering owner's approval at this head, so nothing waits on a spec decision, but the window before the touch runtime loads still has defects to fix before this can be approved.

Required fixes

  • Before the runtime loads, a mouse or pen press on another SegmentedControl segment selects it at pointerdown when focus is already in the group, so a press the browser cancels still changes the value (SegmentedControl.tsx:343-346); keep a press guard that works before the load and add that case to touchRuntime.components.test.tsx.
  • Before the load, a bottom sheet dragged closed stays drawn where the finger left it until its exit times out, because playedDragExit (BottomSheetPanel.tsx:974-980) ignores the missing runtime; fold the loaded runtime into it so the stylesheet exit runs.
  • The touch-presentation rules that gestures attach for every pointer and that a cancelled press does nothing, and SegmentedControl's rule that a mouse and a pen drag, still describe the behavior the window removes; amend them to name the window.
  • Miss: SegmentedControl's rule that every pointer's selection change slides is contradicted too, and the runtime record's touch-module rule and the package-stylesheets touch decision still say the modules are always present; amend or drop those lines.
  • The new gap line in the runtime record leaves out Slider, SnapPaging, Chat and the date and time fields, which still import the touch modules statically, so the record's own failure signal fails at this head.
  • The changeset says BottomSheet sheds its gesture code and drag tracking until the load, but its gesture modules stay in the first load and its drag still works, and the title promises that no component's static graph carries the runtime; narrow both to what changes.
  • touchRuntime.ts re-implements the shared module loader (createModuleLoader) and already differs from it after a failed chunk; build the load on the shared loader.
  • SegmentedMotion's second layout Effect only copies selection into SegmentedControl's ref; use useCommittedRefInto instead.
  • SegmentedControl.test.tsx's slide test passes only after earlier tests let the real load finish and fails when run alone; load the runtime in beforeAll, as the Switch and BottomSheet suites do.
  • The window is proven only in jsdom while the runtime record's verification asks for real-browser tests; add interaction tests for a press and a sheet drag close before and after the load.

The record that names the new settle-threshold and runtime modules is now in place, so that earlier point is resolved.

Claims and files checked
  • Changeset: SegmentedControl, Switch and BottomSheet no longer put the animator and gesture code in the first load — true for SegmentedControl and Switch; false for BottomSheet, whose import graph keeps five gesture modules.

  • Changeset: Core loads them once per page after first paint, at idle — verified in the loader code and its tests.

  • Changeset: until then the components work by taps, clicks and keys with no drag tracking — false: the sheet still drags, and a cancelled SegmentedControl press selects at pointerdown.

  • Changeset: a field focused in a bottom sheet keeps the browser's reveal — verified in the keyboard target code; no pre-load test.

  • Description: about 10–13 KB gzip less per route, more after the follow-ups — not reproducible from the pull request.

  • Description: the loader waits for a frame, a task, then idle with a 2,000 ms timeout or a 0 ms timer — verified in code and tests.

  • Description: the store reads null on the server and at hydration, and a failed chunk is swallowed — verified in code; a failed chunk is never retried.

  • Description: a press in flight at the load finishes by its click and the next press takes the touch path — verified for Switch by its test; untested for SegmentedControl.

  • Description: the static touch presentation does not change at the load — consistent with the code (the lens is hidden at rest); not checked in a browser.

  • Description: no API change — verified: the API comparison finds no changed rows.

  • Description: the touch hooks are unchanged — verified: they are not in the diff.

  • Description: the settle threshold moves out of the animator, and coast needed nothing else from it — verified.

  • Description: the bundle tests find the app's own entry chunk — verified; they pass.

  • Description: the boundary test fails on main with the named chains — consistent with main's import graph.

  • Description: suites that drive touch motion load the runtime first — incomplete: the SegmentedControl suite does not, and one of its tests fails alone.

  • Description: the gap line names the remaining static importers — false: Slider, SnapPaging, Chat and the date and time fields are missing.

  • Description: the import-boundary check, the knowledge check, the core typecheck and the bundle tests pass — verified; the touched suites pass too.

  • Description: the record changes are owner-approved amendments — verified: an engineering owner approved this head.

  • .changeset/touch-runtime-after-first-paint.md — scope finding.

  • docs/architecture/component-import-boundaries.md — clear.

  • docs/architecture/react-component-runtime.md — incomplete gap line; keeps "always-present".

  • docs/specs/AST-080-package-stylesheets/spec.md — keeps "always present" above the amendment.

  • docs/specs/AST-099-mobile-keyboard/spec.md — clear.

  • packages/core/src/BottomSheet/BottomSheet.test.tsx — clear.

  • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx — clear.

  • packages/core/src/BottomSheet/BottomSheetPanel.tsx — pre-load drag close finding.

  • packages/core/src/Indicator/boxHold.test.tsx — clear.

  • packages/core/src/SegmentedControl/SegmentedControl.tsx — pre-load press finding.

  • packages/core/src/Switch/Switch.test.tsx — clear.

  • packages/core/src/Switch/Switch.tsx — clear.

  • packages/core/src/keyboard/keyboardTarget.guide.test.ts — clear.

  • packages/core/src/keyboard/keyboardTarget.test.ts — clear.

  • packages/core/src/keyboard/keyboardTarget.ts — clear.

  • packages/core/src/keyboard/useMobileKeyboard.ts — clear.

  • packages/core/src/motion/animator.ts — clear.

  • packages/core/src/motion/coast.ts — clear.

  • packages/core/src/motion/settleThreshold.ts — clear.

  • packages/core/src/utils/getNodeText.test.ts — unrelated formatting (non-blocking).

  • packages/core/src/utils/touchRuntime.boundary.test.ts — clear.

  • packages/core/src/utils/touchRuntime.components.test.tsx — misses the pre-load SegmentedControl press case.

  • packages/core/src/utils/touchRuntime.test.tsx — clear.

  • packages/core/src/utils/touchRuntime.ts — re-implements the shared module loader.

  • packages/core/src/utils/touchRuntimeModules.tsx — ref-copy Effect finding.

  • scripts/core-single-bundle.test.mjs — clear.

  • scripts/lazy-sheet-bundle.test.mjs — clear.

  • scripts/snap-paging-bundle.test.mjs — clear.

Automated review (maintainer link)

…exit rules

A SegmentedControl press still keeps a focus move from selecting before the runtime loads, so a press the browser cancels selects nothing. A bottom sheet dragged closed before the load takes the stylesheet exit instead of staying where the finger let go. The loader builds its one load on the shared module loader, and SegmentedControl's motion hands its selection state over through useCommittedRefInto. Records: INV13 names every remaining static importer and drops 'always present'; AST-094 FR43 and SegmentedControl FR9 and FR13 name the pre-load window; FR44's verification row covers a press cancelled before the load. A Chromium spec holds the runtime chunk back to test the window. The changeset says what changes for each component.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 13, 2026
@cixzhang cixzhang changed the title perf(core): the touch runtime loads once after first paint, not in a component's static graph perf(core): SegmentedControl, Switch and BottomSheet take the touch runtime from a loader that runs after first paint Nov 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e5ad6c7

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the follow-up: the pre-load press guard for a mouse, the sheet's exit, the shared module loader and the record amendments address most of the last review. The record changes carry an engineering owner's approval at this head, so nothing waits on a spec decision, but the window before the touch runtime loads still has defects to fix before this can be approved.

Required fixes

  • Before the runtime loads, a finger tap on a SegmentedControl segment whose onClick calls preventDefault() still selects it when focus is already in the group, because the new guard ends at pointerup and a finger moves focus after the lift (SegmentedControl.tsx:346-365); keep the guard until the tap's click has run and add that case to the component and browser tests.
  • The new guard adds its own document pointerup and pointercancel listeners, while isPressInFlight() in Layer/gestureCounter.ts already reports whether a press is down and SegmentedControl's tooltip layer already installs it, so read that shared tracker instead.
  • Miss: the loader queues its idle step on the global setTimeout and then reads the global window (touchRuntime.ts:80-100), so a test file torn down in between ends the Vitest run with an unhandled ReferenceError (one of three runs of the changed suites); keep the window captured at scheduling and use its timers.
  • The approved pre-load sentence in the touch-presentation rule says no drag tracks before the load for every gesture, but BottomSheet's drag, and Slider's, Toast's and the other listed components', still track before it, so scope the sentence to SegmentedControl and Switch (with a fresh approval) or defer BottomSheet's drag too.
  • Miss: the runtime record's touch-module rule and the package-stylesheets amendment say every component that uses the runtime has no drag tracking before the load, which BottomSheet's drag contradicts, so fix them the same way.
  • The title still says the touch runtime is in no component's static graph, which the record's own gap list contradicts; "perf(core): SegmentedControl, Switch and BottomSheet load the touch animator after first paint" would fit.

CI has not run on this head yet (draft).

Claims and files checked

Claims:

  • About 10–13 KB gzip less first-load JavaScript per route: not reproducible here (measured in an outside app).
  • The runtime loads once per page after first paint, at idle within a 2 s cap, never on an input: verified (touchRuntime.ts:80-101, touchRuntime.test.tsx).
  • Until then the three components work by taps, clicks and keys with no drag tracking: false for BottomSheet, whose drag tracks before the load.
  • A press in flight at the load finishes by its click and the next press takes the touch path: verified for Switch (touchRuntime.components.test.tsx).
  • The static touch presentation does not change at the load: verified (the lens and hit-area styles do not depend on the runtime).
  • A field focused in a sheet before the load keeps the browser's reveal: verified (keyboardTarget.ts:496-501, :813-818).
  • No API change: verified (API report, 0 rows).
  • A failed chunk leaves the page on taps, clicks and keys: verified (touchRuntime.ts:71-78).
  • The settle-threshold module lets BottomSheet and coast size motion without the animator: verified (coast.ts imports only types from the animator).
  • The bundle tests find the app's own entry chunk: verified (the three bundle tests pass).
  • A SegmentedControl press cancelled before the load selects nothing: verified for a mouse; false for a vetoed finger tap.
  • The changed suites, the import-boundary check, the knowledge check and the Core typecheck pass: verified, with one of three suite runs ending on an unhandled error.
  • Changeset: SegmentedControl and Switch drop the animator and gesture host from the first load and BottomSheet drops the animator: verified (touchRuntime.boundary.test.ts); one load after first paint at idle: verified; taps, clicks and keys before it: verified except the vetoed finger tap; a sheet dragged closed takes its normal exit: verified (BottomSheetPanel.tsx:976-983); a focused field keeps the browser's reveal: verified.

Files:

  • SegmentedControl.tsx: vetoed finger tap; duplicate press tracker.
  • utils/touchRuntime.ts: global timer reads window after teardown; comment repeats the header.
  • utils/touchRuntimeModules.tsx, motion/settleThreshold.ts, motion/animator.ts, motion/coast.ts, Switch.tsx, BottomSheetPanel.tsx, keyboardTarget.ts, useMobileKeyboard.ts: clear.
  • docs/specs/AST-094-touch-presentations/spec.md: FR43 sentence too broad.
  • docs/architecture/react-component-runtime.md: INV13 "no drag tracking" too broad; the follow-up sentence is sequencing.
  • docs/specs/AST-080-package-stylesheets/spec.md: same "no drag tracking" wording.
  • docs/architecture/component-import-boundaries.md, docs/specs/AST-099-mobile-keyboard/spec.md, docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
  • .changeset/touch-runtime-after-first-paint.md: clear.
  • touchRuntime.test.tsx, touchRuntime.boundary.test.ts, touchRuntime.components.test.tsx, touchRuntimeWindow.a11y.chromium.spec.ts: clear; no test of a finger tap before the load.
  • SegmentedControl.test.tsx, Switch.test.tsx, BottomSheet.test.tsx, BottomSheetDragExit.test.tsx, boxHold.test.tsx, keyboardTarget.test.ts, keyboardTarget.guide.test.ts: clear.
  • scripts/core-single-bundle.test.mjs, scripts/lazy-sheet-bundle.test.mjs, scripts/snap-paging-bundle.test.mjs: clear.
  • utils/getNodeText.test.ts: unrelated reformat.

Automated review (maintainer link)

Comment thread packages/core/src/utils/touchRuntime.ts Resolved
Comment thread packages/core/src/utils/touchRuntime.ts Resolved
SegmentedControl's pre-load guard reads the shared gesture counter, which now also reports a press whose click is still to come, so a finger tap's focus move does not select before its click and a caller's preventDefault() still vetoes it; the component's own document listeners are gone. The loader's timers belong to the window it scheduled in. Records scope the before-load behavior per component: SegmentedControl and Switch have no drag tracking and no slide or spring, and a bottom sheet still drags and takes the stylesheet exit; DEC-5 gets Specs' per-component clarification.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 69c7909

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required checks have not run here, and the merge guard needs them green before merge.

The only commit since the last review is a clean merge of main, so the pull request's own changes are the ones approved before. The record changes carry an engineering owner's approval at this revision, and the unit, bundle, boundary and browser checks pass again here. The remaining wording notes stay open on their threads; none blocks.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none since the last review
  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test 10 of 10; one-component pages drop 44,258, 37,659 and 12,729 B gzip in the reference-page size report).
    • Changeset: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there: verified (boundary test; each page drops about 21 KB gzip).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:113-124; loader test 5 of 5).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (Chromium window spec 9 of 9; component test; frames with the touch chunks unavailable; useDeferredMobileKeyboard.tsx; keyboardTarget.ts:657, :1116).
    • Primary intent is performance with no API change: verified (the API surface generator lists no added, changed or removed row).
    • The per-component and form-page savings: verified against the base in the reference-page size report.
    • The ten-page first-load table: its deltas reproduce within 0.6 KB minified and 0.3 KB gzip; its absolute columns are measured against an older main, as the table says.
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base tree's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:73-99, :146-152).
    • The three fields share one keyboard part whose options pass through unchanged: verified (useDeferredMobileKeyboard.tsx, keyboardFieldPart.tsx).
    • The media-query split keeps the Reduce Motion policy off the animator: verified (motion/reducedMotion.ts imports motion/motionQueries.ts).
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts; coast keeps only type imports from the animator).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the two new motion modules: verified (the bundle tests pass).
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (the spec approval status succeeds for this revision, and an engineering owner approved it by comment).
    • The gap line names every module that still imports the touch modules statically: verified (a static-import sweep finds the same importers as at the last review; nothing merged from main adds one).
    • The production-app route table, the four-bundler matrix, the earlier static module counts and the consumer app's build: not reproduced (outside builds or earlier revisions); not contradicted.
    • The new tests fail on the base branch: verified by reading the base (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • The stated test counts: not reproduced at that scale; the touched suites pass 18 files and 573 tests, and the bundle and identity scripts 35 tests, on this revision.
    • Preflight, the Chromium window spec, the boundary and knowledge checks, the core typecheck and the bundle tests pass: verified for all but the full preflight, which was not run here.
    • The comment-provenance baseline drops the citation motion/animator.ts no longer carries: verified (the baseline check passes).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (shared-identity test 7 of 7 on the merged baseline; gestureCounter.ts keeps pressGesture in its shared state).
    • Real-device feel is booked: a plan, not evidence.
    • Device and emulator results are from earlier revisions with a re-take pending: stated; none of this revision's claims needs them.
    • The keyboard record's new gap number is free: verified (main lists Gaps 13, 19 and 21 and no Gap 22).
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: note (one-chunk failure sentence :355-357; part scope :361-362).
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: note (drag-row scope :1113).
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (matches the generator; its check passes).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: note (part-scope comment :50-51; sentence length :351-355).
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: note (part-scope comment :76).
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.ts: clear.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear.
    • packages/core/src/utils/getNodeText.test.ts: note (unrelated brace reformat).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: note (comment repeats the header :16-28).
    • packages/core/src/utils/touchRuntimeModules.tsx: note (part-scope header :10-12).
    • scripts/core-single-bundle.test.mjs: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (merged cleanly beside main's new entry).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records match the code; three comments and one INV13 sentence disagree with createTouchPart's comment on which parts a page loads.

Automated review (maintainer link)

@cixzhang cixzhang added ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) lane:4 Astryx fix-loop lane 4 owns this labels Nov 21, 2026
…pr11450-m2

# Conflicts:
#	docs/architecture/react-component-runtime.md
#	docs/specs/AST-094-touch-presentations/spec.md
#	packages/core/src/Layer/gestureCounter.ts
#	scripts/core-single-bundle.test.mjs
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c10393d

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required checks have not run here, and the merge guard needs them green before merge.

This revision merges main; each of its four conflicts keeps both sides, and the pull request's own changes are otherwise the ones approved before. The record changes carry an engineering owner's approval at this revision, and the unit, bundle, boundary and browser checks pass again here. The remaining wording notes stay open on their threads, and the description still lists the core bundle test among this pull request's changes although main now carries that fix; none blocks.

Claims and files checked

Review mode: full; reason: spec-record

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test 10 of 10; one-component pages drop 44,257, 37,669 and 12,729 B gzip in the reference-page size report).
    • Changeset: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there: verified (boundary test; each page drops about 21 KB gzip).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:113-124; loader test 5 of 5).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (Chromium window spec 9 of 9; component test; frames with the touch chunks unavailable; useDeferredMobileKeyboard.tsx; keyboardTarget.ts:657, :1116).
    • Primary intent is performance with no API change: verified (the API surface generator lists no added, changed or removed row).
    • The per-component and form-page savings at this revision: verified against the base within 0.3 KB gzip (the description measured against an older main).
    • The earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build): not reproduced (outside builds or earlier revisions); not contradicted.
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base tree's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:73-98, :146-152).
    • The three fields share one keyboard part whose options pass through unchanged: verified (useDeferredMobileKeyboard.tsx, keyboardFieldPart.tsx).
    • The media-query split keeps the Reduce Motion policy off the animator: verified (motion/reducedMotion.ts imports motion/motionQueries.ts).
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts; coast keeps only type imports from the animator).
    • The two bundle tests find the app's own entry chunk, and the pager pattern counts the new motion modules: verified (the bundle tests pass); at this revision the core bundle test's identical fix comes from main, so this pull request changes only the sheet bundle test.
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every component module that still imports the touch modules statically: verified (a static-import sweep finds no importer beyond the gap line, the opt-in constructors and the public layer the record already covers; nothing merged from main adds one).
    • The new tests fail on the base branch: verified by reading the base (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • The stated test counts: not reproduced at that scale; the touched suites pass 24 files and 811 tests, and the bundle and identity scripts 35 tests, on this revision.
    • Preflight, the Chromium window spec, the boundary and knowledge checks, the core typecheck and the bundle tests pass: verified for all but the full preflight, which was not run here.
    • The comment-provenance baseline drops the citation motion/animator.ts no longer carries: verified (the baseline check passes).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (shared-identity test 7 of 7; gestureCounter.ts keeps pressGesture in its shared state).
    • Real-device feel is booked: a plan, not evidence.
    • Device and emulator results are from earlier revisions with a re-take pending: stated; none of this revision's claims needs them.
    • The keyboard record's new gap number is free: verified (the keyboard record on main has no Gap 22).
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (48)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: note (one-chunk failure sentence :357-359; part scope :363-364).
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: note (drag-row scope :1113).
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (matches the generator; its check passes).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear (merged cleanly beside main's input-target tracking).
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: note (part-scope comment :50-51; sentence length :351-355).
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: note (part-scope comment :76).
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.ts: clear.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear.
    • packages/core/src/utils/getNodeText.test.ts: note (unrelated brace reformat).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: note (comment repeats the header :16-28).
    • packages/core/src/utils/touchRuntimeModules.tsx: note (part-scope header :10-12).
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; the identity test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records match the code; three comments and one INV13 sentence disagree with createTouchPart's comment on which parts a page loads.

Automated review (maintainer link)

Main's #9763 changed defaultPrefersReducedMotion to answer with
reducesMotion(); this branch moved that function to motion/motionQueries.ts,
so its new body is carried there by hand, with a unit test that fails on the
old body. reducedMotion.ts reads defaultIsCoarsePointer from motionQueries,
never the animator. AST-094 keeps this branch's FR44 row and BottomSheet
keeps both FR19 (this branch) and FR27 (main); the three records take the
repository's Prettier.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0723076

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required build, test and lint checks have not run here, and the merge guard needs them green before merge.

This revision merges main and carries its shared Reduce Motion decision into the split-off motion/motionQueries.ts, with a test that fails on the old body; the pull request's other changes are the ones reviewed before. The record changes carry an engineering owner's approval for this revision, and the unit, bundle, boundary and browser checks pass again here. One new non-blocking note asks that the defaultPrefersReducedMotion comment name the theme case it now answers for; the earlier wording notes stay open on their threads, and none blocks.

Claims and files checked

Review mode: full; reason: spec-record

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test; one-component pages drop 44,309, 37,685 and 12,779 B gzip in the reference-page size report built here).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code (useMobileKeyboard, keyboardTarget, the animator) there: verified (no static path from the three entries reaches them; each page drops about 21 KB gzip).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:113-125; loader test 5 of 5).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (Chromium window spec 9 of 9; component test 7 of 7; frames with the touch chunks unavailable; useDeferredMobileKeyboard.tsx; keyboardTarget.ts:657, :1116).
    • Primary intent is performance with no API change: verified (the API surface generator lists no added, changed or removed row).
    • The per-component and form-page savings in the description's first table: verified within 0.35 KB gzip against the base (the description measured against an older main).
    • The earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build): not reproduced (outside builds or earlier revisions); not contradicted (the static module deltas match).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:87-99, :146-150).
    • The three fields share one keyboard part whose options pass through unchanged: verified (useDeferredMobileKeyboard.tsx, keyboardFieldPart.tsx).
    • The merge carries main's new Reduce Motion body into motionQueries.ts, the policy module reads the coarse-pointer query there, and the new test fails on the old body: verified (motionQueries.ts:23-25, reducedMotion.ts:48, motionQueries.test.ts; by reading, the old body never calls the shared decision).
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts; coast keeps only type imports from the animator).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the new motion modules: verified (the bundle tests pass); the core bundle test's fix now comes from main, so this pull request changes only the sheet bundle test.
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically: verified (a static-import sweep finds no importer beyond the gap line, the opt-in constructors and the public touch layer).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • The stated test counts: not reproduced at that scale; the touched suites pass 91 files and 2,881 tests, and the bundle and identity scripts 35 tests, on this revision.
    • Preflight, the Chromium window spec, the boundary and knowledge checks, the core typecheck and the bundle tests pass: verified for all but the full preflight, which was not run here.
    • The comment-provenance baseline drops the citation the moved comment no longer carries: verified (the baseline check passes).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (shared-identity test 7 of 7; gestureCounter.ts keeps pressGesture in its shared state).
    • Real-device feel is booked: a plan, not evidence.
    • Device and emulator results are from earlier revisions with a re-take pending: stated; none of this revision's claims needs them.
    • The keyboard record's new gap number is free: verified (the keyboard record on main has no Gap 22).
    • Writing-rubric results: consistent with the records, except that the present-tense line names Gap 13 for the keyboard gap this change adds as Gap 22.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: note (one-chunk failure sentence :357-359; part scope :363-364).
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: note (drag-row scope :1117).
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear (FR19, plus table re-padding of the row main added).
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: note (part-scope comment :50-51; sentence length :351-355).
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: note (part-scope comment :76).
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: note (the Reduce Motion read's comment :16-22 omits the theme case).
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9).
    • packages/core/src/utils/getNodeText.test.ts: note (unrelated brace reformat).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: note (comment repeats the header :16-28).
    • packages/core/src/utils/touchRuntimeModules.tsx: note (part-scope header :10-12).
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; the identity test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records match the code; three comments and one INV13 sentence disagree with createTouchPart's comment on which parts a page loads.

Automated review (maintainer link)

… comments and records

The touch parts load on a page that imports their component; a failed chunk
leaves its own components as they are; the Switch and SegmentedControl rows
land at once only under a touch presentation; defaultPrefersReducedMotion
names the theme case; two comments lose a repeat of the file header.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0baab7d

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required build, test and lint checks have not run here, and the merge guard needs them green before merge.

This revision folds the last review's wording notes into five comments and two record sentences, changes no code, and carries an engineering owner's approval for its record changes. The unit, boundary, bundle and Chromium window checks pass again here, and the public API is unchanged. Three notes remain, none blocking: the touch-runtime record still says a page loads the parts its components "use" where the code now says "imports", one unrelated test reformat rides along, and a few description lines are stale (the keyboard gap's number, the core bundle test, and the owner's approval status).

Claims and files checked

Review mode: full; reason: spec-record

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test; a static-import walk from the three entries reaches neither module).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code (useMobileKeyboard, keyboardTarget, the animator) there: verified (the walk from the three entries reaches none of them).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:105-117; loader test).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (component test; Chromium window spec 9 of 9; frames with the touch chunks failing; BottomSheetPanel.tsx:1008-1016; keyboardTarget.ts:657, :1116).
    • Primary intent is performance with no API change: verified (the API surface generator lists no added, changed or removed row in any published package).
    • The per-component and form-page savings in the description's first table: verified within 0.35 KB gzip against the base (the description measured against an older main): one SegmentedControl −44,309 B, Switch −37,685 B, BottomSheet −12,779 B, each text field about −21 KB and the form page −21,517 B in the reference-page size report rebuilt here.
    • The earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build): not reproduced (outside builds or earlier revisions).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx:341 and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:79-91, :138-144).
    • The three fields share one keyboard part whose options pass through unchanged: verified (useDeferredMobileKeyboard.tsx, keyboardFieldPart.tsx); useMobileKeyboard keeps its signature, and its body now reads the animator from the loader, as the description's preceding sentence says.
    • The Reduce Motion read moves into motionQueries.ts with main's shared decision, the policy module reads the coarse-pointer query there, and the new test checks it: verified (motionQueries.ts:24, reducedMotion.ts:48; the test passes).
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts; coast keeps only type imports from the animator).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the new motion modules: verified (the bundle tests pass); the core bundle test's fix now comes from main, so this pull request changes only the sheet bundle test.
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically: verified (a static-import sweep finds no importer beyond the gap line, the opt-in constructors and the public touch layer).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • The stated test counts: not reproduced at that scale; the touched suites pass 93 files and 2,912 tests, and the bundle and identity scripts 35 tests, on this revision.
    • Preflight, the Chromium window spec, the boundary and knowledge checks, the core typecheck and the bundle tests pass: verified for all but the full preflight, which was not run here.
    • The comment-provenance baseline drops the citations the moved comment no longer carries: verified (the baseline check passes).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (shared-identity test 7 of 7; gestureCounter.ts keeps pressGesture in its shared state).
    • Real-device feel is booked: a plan, not evidence.
    • Device and emulator results are from earlier revisions with a re-take pending: stated; none of this revision's claims needs them.
    • The keyboard record's new gap number is free: verified (the keyboard record on main has Gaps 13, 19 and 21 and no Gap 22).
    • Writing-rubric results: consistent with the records, except that the present-tense line names Gap 13 for the keyboard gap this change adds as Gap 22.
    • Owner and land path: stale; an engineering owner has approved this revision's records.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: note (part scope :363-364).
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: clear.
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: clear.
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: clear.
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: clear.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9).
    • packages/core/src/utils/getNodeText.test.ts: note (unrelated brace reformat).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: clear.
    • packages/core/src/utils/touchRuntimeModules.tsx: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; the identity test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records match the code; the three code comments now agree with createTouchPart on which parts a page loads, and INV13's one sentence is the last that does not.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 09a3d63

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required build, test and lint checks have not run here, and the merge guard needs them green before merge.

The records this pull request amends carry an engineering owner's approval for this revision, and the owner's decision covers the window in which a mouse cannot drag SegmentedControl's selection or Switch's thumb before the touch code loads. The loader, boundary, component and bundle tests pass again here, the public API is unchanged, and the description note from the last review is fixed.

Claims and files checked

Review mode: same-head; reason: none

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test, 10 of 10 here; a static-import walk of the three entries finds neither module).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there (the keyboard hook, the keyboard target and the animator): verified (boundary test; the walk finds none of the three from the field entries).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:105-117; loader test, 5 of 5 here).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (component test, 7 of 7 here; Chromium window spec, 9 of 9 at this revision; frames with the touch chunks failing; BottomSheetPanel.tsx:1008-1013; keyboardTarget.ts:657, :1116).
    • Primary intent is performance with no API change: verified (the API surface generator lists no added, changed or removed row).
    • The owner asked to defer the load, not to lazy-load per interaction: verified (quoted in the amended loading decision of the package stylesheet record).
    • Per-component and form-page savings in the first table: verified within 0.35 KB gzip against the base (the description measured against an older main).
    • Earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build, the touch-part byte figure) and the app's paint-time figure: not reproduced (outside builds or earlier revisions; each is labelled as such).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:79-91, :138-144).
    • The touch hooks stay unchanged and the three fields share one keyboard part whose options pass through: verified (useSegmentedSelectionMotion and useSwitchTouch are untouched; useMobileKeyboard keeps its signature and reads the animator at use time; keyboardFieldPart.tsx).
    • The Reduce Motion read moves into motionQueries.ts with main's shared decision carried by hand, the policy module reads the coarse-pointer query there, and the new test checks it: verified (motionQueries.ts, reducedMotion.ts:48; the test passes here).
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts; coast keeps only type imports from the animator).
    • The bundle tests find the app's own entry chunk, main already carries the core bundle test's fix, and the pager pattern counts the new motion module: verified (the six bundle test files pass here, 35 tests).
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically, AlertDialog included: verified (a static-import sweep at this revision finds no component importer beyond the gap line, the opt-in constructors and the public touch layer).
    • The keyboard record's new gap number is free: verified (the keyboard record on main has Gaps 13, 19 and 21 and no Gap 22).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • Preflight: the full run was at an earlier revision merged onto an older main, and the run at this revision is booked: stated as such; the steps it names that this review could repeat pass here (core typecheck, lint of the changed files, knowledge and changeset checks, with the build from the earlier run at this revision); the full UI suite and the pre-review report were not reproduced.
    • The merge of main carried its Reduce Motion change into motionQueries.ts: verified (defaultPrefersReducedMotion answers with the shared decision).
    • The stated test counts (2,883, 2,595, 2,125 + 883): not reproduced at those scales; the touched suites pass at this revision (20 files and 427 tests here).
    • The Chromium window spec, the boundary and knowledge checks, the core typecheck and the bundle tests pass: verified.
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (all six loader variables listed; gestureCounter.ts keeps pressGesture in its shared state; the shared-identity test passes here).
    • The earlier keyboard deferral pull request has merged, and this one carries its deferral: verified.
    • Owner and land path: the records carry an engineering owner's approval at this revision: verified; the further owner re-approval after the device set is a plan.
    • Real-device feel and the full device set at this revision are booked: a plan, not evidence; none of this revision's claims needs them.
    • Device and emulator results are from earlier revisions: stated as such.
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (48)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: clear.
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: clear.
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes here).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: clear.
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: clear.
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: clear.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9 at this revision).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: clear.
    • packages/core/src/utils/touchRuntimeModules.tsx: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; its test passes here).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records, the code comments and the boundary test agree on which parts a page loads and which modules stay static.

Automated review (maintainer link)

Main's #13138 moves more Reduce Motion readers onto reducesMotion and
rewords defaultPrefersReducedMotion: with no element it reads the person's
setting alone. That read lives in motion/motionQueries.ts on this branch,
so its doc and header take #13138's wording, and #13138's readers test
allows the setting-only call there instead of in the animator.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 5f67816

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required build, test and lint checks have not run here, and the merge guard needs them green before merge.

The records this pull request amends carry an engineering owner's approval for this revision, and the owner's decision covers the window in which a mouse cannot drag SegmentedControl's selection or Switch's thumb before the touch code loads. The loader, boundary, component, Reduce Motion guard and bundle tests pass at this revision, the public API is unchanged, and there are no blocking findings.

  • Optional: the moved defaultPrefersReducedMotion doc (motionQueries.ts:17-19) reads more easily as two sentences; the description now tracks that in #13623.
Claims and files checked

Review mode: same-head; reason: none

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test, 10 of 10 at this revision; a static-import walk of the three entries finds neither module).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there: verified (boundary test; the walk finds none of the keyboard hook, the keyboard target or the animator from the field entries).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:105-117; loader test, 5 of 5 at this revision).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (component test, 7 of 7 at this revision; BottomSheetPanel.tsx:1009-1014, :1068; keyboardTarget.ts:657, :1116; the Chromium window spec passed at an earlier revision, and the merge since brings only main's Reduce Motion reads into the code it drives).
    • Primary intent is performance with no API change: verified (the API surface generator, run over both builds, lists no added, changed or removed row).
    • The owner asked to defer the load, not to lazy-load per interaction: verified (quoted in the amended loading decision of the package stylesheet record).
    • The at-this-revision size table (per component and the four reference pages): verified within 0.3 KB gzip against this base (the description measured against an older main).
    • Earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build, the touch-part byte figure) and the app's paint-time figure: not reproduced (outside builds or earlier revisions; each is labelled as such).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:89, :138-144).
    • The touch hooks stay unchanged and the three fields share one keyboard part whose options pass through: verified (useSegmentedSelectionMotion and useSwitchTouch are untouched; keyboardFieldPart.tsx).
    • The latest merge of main: the moved Reduce Motion read takes main's new wording, the readers guard allows its setting-only call in motionQueries.ts, and no first load gains the animator or the gesture host: verified (motionQueries.ts:17-25; readers guard 4 of 4; boundary and bundle tests at this revision).
    • A follow-up re-splits the moved Reduce Motion doc comment into two sentences, comment only: verified as a plan (an open issue by the author describes exactly that change; this revision leaves the comment as it is).
    • The earlier merge carried main's shared Reduce Motion decision into motionQueries.ts, the policy module reads the coarse-pointer query there, and the new test checks it: verified (reducedMotion.ts:48; motionQueries.test.ts passes).
    • Stated test counts (3,062; 2,883; 2,595; 2,125 + 883): not reproduced at those scales; the touched suites pass at this revision (93 files, 2,916 tests); the sheet, pager and shared-identity bundle scripts pass 15 of 15: verified.
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the two new motion modules: verified (six bundle test files, 35 tests at this revision; main's single-bundle test already matches its own entry the same way).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically, AlertDialog included: verified (a static-import sweep finds no component importer beyond the gap line, the opt-in constructors, the public touch layer and the touch parts).
    • The keyboard record's new gap number is free: verified (the keyboard record on main has no Gap 22).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (six loader variables listed; the shared-identity test passes).
    • Preflight: the full run was at an earlier revision, and the run at this revision is booked: stated as such; the steps that could be repeated pass at this revision (build, core typecheck, lint of the changed files, knowledge and changeset checks).
    • Device and emulator results are from earlier revisions, and the full set at this revision is booked: stated as such; none of this revision's claims needs them.
    • Owner and land path: the records carry an engineering owner's approval at this revision: verified; the owner's re-approval after the device set is a plan.
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: clear.
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: clear.
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes at this revision).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: clear.
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: clear.
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: one non-blocking wording suggestion (lines 17-19), tracked in a follow-up issue.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/reducedMotionReaders.test.ts: clear (the guard passes with its exception on motionQueries.ts).
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9 at an earlier revision; the merge since brings only main's Reduce Motion reads into the code it drives).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: clear.
    • packages/core/src/utils/touchRuntimeModules.tsx: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; its test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records, the code comments and the boundary test agree on which parts a page loads and which modules stay static.

Automated review (maintainer link)

Comment on lines +17 to +19
* Whether the person's Reduce Motion setting is on (`prefers-reduced-motion:
* reduce`), read at the moment of the call, without a theme's `'always'`
* (`reducesMotion` adds that, and the animator calls it). A component never

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking (INV29): this first sentence runs to about 30 words, and "(reducesMotion adds that, and the animator calls it)" leaves "that" and "it" to the reader. Suggested:

/**
 * Whether the person's Reduce Motion setting is on (`prefers-reduced-motion:
 * reduce`), read at the moment of the call. A theme's `'always'` does not
 * count here: the animator reads it through `reducesMotion(target)`.

Brings in #13480 (Switch reads no computed style at mount) before the device
set runs, so its Switch tap and thumb-drag cells cover both changes.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 7f30a61

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required build, test and lint checks have not run here, and the merge guard needs them green before merge.

The records this pull request amends carry an engineering owner's approval for this revision, and the owner's decision covers the window in which a mouse cannot drag SegmentedControl's selection or Switch's thumb before the touch code loads. The loader, boundary, component, Reduce Motion guard and bundle tests pass at this revision, the public API is unchanged, and there are no blocking findings.

  • Optional: the moved defaultPrefersReducedMotion doc (motionQueries.ts:17-19) reads more easily as two sentences; the description now tracks that in #13623.
Claims and files checked

Review mode: carry-forward; reason: none

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test, 10 of 10 at this revision; a static-import walk of the three entries finds neither module).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there: verified (boundary test; the walk finds none of the keyboard hook, the keyboard target or the animator from the field entries).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:105-117; loader test, 5 of 5 at this revision).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (component test, 7 of 7 at this revision; BottomSheetPanel.tsx:1009-1014, :1068; keyboardTarget.ts:657, :1116; the Chromium window spec passed at an earlier revision with the same patch).
    • Primary intent is performance with no API change: verified (the API surface generator, run over both builds of the same patch, lists no added, changed or removed row).
    • The owner asked to defer the load, not to lazy-load per interaction: verified (quoted in the amended loading decision of the package stylesheet record).
    • The at-this-revision size table (per component and the four reference pages): verified within 0.3 KB gzip by the last revision's measure of the same patch (the description measured against an older main).
    • Earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build, the touch-part byte figure) and the app's paint-time figure: not reproduced (outside builds or earlier revisions; each is labelled as such).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:89, :138-144).
    • The touch hooks stay unchanged and the three fields share one keyboard part whose options pass through: verified (useSegmentedSelectionMotion and useSwitchTouch are untouched; keyboardFieldPart.tsx).
    • The latest merge of main brings in the Switch change that reads no computed style at mount with no conflict; the Switch, touch runtime, Reduce Motion query and readers suites pass 157 of 157, the touch-support, gesture-free-entries and shared-identity bundle tests 24 of 24, and the core typecheck is clean: verified (the merged tree equals an automatic merge of the two parents; the same runs at this revision).
    • The previous merge of main: the moved Reduce Motion read takes main's new wording, the readers guard allows its setting-only call in motionQueries.ts, and no first load gains the animator or the gesture host: verified (motionQueries.ts:17-25; readers guard 4 of 4; boundary and bundle tests at this revision).
    • A follow-up re-splits the moved Reduce Motion doc comment into two sentences, comment only: verified as a plan (an open issue by the author describes exactly that change; this revision leaves the comment as it is).
    • The earlier merge carried main's shared Reduce Motion decision into motionQueries.ts, the policy module reads the coarse-pointer query there, and the new test checks it: verified (reducedMotion.ts:48; motionQueries.test.ts passes).
    • Stated test counts (3,062; 2,883; 2,595; 2,125 + 883): not reproduced at those scales; the touched suites pass at this revision (93 files, 2,921 tests); the sheet, pager and shared-identity bundle scripts pass 15 of 15: verified.
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the two new motion modules: verified (six bundle test files, 35 tests at this revision; main's single-bundle test already matches its own entry the same way).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically, AlertDialog included: verified (a static-import sweep finds no component importer beyond the gap line, the opt-in constructors, the public touch layer and the touch parts).
    • The keyboard record's new gap number is free: verified (the keyboard record on main has no Gap 22).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (six loader variables listed; the shared-identity test passes).
    • Preflight: the full run was at an earlier revision, and the run at this revision is booked: stated as such; the core typecheck and the knowledge and changeset checks pass at this revision, and the build and lint of the changed files passed at the last revision with the same patch.
    • Device and emulator results are from earlier revisions, and the full set at this revision is booked: stated as such; none of this revision's claims needs them.
    • Owner and land path: the records carry an engineering owner's approval at this revision: verified; the owner's re-approval after the device set is a plan.
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: clear.
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: clear.
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes at this revision).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: clear.
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: clear.
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: one non-blocking wording suggestion (lines 17-19), tracked in a follow-up issue.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/reducedMotionReaders.test.ts: clear (the guard passes with its exception on motionQueries.ts).
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9 at an earlier revision with the same patch).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: clear.
    • packages/core/src/utils/touchRuntimeModules.tsx: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; its test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records, the code comments and the boundary test agree on which parts a page loads and which modules stay static.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: one sentence in the description needs correcting before this can be approved. The records it amends carry an engineering owner's approval for this revision, the owner's decision covers the pre-load window, the public API is unchanged, and the code has no blocking defect.

  • The Device evidence section says that, by design, "a press before the touch code arrives is held 53 to 100 ms until it does", but nothing in this change holds a press for the touch code: before the load Switch toggles and SegmentedControl selects through the click at once (Switch.tsx:1025-1041, SegmentedControl.tsx:349-360, touchRuntime.components.test.tsx:74), as the approved Switch FR15, SegmentedControl FR3 and INV13 clauses require, so please state what was measured (for example, a tap that lands while the chunk evaluates waits for that task), or, if a press really waits for the chunk on those phones, fix that first.

Also worth a look, not blocking: two lines (Testing, and Owner and land path) still call the device set at this revision booked, and the moved defaultPrefersReducedMotion doc (motionQueries.ts:17-19) reads more easily as two sentences, which #13623 tracks. CI's workflows were skipped at this revision, so the required build, test and lint checks still have to run before merge.

Claims and files checked

Review mode: same-head; reason: none

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test, 10 of 10 at this revision; a static-import walk of the three entries finds neither module).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there: verified (boundary test; the walk finds none of the keyboard hook, the keyboard target or the animator from the field entries).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:105-117; loader test, 5 of 5 at this revision).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (component test, 7 of 7 at this revision; BottomSheetPanel.tsx:1009-1014, :1068; keyboardTarget.ts:657, :1116; the Chromium window spec passed at an earlier revision with the same patch).
    • Primary intent is performance with no API change: verified (the API surface generator, run over both builds of the same patch, lists no added, changed or removed row).
    • The owner asked to defer the load, not to lazy-load per interaction: verified (quoted in the amended loading decision of the package stylesheet record).
    • The at-this-revision size table (per component and the four reference pages): verified within 0.3 KB gzip by the last revision's measure of the same patch (the description measured against an older main).
    • Earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build, the touch-part byte figure) and the app's paint-time figure: not reproduced (outside builds or earlier revisions; each is labelled as such).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:89, :138-144).
    • The touch hooks stay unchanged and the three fields share one keyboard part whose options pass through: verified (useSegmentedSelectionMotion and useSwitchTouch are untouched; keyboardFieldPart.tsx).
    • The latest merge of main brings in the Switch change that reads no computed style at mount with no conflict; the Switch, touch runtime, Reduce Motion query and readers suites pass 157 of 157, the touch-support, gesture-free-entries and shared-identity bundle tests 24 of 24, and the core typecheck is clean: verified (the merged tree equals an automatic merge of the two parents; the same runs at this revision).
    • The previous merge of main: the moved Reduce Motion read takes main's new wording, the readers guard allows its setting-only call in motionQueries.ts, and no first load gains the animator or the gesture host: verified (motionQueries.ts:17-25; readers guard 4 of 4; boundary and bundle tests at this revision).
    • A follow-up re-splits the moved Reduce Motion doc comment into two sentences, comment only: verified as a plan (an open issue by the author describes exactly that change; this revision leaves the comment as it is).
    • The earlier merge carried main's shared Reduce Motion decision into motionQueries.ts, the policy module reads the coarse-pointer query there, and the new test checks it: verified (reducedMotion.ts:48; motionQueries.test.ts passes).
    • Stated test counts (3,062; 2,883; 2,595; 2,125 + 883): not reproduced at those scales; the touched suites pass at this revision (93 files, 2,921 tests); the sheet, pager and shared-identity bundle scripts pass 15 of 15: verified.
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the two new motion modules: verified (six bundle test files, 35 tests at this revision; main's single-bundle test already matches its own entry the same way).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically, AlertDialog included: verified (a static-import sweep finds no component importer beyond the gap line, the opt-in constructors, the public touch layer and the touch parts).
    • The keyboard record's new gap number is free: verified (the keyboard record on main has no Gap 22).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (six loader variables listed; the shared-identity test passes).
    • Preflight: the full run was at an earlier revision, and the run at this revision is booked: stated as such; the core typecheck and the knowledge and changeset checks pass at this revision, and the build and lint of the changed files passed at the last revision with the same patch.
    • Phone and emulator runs at this revision find no cell outcome different from the base: stated as device evidence, not reproduced; none of this revision's claims needs it.
    • A press during page load takes effect sooner than on main (about 0.1–0.4 s against 1.9 s): stated as a device measurement, not reproduced.
    • By design, a press made before the touch code arrives is held until it does: false (no code path waits for the touch code before handling a press; Switch toggles and SegmentedControl selects through the click before the load, Switch.tsx:1025-1041, SegmentedControl.tsx:349-360, touchRuntime.components.test.tsx:74; see the blocking finding).
    • Earlier revisions' device results are kept for history: stated as such.
    • The device set at this revision is still booked (Testing; Owner and land path): stale, since the new device section says it ran.
    • Owner and land path: the records carry an engineering owner's approval at this revision: verified; the owner's re-approval after the device set is a plan.
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: clear.
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: clear.
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes at this revision).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: clear.
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: clear.
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: one non-blocking wording suggestion (lines 17-19), tracked in a follow-up issue.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/reducedMotionReaders.test.ts: clear (the guard passes with its exception on motionQueries.ts).
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9 at an earlier revision with the same patch).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: clear.
    • packages/core/src/utils/touchRuntimeModules.tsx: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; its test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records, the code comments and the boundary test agree on which parts a page loads and which modules stay static.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI's workflows were skipped at this revision, so the required build, test and lint checks have not run here, and the merge guard needs them green before merge.

The records this pull request amends carry an engineering owner's approval for this revision, the owner's decision covers the pre-load window, the public API is unchanged, and the Device evidence section now matches the code: an early press works through its click, and nothing waits for the touch code.

Also worth a look, not blocking: the moved defaultPrefersReducedMotion doc (motionQueries.ts:17-19) reads more easily as two sentences, which #13623 tracks.

Claims and files checked

Review mode: same-head; reason: none

  • Claims
    • Changeset: SegmentedControl and Switch no longer put the touch animator and gesture host in a page's first load, and BottomSheet no longer puts the animator there: verified (boundary test, 10 of 10 at this revision; a static-import walk of the three entries finds neither module).
    • Changeset and linked issue: TextInput, TextArea and NumberInput no longer put the on-screen keyboard code there: verified (boundary test; the walk finds none of the keyboard hook, the keyboard target or the animator from the field entries).
    • Changeset: Core loads them once per page after first paint, when the page is idle: verified (touchRuntime.ts:105-117; loader test, 5 of 5 at this revision).
    • Changeset and description: until then the two controls work by taps, clicks and keys with no drag tracking or spring, a sheet dragged closed takes its normal exit, and a focused field keeps the browser's own reveal: verified (component test, 7 of 7 at this revision; BottomSheetPanel.tsx:1014, :1068; keyboardTarget.ts:657, :1116; the Chromium window spec passed at an earlier revision with the same patch).
    • Primary intent is performance with no API change: verified (the API surface generator, run over both builds of the same patch, lists no added, changed or removed row).
    • The owner asked to defer the load, not to lazy-load per interaction: verified (quoted in the amended loading decision of the package stylesheet record).
    • The linked issue's report of about 26 KB more first-load JavaScript on a form page between two releases: verified (the issue states it).
    • The at-this-revision size table (per component and the four reference pages): verified within 0.3 KB gzip by the reference-page measure of the same patch (the description measured against an older main).
    • Earlier-revision tables (production-app routes, four-bundler matrix, static module counts, the consumer app's build, the touch-part byte figure) and the app's paint-time figure: not reproduced (outside builds or earlier revisions; each is labelled as such).
    • A finger or Reduce Motion tap changes the controls at once, and a press the browser cancels selects nothing: verified (component test; the component records).
    • A press in flight at the load finishes by its click, and the next press takes the touch path: verified (component test).
    • The static touch presentation does not change at the load: verified (the presentation query and hit areas stay in SegmentedControl.tsx and Switch.tsx).
    • The cause was static imports of the animator, the gesture host and the keyboard module: verified (the base's imports in SegmentedControl, Switch, BottomSheetPanel and the three fields).
    • One loader holds the shared core, each component hands it its own part, and a page loads the parts of the components it imports: verified (touchRuntime.ts:79-91, :138-144).
    • The touch hooks stay unchanged and the three fields share one keyboard part whose options pass through: verified (useSegmentedSelectionMotion and useSwitchTouch are untouched; keyboardFieldPart.tsx).
    • The Reduce Motion and coarse-pointer reads move to their own module, which the animator re-exports, so the policy module no longer pulls in the animator: verified (motionQueries.ts; reducedMotion.ts:48).
    • The latest merge of main brings in the Switch change that reads no computed style at mount with no conflict; the Switch, touch runtime, Reduce Motion query and readers suites pass 157 of 157, the touch-support, gesture-free-entries and shared-identity bundle tests 24 of 24, and the core typecheck is clean: verified (the same runs at this revision; that change has merged).
    • The previous merge of main: the moved Reduce Motion read takes main's new wording, the readers guard allows its setting-only call in motionQueries.ts, and no first load gains the animator or the gesture host: verified (motionQueries.ts:17-25; readers guard 4 of 4; boundary and bundle tests at this revision).
    • A follow-up re-splits the moved Reduce Motion doc comment into two sentences, comment only: verified as a plan (an open issue by the author describes exactly that change).
    • The earlier merge carried main's shared Reduce Motion decision into motionQueries.ts, and the new test checks it: verified (motionQueries.test.ts passes).
    • Stated test counts (3,062; 2,883; 2,595; 2,125 + 883): not reproduced at those scales; the touched suites pass at this revision (93 files, 2,921 tests), and the sheet, pager and shared-identity bundle scripts pass 15 of 15: verified.
    • The settle-threshold module lets BottomSheet and coast size a motion without the animator: verified (both import motion/settleThreshold.ts; coast keeps only type imports from the animator).
    • The bundle tests find the app's own entry chunk, and the pager pattern counts the two new motion modules: verified (six bundle test files, 35 tests at this revision).
    • The new tests fail on the base branch: verified by reading (the boundary test's chains run through the base's static imports; the loader and component tests import a module the base lacks).
    • Suites that drive touch motion and the fields' keyboard suites load the runtime first: verified (each adds a beforeAll that loads it).
    • Every record change listed under Authority is in the diff and owner-approved at this revision: verified (an engineering owner's approval comment for this revision; the spec approval status succeeds).
    • The gap line names every module that still imports the touch modules statically, AlertDialog included: verified (a static-import sweep finds no component importer beyond the gap line, the opt-in constructors, the public touch layer and the touch parts).
    • The keyboard record's new gap number is free: verified (the keyboard record on main has Gaps 13, 19 and 21 and no Gap 22).
    • The loader's module state is listed in the shared-identity baseline with a reason, and the press state stays in the shared slot: verified (six loader variables listed; the shared-identity test passes; the press note lives in the gesture counter's shared state).
    • Preflight: the full run was at an earlier revision, and the strict run is stated as booked with its passing checks: stated as such; the core typecheck and the knowledge and changeset checks pass at this revision.
    • Phone and emulator runs at this revision find no cell outcome different from the base: stated as device evidence, not reproduced; none of this revision's claims needs it.
    • A press made before the touch code loads takes effect at once through its click, as on main, and nothing waits for the touch code: verified in the code (Switch.tsx:1027-1030, SegmentedControl.tsx:349-358, touchRuntime.ts:105-117, :152-167; component test); the phone timings beside it are stated device measurements, not reproduced.
    • A press during page load takes effect sooner than on main (about 0.1–0.4 s against 1.9 s): stated as a device measurement, not reproduced.
    • Earlier revisions' device results are kept for history: stated as such.
    • Owner and land path: the records carry an engineering owner's approval at this revision and the keyboard pull request this one absorbs has merged: verified; the owner's re-approval after the device set is a plan.
    • Writing-rubric results: consistent with the records.
    • Public text contains no internal context: verified.
  • Files (49)
    • .changeset/touch-runtime-after-first-paint.md: clear.
    • docs/architecture/component-import-boundaries.md: clear.
    • docs/architecture/react-component-runtime.md: clear.
    • docs/specs/AST-080-package-stylesheets/spec.md: clear.
    • docs/specs/AST-094-touch-presentations/spec.md: clear.
    • docs/specs/AST-099-mobile-keyboard/spec.md: clear.
    • docs/specs/components/BottomSheet/BottomSheet.spec.md: clear.
    • docs/specs/components/SegmentedControl/SegmentedControl.spec.md: clear.
    • docs/specs/components/Switch/Switch.spec.md: clear.
    • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (its check passes at this revision).
    • packages/core/src/BottomSheet/BottomSheet.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetDragExit.test.tsx: clear.
    • packages/core/src/BottomSheet/BottomSheetPanel.tsx: clear.
    • packages/core/src/Indicator/boxHold.test.tsx: clear.
    • packages/core/src/Layer/gestureCounter.ts: clear.
    • packages/core/src/NumberInput/NumberInput.keyboard.test.tsx: clear.
    • packages/core/src/NumberInput/NumberInput.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.test.tsx: clear.
    • packages/core/src/SegmentedControl/SegmentedControl.tsx: clear.
    • packages/core/src/SegmentedControl/segmentedTouchPart.tsx: clear.
    • packages/core/src/Switch/Switch.test.tsx: clear.
    • packages/core/src/Switch/Switch.tsx: clear.
    • packages/core/src/Switch/switchTouchPart.tsx: clear.
    • packages/core/src/TextArea/TextArea.keyboard.test.tsx: clear.
    • packages/core/src/TextArea/TextArea.tsx: clear.
    • packages/core/src/TextInput/TextInput.keyboard.test.tsx: clear.
    • packages/core/src/TextInput/TextInput.tsx: clear.
    • packages/core/src/keyboard/keyboardFieldPart.tsx: clear.
    • packages/core/src/keyboard/keyboardTarget.guide.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.test.ts: clear.
    • packages/core/src/keyboard/keyboardTarget.ts: clear.
    • packages/core/src/keyboard/useDeferredMobileKeyboard.tsx: clear.
    • packages/core/src/keyboard/useMobileKeyboard.ts: clear.
    • packages/core/src/motion/animator.ts: clear.
    • packages/core/src/motion/coast.ts: clear.
    • packages/core/src/motion/motionQueries.test.ts: clear.
    • packages/core/src/motion/motionQueries.ts: one non-blocking wording suggestion (lines 17-19), tracked in a follow-up issue.
    • packages/core/src/motion/reducedMotion.ts: clear.
    • packages/core/src/motion/reducedMotionReaders.test.ts: clear (the guard passes with its exception on motionQueries.ts).
    • packages/core/src/motion/settleThreshold.ts: clear.
    • packages/core/src/utils/tests/touchRuntimeWindow.a11y.chromium.spec.ts: clear (9 of 9 at an earlier revision with the same patch).
    • packages/core/src/utils/touchRuntime.boundary.test.ts: clear.
    • packages/core/src/utils/touchRuntime.components.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.test.tsx: clear.
    • packages/core/src/utils/touchRuntime.ts: clear.
    • packages/core/src/utils/touchRuntimeModules.tsx: clear.
    • scripts/lazy-sheet-bundle.test.mjs: clear.
    • scripts/shared-identity.baseline.json: clear (all six loader variables listed; its test passes).
    • scripts/snap-paging-bundle.test.mjs: clear.
    • Cross-file: the records, the code comments, the description and the boundary test agree on which parts a page loads, which modules stay static and how an early press behaves.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 7f30a612 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. lane:4 Astryx fix-loop lane 4 owns this needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] TextInput and TextArea bring keyboard motion into the first-load bundle in 0.7.17

2 participants