Repository navigation
perf(core): SegmentedControl, Switch and BottomSheet load the touch animator after first paint - #11450
perf(core): SegmentedControl, Switch and BottomSheet load the touch animator after first paint#11450cixzhang wants to merge 38 commits into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
… settle threshold module
There was a problem hiding this comment.
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 intoplayedDragExitso 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 inbeforeAllas the Switch and BottomSheet suites do.utils/touchRuntime.tsandmotion/settleThreshold.tsare new internal shared modules that no current record names; each needs an owner API decision.touchRuntime.tsre-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 copiesselectioninto SegmentedControl's ref; useuseCommittedRefIntoinstead.- 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.
|
/approve-spec b0e013b |
There was a problem hiding this comment.
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 totouchRuntime.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.tsre-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 copiesselectioninto SegmentedControl's ref; useuseCommittedRefIntoinstead.SegmentedControl.test.tsx's slide test passes only after earlier tests let the real load finish and fails when run alone; load the runtime inbeforeAll, 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.
…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.
|
/approve-spec e5ad6c7 |
There was a problem hiding this comment.
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
onClickcallspreventDefault()still selects it when focus is already in the group, because the new guard ends atpointerupand 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
pointerupandpointercancellisteners, whileisPressInFlight()inLayer/gestureCounter.tsalready 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
setTimeoutand then reads the globalwindow(touchRuntime.ts:80-100), so a test file torn down in between ends the Vitest run with an unhandledReferenceError(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
coastsize motion without the animator: verified (coast.tsimports 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 readswindowafter 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.
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.
|
/approve-spec 69c7909 |
There was a problem hiding this comment.
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.tsxandSwitch.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.tsimportsmotion/motionQueries.ts). - The settle-threshold module lets BottomSheet and
coastsize a motion without the animator: verified (both importmotion/settleThreshold.ts;coastkeeps 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
beforeAllthat 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.tsno 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.tskeepspressGesturein 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.
…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
|
/approve-spec c10393d |
There was a problem hiding this comment.
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.tsxandSwitch.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.tsimportsmotion/motionQueries.ts). - The settle-threshold module lets BottomSheet and
coastsize a motion without the animator: verified (both importmotion/settleThreshold.ts;coastkeeps 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
mainadds 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
beforeAllthat 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.tsno 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.tskeepspressGesturein 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
mainhas 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.
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.
|
/approve-spec 0723076 |
There was a problem hiding this comment.
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.tsxandSwitch.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 intomotionQueries.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
coastsize a motion without the animator: verified (both importmotion/settleThreshold.ts;coastkeeps 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
beforeAllthat 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.tskeepspressGesturein 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
mainhas 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
mainadded). - 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.
… 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.
|
/approve-spec 0baab7d |
There was a problem hiding this comment.
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:341andSwitch.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);useMobileKeyboardkeeps 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.tswithmain'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
coastsize a motion without the animator: verified (both importmotion/settleThreshold.ts;coastkeeps 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
beforeAllthat 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.tskeepspressGesturein 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
mainhas 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
createTouchParton which parts a page loads, and INV13's one sentence is the last that does not.
…; drop an unrelated test reformat
|
/approve-spec 09a3d63 |
There was a problem hiding this comment.
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.tsxandSwitch.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 (
useSegmentedSelectionMotionanduseSwitchTouchare untouched;useMobileKeyboardkeeps its signature and reads the animator at use time;keyboardFieldPart.tsx). - The Reduce Motion read moves into
motionQueries.tswithmain'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
coastsize a motion without the animator: verified (both importmotion/settleThreshold.ts;coastkeeps only type imports from the animator). - The bundle tests find the app's own entry chunk,
mainalready 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
mainhas 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
beforeAllthat 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
maincarried its Reduce Motion change intomotionQueries.ts: verified (defaultPrefersReducedMotionanswers 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.tskeepspressGesturein 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.
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.
|
/approve-spec 5f67816 |
There was a problem hiding this comment.
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
defaultPrefersReducedMotiondoc (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 onlymain'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.tsxandSwitch.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 (
useSegmentedSelectionMotionanduseSwitchTouchare untouched;keyboardFieldPart.tsx). - The latest merge of
main: the moved Reduce Motion read takesmain's new wording, the readers guard allows its setting-only call inmotionQueries.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 intomotionQueries.ts, the policy module reads the coarse-pointer query there, and the new test checks it: verified (reducedMotion.ts:48;motionQueries.test.tspasses). - 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
coastsize a motion without the animator: verified (both importmotion/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
beforeAllthat 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
mainhas 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.
| * 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 |
There was a problem hiding this comment.
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.
|
/approve-spec 7f30a61 |
There was a problem hiding this comment.
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
defaultPrefersReducedMotiondoc (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.tsxandSwitch.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 (
useSegmentedSelectionMotionanduseSwitchTouchare untouched;keyboardFieldPart.tsx). - The latest merge of
mainbrings 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 takesmain's new wording, the readers guard allows its setting-only call inmotionQueries.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 intomotionQueries.ts, the policy module reads the coarse-pointer query there, and the new test checks it: verified (reducedMotion.ts:48;motionQueries.test.tspasses). - 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
coastsize a motion without the animator: verified (both importmotion/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
beforeAllthat 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
mainhas 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.
There was a problem hiding this comment.
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.tsxandSwitch.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 (
useSegmentedSelectionMotionanduseSwitchTouchare untouched;keyboardFieldPart.tsx). - The latest merge of
mainbrings 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 takesmain's new wording, the readers guard allows its setting-only call inmotionQueries.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 intomotionQueries.ts, the policy module reads the coarse-pointer query there, and the new test checks it: verified (reducedMotion.ts:48;motionQueries.test.tspasses). - 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
coastsize a motion without the animator: verified (both importmotion/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
beforeAllthat 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
mainhas 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.
There was a problem hiding this comment.
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.tsxandSwitch.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 (
useSegmentedSelectionMotionanduseSwitchTouchare 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
mainbrings 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 takesmain's new wording, the readers guard allows its setting-only call inmotionQueries.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 intomotionQueries.ts, and the new test checks it: verified (motionQueries.test.tspasses). - 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
coastsize a motion without the animator: verified (both importmotion/settleThreshold.ts;coastkeeps 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
beforeAllthat 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
mainhas 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.
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
main3ad8639 (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.spec:AST-099Gap 22).Problem and solution fit
SegmentedControl,SwitchandBottomSheetstatically importedmotion/animatorandgestures/GestureHost, so every page rendering one of them shipped the touch runtime, even on desktop.utils/touchRuntime.tsis 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, throughkeyboard/useDeferredMobileKeyboard.tsx), which mounts the unchangeduseMobileKeyboardonce loaded; its options pass through unchanged.Authority
spec:AST-080DEC-5, amended by the owner (appended, existing text unchanged).architecture:react-component-runtimeINV13: 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-boundariesINV8: the loader is the oneimport()of the touch modules, and of a component's touch part through it, at most once per page.architecture:react-component-runtimeINV13 (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.tskeeps the Reduce Motion policy's two media-query reads apart from the animator; verification row added.spec:AST-099Gap 22: a field focused before the load (TextInput, TextArea and NumberInput load their keyboard module with the touch runtime).component:SegmentedControlFR3, FR9, FR10, FR13 and FR14, andcomponent:SwitchFR9, FR10, FR13 and FR15: each states its before-load behavior.component:BottomSheetFR19: a drag-close before the load takes the stylesheet exit.spec:AST-094FR43 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, againstmain59fd415):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.
keyboard/useDeferredMobileKeyboard.tsxregisterskeyboard/keyboardFieldPart.tsxwith the loader (createTouchPart) and returns the element that mountsuseMobileKeyboardonce loaded; each field renders it inside itsField, so the field's own tree does not change.motion/motionQueries.tsholdsdefaultPrefersReducedMotionanddefaultIsCoarsePointer; the animator re-exports them.motion/reducedMotion.tsimported 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,
sideEffectshonored, first-load chunks gzipped as one stream; Core built frommainand from this branch, each swapped into the app'snode_modules), in gzip bytes for three whole routes:mainThe counterfactual stubs
motion/animatorandgestures/GestureHost, keeping every other importer. Onmainthe remaining first-load importers areToast/useToastGestureandPopover/popoverSurfaceMotion(all of the embed view's remainder), plushooks/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
mainc56d65a, Core built from each; KB = 1,024 B; chunks = first-load requests):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/GestureHostandgestures/GestureArenastay 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:pagesat the previous head (093c9fc) are below; the touch parts change neither page's static graph.size:pagesminified / gzip at 093c9fcutils/touchRuntime.tsschedules once per page from the first component that uses it: a frame, then a task after that paint, thenrequestIdleCallbackwith a 2,000 ms timeout (a 0 ms timer where the browser has no idle callback). It loadsutils/touchRuntimeModules.tsx(the animator) and the touch parts of the components on the page (createTouchPart, which a component's module calls as it loads, anduseTouchPart; a part registered after the page load starts loads at its first mount, never on an input), publishes throughuseSyncExternalStore(nullon the server and at hydration), and swallows a failed chunk (the page stays on taps, clicks and keys).motion/settleThreshold.tsholdsSETTLE_THRESHOLD, so BottomSheet andmotion/coastsize a motion without importing the animator (coastimported nothing else from it, so it isn't in the gap list).scripts/lazy-sheet-bundle.test.mjsnow finds the app's own entry chunk (mainalready carries the same fix forscripts/core-single-bundle.test.mjs): animport()target is an entry point too, and the firstentryPointthey found became the loader's chunk.scripts/snap-paging-bundle.test.mjscountsmotion/settleThresholdas motion code.Static first-load graph (bundler-independent) at 093c9fc: the modules each reference page reaches through static imports, from this PR merged with
main88c4e0a, against thatmain: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
Testing
Preflight (earlier head): full
node scripts/preflight.mjs --base origin/main(with the docsite) on a Linux node at an earlier head merged ontomainecfdfc3; the strict preflight at 5f67816, which containsmain3ad8639, is booked: review:pre, build, typecheck, lint, vitest ui, knowledge and changesets pass. In vitest node, only two files fail, and both fail the same way onmainon that node:.github/scripts/lib/offline-media.test.mjs(a network proxy holds the "unreachable host" open; 24/24 without it) and two path-traversal cases intemplate-integration.test.mjs(the checkout sat under/tmp; 39/39 onmainfrom$HOME). This change touches neither.Main merge at 7f30a61 (onto
main38ea127): brings in perf(Switch): read no computed style at mount #13480 (Switch reads no computed style at mount) with no conflict, so the device set covers both. Switch, touch runtime (boundary included), motionQueries and reducedMotionReaders: 157 of 157; touch-support, gesture-free-entries and shared-identity bundle scripts: 24 of 24; core typecheck clean.Main merge at 5f67816 (onto
main3ad8639, after refactor(core): the remaining Reduce Motion script readers read a theme's reducedMotion 'always' #13138): refactor(core): the remaining Reduce Motion script readers read a theme's reducedMotion 'always' #13138 moves more Reduce Motion readers ontoreducesMotionand rewordsdefaultPrefersReducedMotion(with no element it reads the person's setting alone). On this branch that read lives inmotion/motionQueries.ts, so its doc and header take refactor(core): the remaining Reduce Motion script readers read a theme's reducedMotion 'always' #13138's wording, and refactor(core): the remaining Reduce Motion script readers read a theme's reducedMotion 'always' #13138'sreducedMotionReaders.test.tsallows the setting-only call there instead of in the animator. No first load gains the animator or the gesture host. Ui tests across motion, BottomSheet, SegmentedControl, Switch, press feedback, the touch runtime, keyboard, the three fields, Carousel and Dialog pass 3,062 of 3,062, and the sheet, pager and shared-identity bundle scripts pass 15 of 15. Follow-up Core: re-split the defaultPrefersReducedMotion doc comment into two sentences #13623 re-splits the moveddefaultPrefersReducedMotiondoc comment into two sentences (comment only).Main merge at 0723076 (onto
main898c93b): main's refactor(core): a theme's reducedMotion 'always' reaches the hooks that hold no element; the chat scroll and streaming text read it #9763 changeddefaultPrefersReducedMotionto answer withreducesMotion(), and this PR moves that function tomotion/motionQueries.ts, so its new body is carried there by hand.motion/reducedMotion.tsreadsdefaultIsCoarsePointerfrommotionQueries, never the animator, so no field, switch, segmented control or sheet loads the animator in its first load.motionQueries.test.tschecks that the function answers with the shared decision; it fails on the old body. The ui tests of motion, BottomSheet, SegmentedControl, Switch, the touch runtime (boundary included), keyboard, TextInput, TextArea and NumberInput: 2,883 of 2,883 pass.Red first, each failing on
main:utils/touchRuntime.boundary.test.ts: the SegmentedControl, Switch and BottomSheet entries reach neithermotion/animatornorgestures/GestureHoststatically, and the TextInput, TextArea and NumberInput entries reach neither those norkeyboard/useMobileKeyboard.ts(onmain:TextInput.tsx → keyboard/useMobileKeyboard.ts, and the same for TextArea and NumberInput); the keyboard part loads only fromkeyboard/useDeferredMobileKeyboard.tsx, through the loader. Onmainit fails withSegmentedControl → useSegmentedSelectionMotion → motion/animator,useSwitchTouch → GestureHost, andBottomSheetPanel → motion/animator. Only the loader imports the runtime module, throughimport().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 (onmainthe 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-094FR44). A SegmentedControl selects by click before and after the load.Also:
.keyboard.test.tsx) load the runtime inbeforeAll.core-single-bundle,lazy-sheet-bundle,snap-paging-bundle,touch-support-bundle,gesture-free-entries,shared-identity), the core typecheck,check:knowledgeandcheck:changesetspass.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.check:component-import-boundaries,check:knowledge, the core typecheck, and the bundle tests above all pass.Shared identity (
spec:AST-110FR3)The loader's module state (
runtime,isScheduled,listenersinutils/touchRuntime.ts) is listed in the shared-identity baseline with a reason, which FR3 allows, rather than kept in a shared slot.spec:AST-110lets "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 insharedState.Writing rubric results
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 onmain. 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.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-specis 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.