Repository navigation
refactor(core): the remaining Reduce Motion script readers read a theme's reducedMotion 'always' - #13138
Conversation
…' ships Plumbing for spec:AST-108 FR6, with no change for anyone today: no public theme can set reducedMotion, and resolveKnobs still resolves every theme to 'system', so no theme marks its root. - privateAttributes/reducedMotion.stylex.ts owns data-astryx-reduced-motion: reducedMotionMarkProps and setRootReducedMotionMark write it, and themeReducesMotion reads it on an element, an ancestor, or <html>. - Theme marks its wrapper, and the root theme marks <html>, with the attribute and the --_astryx-reduced-motion custom property when the theme's motion resolves reducedMotion to 'always'. The server renders the mark. - The animator, reducedMotionFade and the layout glide count the mark as the person's Reduce Motion setting. - ThemeReducedMotion (internal) widens to 'system' | 'always'. Tests cover the reader, the three readers' use of it, and the Theme mark through a mocked resolveMotionKnobs. Co-authored-by: Christopher Chedeau <[email protected]>
…ed formatting out
…and the chat scroll, streaming text and swipe settle read it
Internal, like the mark it builds on: no theme can set reducedMotion
'always' yet, so nothing changes for anyone.
- theme/reducedMotion.markers.stylex.ts defines reducedMotionScope. Theme
puts it on the marked wrapper, and the root theme writes its class on
<html> beside the mark, so a Reduce Motion style keyed on
stylex.when.ancestor('[data-astryx-reduced-motion]', reducedMotionScope)
reaches portaled layers.
- motion/reducedMotion.ts adds reducesMotion(element): the person's setting
or the mark. hooks/useReducesMotion.ts is its hook form, for a hook that
holds no element: the setting, followed live, or the theme tree through
ThemeReducesMotionContext, where a nested theme never removes an
ancestor's 'always'.
- useChatStreamScroll, useStreamingText and ItemSwipeLayer read them.
- motion/reducedMotion.test.ts guards the rest with lists that only shrink:
every Reduce Motion arm needs its twin on the mark, and every script read
of the setting needs the mark. A read through a constant that holds the
query counts.
- Tests reach 'always' through a themeMotion mock
(theme/reducedMotionAlways.testing.ts).
Co-authored-by: Christopher Chedeau <[email protected]>
…le that calls no StyleX The animator reads the reduced-motion mark through its owner module, which the private-attribute rule names .stylex.ts. The module imports nothing, and the check that the graph reaches no @stylexjs import still holds it to that.
…er module, which the animator reads
The old base (#9761) landed squashed, so this resolves as main plus this branch's own changes. main's later Reduce Motion work updates the pending lists: ClickableCard, SelectableCard, Spinner's rotor, Thumbnail, the press module and useMobileKeyboard are listed; Lightbox, Spinner, AppShell and MobileNav come off (main removed their arms or reads).
…eaches the hooks that hold no element Main now carries the mark's private-attribute module, the root and wrapper marks, and the animator's read of them (#9761), so this re-port keeps only what main lacks: Theme passes 'always' down through ThemeReducesMotionContext (beside Theme's other contexts in useTheme.ts; a nested theme keeps an ancestor's), and motion/reducedMotion.ts gains reducesMotion(element) and its hook form useReducesMotion, which the chat scroll and streaming text now read. The swipe release already reads the mark through reducedMotionFade. The other script readers follow in a stacked change. Co-authored-by: Christopher Chedeau <[email protected]>
…me's 'always' Carousel's button and index scrolls, BottomSheet's alignment, cross-fade, haptic and scroll settle, MobileNav's and AppShell's close hold, the mobile keyboard's scroll and press feedback's release now decide through motion/reducedMotion.ts (reducesMotion or useReducesMotion), which counts a theme's reducedMotion: 'always' mark beside the person's setting. Resizable's close slide, a DOM-free entry, ORs the setting with the mark through the mark's owner module, as animatedLayout does. A guard test keeps any new script read of the setting on the same rule (spec:AST-108 FR6). Stacked on the change that adds useReducesMotion. Co-authored-by: Christopher Chedeau <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec c562bfe |
There was a problem hiding this comment.
Requesting changes. Moving the remaining Core script readers onto a theme's reduced-motion mark matches the motion spec. Three points need fixing first:
utils/pressFeedback.tsnow importsmotion/reducedMotion.ts, which brings the motion animator into first-load JavaScript, so the docs, menu and table reference pages each grow by about 14 KB gzip (+13,819, +14,486 and +14,521 bytes); readthemeReducesMotionfrom its owner module beside the setting, ascreateResizable.tsalready does, and report the four pages' first-load deltas.- The changeset, description and commit message say the guard catches any new script read of the setting, but it only matches the literal query outside seven whole-file exemptions, and it still passes with three readers moved back to the setting alone (
BottomSheetPanel.tsx:848,MobileNav.tsx:352throughdefaultPrefersReducedMotion(),createResizable.ts:1288); tighten the guard or narrow the wording. - No test fails if BottomSheetPanel's alignment and cross-fade or Resizable's spring-back and close slide ignore the mark, so add one test per component with the mark on and the setting off.
One non-blocking comment-wording suggestion is inline.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: Carousel, BottomSheet (alignment, cross-fade, haptic, settle), MobileNav, AppShell, the keyboard scroll, press feedback and Resizable now honour a theme's 'always' mark beside the setting. Verified:
Carousel.tsx:542,:596;BottomSheetPanel.tsx:848,:1003-1006;useSheetGestures.ts:155,:674;MobileNav.tsx:352;AppShell.tsx:676-690;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1288,:1385. - Claim: a guard keeps any new script read of the setting on the shared rule. False: a three-reader mutation passes the guard.
- Claim: no theme can set 'always' yet, so nothing changes for anyone. False as written: nothing renders differently, because every theme resolves to 'system' (
motionKnobs.ts:82), but three reference pages grow by about 14 KB gzip. - Claim: app builders see no API change. Verified: the API generator lists 0 rows for core, build and the seven themes.
- Claim: Resizable must do no DOM work at import, so it reads the mark's owner module. Verified: importing the shared module there makes
createResizable.server.test.tsxrecord document reads. - Claim: the keyboard-height module stays on the setting to recognise a platform report. Verified:
keyboardHeight.ts:147-154. - Claim: each guard allow-list reason holds. Verified:
animator.ts:1368,animatedLayout.ts:227-230,BottomSheetPanel.tsx:1005-1006,themeAdaptations.ts:783. - Claim: Carousel's
scrollNextscrolls withbehavior: 'auto'under the mark with the setting off. Verified: passes on the head, fails on the base. - Claim: a finger's release keeps the reduced bound under the mark. Verified: passes on the head, fails on the base.
- Claim: with the source reverted, the guard and both behaviour tests fail. Verified.
- Claim: the touched suites pass, and typecheck, lint and the changeset check are clean. Verified for the Carousel, BottomSheet, keyboard, MobileNav, AppShell, Resizable, motion and press feedback suites (102 files, 2,591 tests), Core's build typecheck, eslint on the changed files and the changeset check. The other listed checks were not verified.
- Claim: this pull request sits on the one that adds
reducesMotionanduseReducesMotion. Verified on the base branch. - File
.changeset/reduced-motion-script-readers.md: finding (guard and "nothing changes" wording). - File
packages/core/src/AppShell/AppShell.tsx: clear. - File
packages/core/src/BottomSheet/BottomSheetPanel.tsx: finding (no test under the mark). - File
packages/core/src/BottomSheet/useSheetGestures.ts: clear. - File
packages/core/src/Carousel/Carousel.test.tsx: clear. - File
packages/core/src/Carousel/Carousel.tsx: clear. - File
packages/core/src/MobileNav/MobileNav.tsx: clear. - File
packages/core/src/Resizable/createResizable.ts: finding (no test under the mark; non-blocking comment wording). - File
packages/core/src/keyboard/useMobileKeyboard.ts: clear. - File
packages/core/src/motion/reducedMotionReaders.test.ts: finding (whole-file exemptions). - File
packages/core/src/utils/pressFeedback.test.ts: clear. - File
packages/core/src/utils/pressFeedback.ts: finding (first-load growth).
…the motion foundation loads in plain Node scripts/motion-node-load.test.mjs requires the motion foundation to reach no theme module and no StyleX module. motion/reducedMotion.ts now reads ThemeReducesMotionContext from privateAttributes/reducedMotion.stylex.ts, the mark's owner module, which calls no StyleX, instead of theme/useTheme.ts. reducedMotion.ts holds a hook, so it starts with 'use client'.
|
/approve-spec fa35c18 |
There was a problem hiding this comment.
Requesting changes. Moving the remaining Core script readers onto a theme's reduced-motion mark matches the motion spec. Four points need fixing first:
utils/pressFeedback.tsnow importsmotion/reducedMotion.ts, which brings the motion animator into first-load JavaScript, so the docs, menu and table reference pages each grow by about 14 KB gzip (+13,855, +14,559 and +14,516 bytes); readthemeReducesMotionfrom its owner module beside the setting so press feedback never reaches the animator, and report the four pages' first-load deltas.- The changeset, description and commit message say the guard catches any new script read of the setting, but it only matches the literal query outside seven whole-file exemptions, and it still passes with three readers moved back to the setting alone (
BottomSheetPanel.tsx:848,MobileNav.tsx:352throughdefaultPrefersReducedMotion(),createResizable.ts:1288); tighten the guard or narrow the wording. - No test fails if BottomSheetPanel's alignment and cross-fade or Resizable's spring-back and close slide ignore the mark, so add one test per component with the mark on and the setting off.
- Regression: since the base branch moved the reduced-motion context beside the mark,
createResizable.tscan importreducesMotionwith no DOM work at import (createResizable.server.test.tsxstill passes with that import), so its inline setting-or-mark copies atcreateResizable.ts:1286-1289and:1382-1386lose their stated reason and should callreducesMotion, with the guard's allow-list entry and the description updated.
The earlier comment-wording suggestion on createResizable.ts no longer applies; the later inline comment on the same lines explains why.
Claims and files checked
Review mode: same-head; reason: none
- Claim: Carousel, BottomSheet (alignment, cross-fade, haptic, settle), MobileNav, AppShell, the keyboard scroll, press feedback and Resizable now honour a theme's 'always' mark beside the setting. Verified:
Carousel.tsx:542,:596;BottomSheetPanel.tsx:848,:1003-1006;useSheetGestures.ts:155,:674;MobileNav.tsx:352;AppShell.tsx:676-690;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1288,:1385. - Claim: a guard keeps any new script read of the setting on the shared rule. False: a three-reader mutation passes the guard.
- Claim: no theme can set 'always' yet, so nothing changes for anyone. False as written: nothing renders differently, because every theme resolves to 'system' (
motionKnobs.ts:82), but three reference pages grow by about 14 KB gzip. - Claim: app builders see no API change. Verified: the API generator lists 0 rows for core, build and the seven themes.
- Claim: Resizable must do no DOM work at import, so it reads the mark's owner module instead of the shared module. False at this head: after the base-branch change,
createResizable.server.test.tsxpasses with the shared module imported there. - Claim: the keyboard-height module stays on the setting to recognise a platform report. Verified:
keyboardHeight.ts:147-154. - Claim: each guard allow-list reason holds. Verified except Resizable's (see above):
animator.ts:1368,animatedLayout.ts:227-230,BottomSheetPanel.tsx:1005-1006,themeAdaptations.ts:783. - Claim: Carousel's
scrollNextscrolls withbehavior: 'auto'under the mark with the setting off. Verified: passes on the head, fails on the base. - Claim: a finger's release keeps the reduced bound under the mark. Verified: passes on the head, fails on the base.
- Claim: with the source reverted, the guard and both behaviour tests fail. Verified.
- Claim: the touched suites pass, and typecheck, lint and the changeset check are clean. Verified for the Carousel, BottomSheet, keyboard, MobileNav, AppShell, Resizable, motion and press feedback suites (102 files, 2,591 tests), Core's build typecheck, eslint on the changed files and the changeset check. The other listed checks were not verified.
- Claim: the motion foundation's plain-Node load test passes. Verified:
scripts/motion-node-load.test.mjspasses on the head (2 tests). - Claim: this pull request sits on the one that adds
reducesMotionanduseReducesMotion. Verified on the base branch. - File
.changeset/reduced-motion-script-readers.md: finding (guard and "nothing changes" wording). - File
packages/core/src/AppShell/AppShell.tsx: clear. - File
packages/core/src/BottomSheet/BottomSheetPanel.tsx: finding (no test under the mark). - File
packages/core/src/BottomSheet/useSheetGestures.ts: clear. - File
packages/core/src/Carousel/Carousel.test.tsx: clear. - File
packages/core/src/Carousel/Carousel.tsx: clear. - File
packages/core/src/MobileNav/MobileNav.tsx: clear. - File
packages/core/src/Resizable/createResizable.ts: finding (inline copy of the shared rule; no test under the mark; non-blocking comment wording). - File
packages/core/src/keyboard/useMobileKeyboard.ts: clear. - File
packages/core/src/motion/reducedMotionReaders.test.ts: finding (whole-file exemptions; Resizable's allow-list reason). - File
packages/core/src/utils/pressFeedback.test.ts: clear. - File
packages/core/src/utils/pressFeedback.ts: finding (first-load growth).
…dule, which loads no animator motion/reducedMotion.ts imports the animator, so a reader on every page (press feedback, streaming text) would load it at first load. reducesMotion and useReducesMotion now live in privateAttributes/reducedMotion.stylex.ts beside the mark and its context; that module loads no animator, theme or StyleX module. reducedMotionFade calls the same reducesMotion. spec:AST-108 FR6 gains the sentence that script readers decide through that module. First-load gzip against main: docs +72 B, form +56 B, menu -42 B, table +11 B, a Markdown page +122 B.
… module; a tighter guard; BottomSheet and Resizable tests Every reader in this change now imports reducesMotion or useReducesMotion from privateAttributes/reducedMotion.stylex.ts (merged from the base), which loads no animator, so press feedback and Carousel no longer pull the animator into first-load JavaScript. Resizable calls reducesMotion too, so its inline copies go. The guard now counts each listed file's spellings of the setting's query and fails any call of the animator's setting-only read outside the motion foundation. BottomSheet (a coarse pointer's fade, no alignment travel) and Resizable (no spring-back past the maximum) gain tests under a theme's 'always' with the setting off. snap-paging's pager-only list no longer holds the owner module, which every reader loads. spec:AST-108's verification table names the guard. First-load gzip against main for the stack: docs +74 B, form +24 B, menu +64 B, table +108 B.
|
/approve-spec 9a4a091 |
There was a problem hiding this comment.
Requesting changes. Moving Core's remaining script readers onto the reduced-motion mark's owner module matches the motion spec, and the earlier first-load, whole-file allow-list, BottomSheet-test and Resizable points are fixed. Two points need fixing first:
- The changeset, the description's maintainer impact and the new FR6 verification row say the guard fails any new script spelling of the setting's query or any reader that decides from the setting alone, but it only counts a single-quoted
'(prefers-reduced-motion(reducedMotionReaders.test.ts:80), so a template-literal read inuseMobileKeyboard.tsor an AppShell read throughREDUCED_MOTION_FADE_QUERYandREDUCED_MOTION_INSTANT_QUERYpasses it and every AppShell and keyboard test; match the query in any quote style and fail the exported pointer-split constants outside their listed files (withthemeAdaptations.ts's allowance set to what the guard counts), or narrow those three sentences to what the guard checks. - The description has no
## Writing rubric resultssection, which the knowledge-record rules require of any pull request that changes a record (here the new FR6 verification row), so add the seven R1–R7 lines.
Optional: BottomSheetPanel.tsx:1003-1006 can drop settingCrossFades, because isReducedMotion && isCoarsePointer already covers it.
Claims and files checked
Review mode: same-head; reason: none
- Claim: this sits on the earlier pull request that adds the element and hook forms of the shared rule in the mark's owner module, which loads no animator, theme or StyleX module. Verified: the owner module imports only React,
useMediaQueryandsharedContext(privateAttributes/reducedMotion.stylex.ts:20-22). - Claim: internal only; no theme can set
'always'yet, so behaviour does not change. Verified:theme/motionKnobs.ts:82always resolves'system'. - Claim: app builders see no API change. Verified: the API generator lists 0 rows for build, core and the seven themes.
- Claim: a guard fails a new script spelling of the setting's query outside the owner module and listed files, and any call of the animator's setting-only read outside the motion foundation. False for the first half: a template-literal spelling and the exported pointer-split constants pass; the second half is verified.
- Claim: Carousel's button and index scrolls count the mark. Verified:
Carousel.tsx:542,:596. - Claim: BottomSheet's alignment, coarse-pointer cross-fade, detent haptic and scroll settle count the mark. Verified:
BottomSheetPanel.tsx:848,:1003-1006;useSheetGestures.ts:155,:674. - Claim: MobileNav's and AppShell's close hold ends at once under the mark. Verified:
MobileNav.tsx:352;AppShell.tsx:676-690. - Claim: the mobile keyboard's scroll counts the mark. Verified:
useMobileKeyboard.ts:386. - Claim: press feedback's fade bound and fine-pointer release count the mark. Verified:
pressFeedback.ts:225,:567. - Claim: Resizable's spring-back and close slide count the mark, and its inline copies are gone. Verified:
createResizable.ts:1284,:1377. - Claim: the keyboard-height module stays on the setting to recognise how Chrome reports a keyboard. Verified:
keyboardHeight.ts:145-155. - Claim: the guard is recorded in the motion spec's verification table. Verified:
spec.md:197. - Claim: no core file spells the query in script beyond its listed count. True at this head in any quote style, but the guard counts only single-quoted spellings, so it does not enforce that for a template literal, and
themeAdaptations.tscounts 0 against an allowance of 1. - Claim: moving BottomSheetPanel, MobileNav or Resizable back to the setting alone fails the guard. Verified by mutation.
- Claim: the Carousel, press-release and two BottomSheet tests fail with their component's change reverted. Verified by mutation.
- Claim: the Resizable browser spec fails without the change. Not verified: not run.
- Claim: first-load deltas for the whole stack are +74, +24, +64 and +108 B gzip. Consistent: this change alone measures +2, −32, +106 and +94 B.
- Claim: the lazy-sheet, snap-paging and touch-support bundle guards pass. Verified; Slider's touch-layer test was not run.
- Claim: the touched suites, the plain-Node motion load test, typecheck, lint and formatting pass. Verified for 104 test files (2,604 tests), the motion load test, Core's typecheck, and eslint and prettier on the changed files; the knowledge check was not run.
- Claim: a Co-authored-by trailer credits the original design. Verified on the first commit.
- Changeset: the listed readers move onto the owner module, which loads no animator. Verified.
- Changeset: the guard sentence. False, as above.
- Changeset: nothing changes for anyone. Verified for behaviour; first-load JavaScript moves by at most 106 B gzip.
- File
.changeset/reduced-motion-script-readers.md: finding (guard wording). - File
docs/specs/AST-108-theme-motion/spec.md: finding (row's failure expectation; rubric results missing). - File
packages/core/src/AppShell/AppShell.tsx: clear. - File
packages/core/src/BottomSheet/BottomSheetPanel.tsx: non-blocking (redundant coarse query). - File
packages/core/src/BottomSheet/BottomSheetReplace.test.tsx: clear. - File
packages/core/src/BottomSheet/useSheetGestures.ts: clear. - File
packages/core/src/Carousel/Carousel.test.tsx: clear. - File
packages/core/src/Carousel/Carousel.tsx: non-blocking (variable name). - File
packages/core/src/MobileNav/MobileNav.tsx: clear. - File
packages/core/src/Resizable/__tests__/paneSlide.interaction.browser.spec.ts: clear (read, not run). - File
packages/core/src/Resizable/createResizable.ts: clear. - File
packages/core/src/keyboard/useMobileKeyboard.ts: clear. - File
packages/core/src/motion/reducedMotionReaders.test.ts: finding (single-quoted-only match). - File
packages/core/src/utils/pressFeedback.test.ts: clear. - File
packages/core/src/utils/pressFeedback.ts: clear. - File
scripts/snap-paging-bundle.test.mjs: clear.
…ny quote style and the exported query constants The guard counted only a single-quoted query, so a template-literal read or a read through REDUCED_MOTION_FADE_QUERY, REDUCED_MOTION_INSTANT_QUERY or REDUCED_MOTION_COARSE_QUERY passed it. It now matches the query in any quote style and fails any use of those constants outside the file that owns each. The animator's entry leaves the allow-list (it reads through reducesMotion now). AST-108's verification row and the changeset say so.
…educesMotion The animator kept its own copy of the rule (the setting, or the mark on the target). It now calls reducesMotion(target) from the mark's owner module, and defaultPrefersReducedMotion delegates to reducesMotion(), so one rule remains. The changeset's list of readers that follow names Resizable.
|
/approve-spec 90c4c77 |
Folds in review notes: under a theme's reduced-motion mark the dialog reads no opener, and with the setting on too it watches no setting. The Carousel's local is named for what it holds (setting or mark).
|
/approve-spec cbeb594 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because its checks are skipped while the pull request is a draft.
No blocking findings. Carousel's index scroll now names its value isReducedMotion, and the two new Dialog tests pin the theme mark at open and the skipped setting watch. One non-blocking gap stays: the re-check before a replay at Dialog.tsx:783 has no test, and a suggested case is on the test file.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: Changeset: the listed readers (Carousel's scrolls, BottomSheet's alignment, cross-fade, haptic and settle, MobileNav's and AppShell's close hold, the keyboard scroll, press feedback's release, Resizable's close slide) read a theme's always-mark through the owner module, which loads no animator — verified (
Carousel.tsx:542,:596;BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:156,:695;MobileNav.tsx:352;AppShell.tsx:677;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1314,:1410; the owner module's imports atreducedMotion.stylex.ts:20-23). - Claim: Changeset: the guard fails a new spelling of the setting's query in any quote style beyond each listed file's count, a pointer-split constant outside its owner, and the animator's setting-only read outside the motion folder — verified (
reducedMotionReaders.test.ts:26-46,:52,:79-114; the guard passes at this head). - Claim: Changeset and description: no theme can set the always value yet, so nothing changes for anyone — verified for behaviour (
theme/motionKnobs.ts:82always resolves'system'). - Claim: Description: the first change of the pair, which adds the element and hook readers and moves the chat scroll and streaming text onto them, is already on the base branch — verified (
Chat/useChatStreamScroll.ts:38,hooks/useStreamingText.ts:18on the base). - Claim: Description: this must land before any change that lets a theme set the always value — an ordering statement nothing in the code enforces; it holds for Core's readers, while Lab's experimental readers (for example
TabBar/panelScroll.ts:61) still read the setting alone. - Claim: Description: no app-builder API change; maintainers get the guard — verified (0 public surface rows for Core and the seven themes; guard as above).
- Claim: Description: Carousel's button and index scrolls ask the owner module on the scroller and the target — verified (
Carousel.tsx:542,:596). - Claim: Description: BottomSheet's alignment and coarse cross-fade use the hook, and the detent haptic and scroll-area settle use the element reader on the sheet — verified (
BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:149-156,:695,:1205). - Claim: Description: MobileNav asks on the dialog and AppShell uses the hook, so the close hold ends at once — verified (
MobileNav.tsx:352;AppShell.tsx:677-691). - Claim: Description: the mobile keyboard's scroll asks on the scroll body — verified (
useMobileKeyboard.ts:386). - Claim: Description: press feedback's fade bound and a fine pointer's at-once release ask on the pressed element — verified (
pressFeedback.ts:225,:567). - Claim: Description: Resizable's spring-back and close slide ask on the pane, with its inline setting-only reads gone — verified (
createResizable.ts:1314,:1410). - Claim: Description: Dialog's entrance asks the owner module and watches the setting only while open under it, never the mark — verified (
Dialog.tsx:772-786;reducedMotion.stylex.ts:98-103). - Claim: Description: the layout glide calls the owner module, which reads the element's own window, and the animator's setting-only read is documented as the setting alone — verified (
animatedLayout.ts:234;reducedMotion.stylex.ts:83-87;animator.ts:1213-1223). - Claim: Description: the keyboard-height reader is unchanged — verified (not in the diff; its allowance of 1 is used at
keyboardHeight.ts:33). - Claim: Description: the guard, recorded in the verification table, limits spellings to the owner module, the pointer-split queries, the keyboard-height reader and the theme adaptations, limits the two motion constants to their owner, lets no file but the animator's setting-only read call the element reader with no element, and keeps that setting-only read inside the motion foundation — verified (
reducedMotionReaders.test.ts:26-46,:91-124;spec.md:197). - Claim: Description: moving BottomSheetPanel, MobileNav or Resizable back to the setting alone, a template-literal keyboard read, or an AppShell read through the fade constant fails the guard — verified (each of those edits fails a guard case; the guard and those readers are unchanged since that check).
- Claim: Description: the always-mark tests for Carousel, press feedback, BottomSheet and the Resizable browser spec fail with their change reverted — tests present (
Carousel.test.tsx:704,pressFeedback.test.ts:959,BottomSheetReplace.test.tsx:1073,:1095,paneSlide.interaction.browser.spec.ts:1369); the BottomSheet cross-fade test fails with that change reverted; for the others the base code each test reaches reads the setting alone, and those red runs were not executed. - Claim: Description: first-load growth and the sheet, snap-paging and touch-support bundle guards — the guards pass; against this base the four reference pages measure docs −19 B, form −63 B, menu +104 B, table +115 B gzip; the increment changes no import.
- Claim: Description: test, type-check, lint, preflight and motion frame runs at earlier revisions — not reproduced as stated; at this head the guard, Dialog and Carousel suites, the Core type-check, and lint and formatting of the changed files pass.
- Claim: Description: the latest-revision bullet (a main merge whose copy of the first change equals its branch, Dialog's re-check before a replay, BottomSheet's cross-fade as the hook on a coarse pointer) — verified (
Dialog.tsx:783;BottomSheetPanel.tsx:1001-1002); the bullet calls an earlier commit "this head", and the code it describes is unchanged at this head. - Claim: Description: writing rubric results for the record change — present; the added row carries no narration, references or project status.
- Claim: Description: credit to the earlier design with a co-author trailer — verified (co-author trailers on three branch commits).
- File:
.changeset/reduced-motion-script-readers.md— clear - File:
docs/specs/AST-108-theme-motion/spec.md— clear (owner-approved verification row) - File:
packages/core/src/AppShell/AppShell.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheet.test.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetPanel.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetReplace.test.tsx— clear - File:
packages/core/src/BottomSheet/useSheetGestures.ts— clear - File:
packages/core/src/Carousel/Carousel.test.tsx— clear - File:
packages/core/src/Carousel/Carousel.tsx— clear (the earlier naming note at:596is fixed) - File:
packages/core/src/Dialog/Dialog.tsx— clear (the replay re-check at:783has no test; non-blocking) - File:
packages/core/src/Dialog/DialogOpenerRead.test.tsx— clear (both new tests fail on their branch's revert) - File:
packages/core/src/MobileNav/MobileNav.tsx— clear - File:
packages/core/src/Resizable/__tests__/paneSlide.interaction.browser.spec.ts— clear - File:
packages/core/src/Resizable/createResizable.ts— clear - File:
packages/core/src/keyboard/useMobileKeyboard.ts— clear - File:
packages/core/src/motion/animatedLayout.ts— clear - File:
packages/core/src/motion/animator.ts— clear - File:
packages/core/src/motion/reducedMotionReaders.test.ts— clear - File:
packages/core/src/privateAttributes/reducedMotion.stylex.ts— clear - File:
packages/core/src/utils/pressFeedback.test.ts— clear - File:
packages/core/src/utils/pressFeedback.ts— clear - File:
scripts/snap-paging-bundle.test.mjs— clear
When the setting ends after a theme's mark appeared, the entrance stays still. The case fails without the re-check.
|
/approve-spec 561c8c8 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because its checks are skipped while the pull request is a draft.
No blocking findings. The new Dialog test pins the re-check before a replayed entrance: it fails when that check is dropped and passes at this head, which closes the last open gap.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: Changeset: the listed readers (Carousel's scrolls, BottomSheet's alignment, cross-fade, haptic and settle, MobileNav's and AppShell's close hold, the keyboard scroll, press feedback's release, Resizable's close slide) read a theme's always-mark through the owner module, which loads no animator — verified (
Carousel.tsx:542,:596;BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:156,:695;MobileNav.tsx:352;AppShell.tsx:677;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1314,:1410; the owner module's imports atreducedMotion.stylex.ts:20-23). - Claim: Changeset: the guard fails a new spelling of the setting's query in any quote style beyond each listed file's count, a pointer-split constant outside its owner, and the animator's setting-only read outside the motion folder — verified (
reducedMotionReaders.test.ts:26-46,:52,:79-114; the guard passes at this head). - Claim: Changeset and description: no theme can set the always value yet, so nothing changes for anyone — verified for behaviour (
theme/motionKnobs.ts:82always resolves'system'). - Claim: Description: the first change of the pair, which adds the element and hook readers and moves the chat scroll and streaming text onto them, is already on the base branch — verified (
Chat/useChatStreamScroll.ts:38,hooks/useStreamingText.ts:18on the base). - Claim: Description: this must land before any change that lets a theme set the always value — an ordering statement nothing in the code enforces; it holds for Core's readers, while Lab's experimental readers (for example
TabBar/panelScroll.ts:61) still read the setting alone. - Claim: Description: no app-builder API change; maintainers get the guard — verified (0 public surface rows for Core and the seven themes; guard as above).
- Claim: Description: Carousel's button and index scrolls ask the owner module on the scroller and the target — verified (
Carousel.tsx:542,:596). - Claim: Description: BottomSheet's alignment and coarse cross-fade use the hook, and the detent haptic and scroll-area settle use the element reader on the sheet — verified (
BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:149-156,:695,:1205). - Claim: Description: MobileNav asks on the dialog and AppShell uses the hook, so the close hold ends at once — verified (
MobileNav.tsx:352;AppShell.tsx:677-691). - Claim: Description: the mobile keyboard's scroll asks on the scroll body — verified (
useMobileKeyboard.ts:386). - Claim: Description: press feedback's fade bound and a fine pointer's at-once release ask on the pressed element — verified (
pressFeedback.ts:225,:567). - Claim: Description: Resizable's spring-back and close slide ask on the pane, with its inline setting-only reads gone — verified (
createResizable.ts:1314,:1410). - Claim: Description: Dialog's entrance asks the owner module and watches the setting only while open under it, never the mark — verified (
Dialog.tsx:772-786;reducedMotion.stylex.ts:98-103). - Claim: Description: the layout glide calls the owner module, which reads the element's own window, and the animator's setting-only read is documented as the setting alone — verified (
animatedLayout.ts:234;reducedMotion.stylex.ts:83-87;animator.ts:1213-1223). - Claim: Description: the keyboard-height reader is unchanged — verified (not in the diff; its allowance of 1 is used at
keyboardHeight.ts:33). - Claim: Description: the guard, recorded in the verification table, limits spellings to the owner module, the pointer-split queries, the keyboard-height reader and the theme adaptations, limits the two motion constants to their owner, lets no file but the animator's setting-only read call the element reader with no element, and keeps that setting-only read inside the motion foundation — verified (
reducedMotionReaders.test.ts:26-46,:91-124;spec.md:197). - Claim: Description: moving BottomSheetPanel, MobileNav or Resizable back to the setting alone, a template-literal keyboard read, or an AppShell read through the fade constant fails the guard — verified (each of those edits fails a guard case; the guard and those readers are unchanged since that check).
- Claim: Description: the always-mark tests for Carousel, press feedback, BottomSheet and the Resizable browser spec fail with their change reverted — tests present (
Carousel.test.tsx:704,pressFeedback.test.ts:959,BottomSheetReplace.test.tsx:1073,:1095,paneSlide.interaction.browser.spec.ts:1369), and all but the browser spec pass at this head; the BottomSheet cross-fade test fails with that change reverted; for the others the base code each test reaches reads the setting alone, and those red runs were not executed. - Claim: Description: first-load growth and the sheet, snap-paging and touch-support bundle guards — the guards pass; against this base the four reference pages measure docs −19 B, form −63 B, menu +104 B, table +115 B gzip; the latest change adds no import.
- Claim: Description: test, type-check, lint, preflight and motion frame runs at earlier revisions — not reproduced as stated; at this head the guard, Dialog, Carousel, press feedback and BottomSheet replace suites, the Core type-check, and lint and formatting of the changed test file pass.
- Claim: Description: the latest-revision bullet (a main merge whose copy of the first change equals its branch, Dialog's re-check before a replay, BottomSheet's cross-fade as the hook on a coarse pointer) — verified (
Dialog.tsx:783, now pinned byDialogOpenerRead.test.tsx:197;BottomSheetPanel.tsx:1001-1002); the bullet calls an earlier commit "this head", and the code it describes is unchanged at this head. - Claim: Description: writing rubric results for the record change — present; the added row carries no narration, references or project status.
- Claim: Description: credit to the earlier design with a co-author trailer — verified (co-author trailers on three branch commits).
- File:
.changeset/reduced-motion-script-readers.md— clear - File:
docs/specs/AST-108-theme-motion/spec.md— clear (owner-approved verification row) - File:
packages/core/src/AppShell/AppShell.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheet.test.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetPanel.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetReplace.test.tsx— clear - File:
packages/core/src/BottomSheet/useSheetGestures.ts— clear - File:
packages/core/src/Carousel/Carousel.test.tsx— clear - File:
packages/core/src/Carousel/Carousel.tsx— clear - File:
packages/core/src/Dialog/Dialog.tsx— clear (each mark branch at:772-786now has a test) - File:
packages/core/src/Dialog/DialogOpenerRead.test.tsx— clear (the new replay case fails without the re-check atDialog.tsx:783) - File:
packages/core/src/MobileNav/MobileNav.tsx— clear - File:
packages/core/src/Resizable/__tests__/paneSlide.interaction.browser.spec.ts— clear - File:
packages/core/src/Resizable/createResizable.ts— clear - File:
packages/core/src/keyboard/useMobileKeyboard.ts— clear - File:
packages/core/src/motion/animatedLayout.ts— clear - File:
packages/core/src/motion/animator.ts— clear - File:
packages/core/src/motion/reducedMotionReaders.test.ts— clear - File:
packages/core/src/privateAttributes/reducedMotion.stylex.ts— clear - File:
packages/core/src/utils/pressFeedback.test.ts— clear - File:
packages/core/src/utils/pressFeedback.ts— clear - File:
scripts/snap-paging-bundle.test.mjs— clear
There was a problem hiding this comment.
Changes requested: one blocking finding, which CI found at this head now that the pull request is out of draft.
- Found by CI: the new Resizable test at
paneSlide.interaction.browser.spec.ts:1369starts recording frames at:1384, before the pointer lifts at:1385, so a frame of the edge still held past the maximum fails it; it failed the WebKit interaction leg (and with it the requiredtestcheck) and fails intermittently in Chromium too, so start that recording from a capture-phasepointeruplistener and rerun CI.
The reader changes themselves behave as intended: with frames recorded from the lift on, the edge is back at rest in the first frame. Nothing else needs to change.
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none
- Claim: Changeset: the listed readers (Carousel's scrolls, BottomSheet's alignment, cross-fade, haptic and settle, MobileNav's and AppShell's close hold, the keyboard scroll, press feedback's release, Resizable's close slide) read a theme's always-mark through the owner module, which loads no animator — verified (
Carousel.tsx:542,:596;BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:156,:695;MobileNav.tsx:352;AppShell.tsx:677;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1314,:1410; the owner module's imports atreducedMotion.stylex.ts:20-23). - Claim: Changeset: the guard fails a new spelling of the setting's query in any quote style beyond each listed file's count, a pointer-split constant outside its owner, and the animator's setting-only read outside the motion folder — verified (
reducedMotionReaders.test.ts:26-46,:52,:79-114; the guard passes at this head). - Claim: Changeset and description: no theme can set the always value yet, so nothing changes for anyone — verified for behaviour (
theme/motionKnobs.ts:82always resolves'system'). - Claim: Description: the first change of the pair, which adds the element and hook readers and moves the chat scroll and streaming text onto them, is already on the base branch — verified (
Chat/useChatStreamScroll.ts:38,hooks/useStreamingText.ts:18on the base). - Claim: Description: this must land before any change that lets a theme set the always value — an ordering statement nothing in the code enforces; it holds for Core's readers, while Lab's experimental readers (for example
TabBar/panelScroll.ts:61) still read the setting alone. - Claim: Description: no app-builder API change; maintainers get the guard — verified (0 public surface rows for Core and the seven themes; guard as above).
- Claim: Description: Carousel's button and index scrolls ask the owner module on the scroller and the target — verified (
Carousel.tsx:542,:596). - Claim: Description: BottomSheet's alignment and coarse cross-fade use the hook, and the detent haptic and scroll-area settle use the element reader on the sheet — verified (
BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:149-156,:695,:1205). - Claim: Description: MobileNav asks on the dialog and AppShell uses the hook, so the close hold ends at once — verified (
MobileNav.tsx:352;AppShell.tsx:677-691). - Claim: Description: the mobile keyboard's scroll asks on the scroll body — verified (
useMobileKeyboard.ts:386). - Claim: Description: press feedback's fade bound and a fine pointer's at-once release ask on the pressed element — verified (
pressFeedback.ts:225,:567). - Claim: Description: Resizable's spring-back and close slide ask on the pane, with its inline setting-only reads gone — verified (
createResizable.ts:1314,:1410). - Claim: Description: Dialog's entrance asks the owner module and watches the setting only while open under it, never the mark — verified (
Dialog.tsx:772-786;reducedMotion.stylex.ts:98-103). - Claim: Description: the layout glide calls the owner module, which reads the element's own window, and the animator's setting-only read is documented as the setting alone — verified (
animatedLayout.ts:234;reducedMotion.stylex.ts:83-87;animator.ts:1213-1223). - Claim: Description: the keyboard-height reader is unchanged — verified (not in the diff; its allowance of 1 is used at
keyboardHeight.ts:33). - Claim: Description: the guard, recorded in the verification table, limits spellings to the owner module, the pointer-split queries, the keyboard-height reader and the theme adaptations, limits the two motion constants to their owner, lets no file but the animator's setting-only read call the element reader with no element, and keeps that setting-only read inside the motion foundation — verified (
reducedMotionReaders.test.ts:26-46,:91-124;spec.md:197). - Claim: Description: moving BottomSheetPanel, MobileNav or Resizable back to the setting alone, a template-literal keyboard read, or an AppShell read through the fade constant fails the guard — verified (each of those edits fails a guard case).
- Claim: Description: the always-mark tests for Carousel, press feedback, BottomSheet and the Resizable browser spec fail with their change reverted — tests present (
Carousel.test.tsx:704,pressFeedback.test.ts:959,BottomSheetReplace.test.tsx:1073,:1095,paneSlide.interaction.browser.spec.ts:1369); the unit tests pass at this head and the BottomSheet cross-fade test fails with its change reverted; the Resizable case is false as evidence: it records frames from before the lift and fails intermittently (the blocking finding). - Claim: Description: first-load growth and the sheet, snap-paging and touch-support bundle guards — the guards pass at this head; against this base the four reference pages measure docs −19 B, form −63 B, menu +104 B, table +115 B gzip.
- Claim: Description: test, type-check, lint, preflight and motion frame runs, including the Resizable browser spec passing 30/30 twice — false for the Resizable spec at this head (its new case failed the WebKit interaction leg and 3 of 9 Chromium runs); the touched unit suites (93 files) and the bundle guards pass, and CI's type-check, lint, unit and Chromium interaction legs pass.
- Claim: Description: the latest-revision bullet (a main merge whose copy of the first change equals its branch, Dialog's re-check before a replay, BottomSheet's cross-fade as the hook on a coarse pointer) — verified (
Dialog.tsx:783, pinned byDialogOpenerRead.test.tsx:197;BottomSheetPanel.tsx:1001-1002); the bullet calls an earlier commit "this head", and the code it describes is unchanged at this head. - Claim: Description: writing rubric results for the record change — present; the added row carries no narration, references or project status.
- Claim: Description: credit to the earlier design with a co-author trailer — verified (co-author trailers on three branch commits).
- File:
.changeset/reduced-motion-script-readers.md— clear - File:
docs/specs/AST-108-theme-motion/spec.md— clear (owner-approved verification row) - File:
packages/core/src/AppShell/AppShell.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheet.test.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetPanel.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetReplace.test.tsx— clear - File:
packages/core/src/BottomSheet/useSheetGestures.ts— clear - File:
packages/core/src/Carousel/Carousel.test.tsx— clear - File:
packages/core/src/Carousel/Carousel.tsx— clear - File:
packages/core/src/Dialog/Dialog.tsx— clear (each mark branch at:772-786has a test) - File:
packages/core/src/Dialog/DialogOpenerRead.test.tsx— clear (the replay case fails without the re-check atDialog.tsx:783) - File:
packages/core/src/MobileNav/MobileNav.tsx— clear - File:
packages/core/src/Resizable/__tests__/paneSlide.interaction.browser.spec.ts— Found by CI: the case at:1369records frames from before the lift and fails intermittently (blocking) - File:
packages/core/src/Resizable/createResizable.ts— clear (the edge is back at rest in the first frame after the lift under the mark) - File:
packages/core/src/keyboard/useMobileKeyboard.ts— clear - File:
packages/core/src/motion/animatedLayout.ts— clear - File:
packages/core/src/motion/animator.ts— clear - File:
packages/core/src/motion/reducedMotionReaders.test.ts— clear - File:
packages/core/src/privateAttributes/reducedMotion.stylex.ts— clear - File:
packages/core/src/utils/pressFeedback.test.ts— clear - File:
packages/core/src/utils/pressFeedback.ts— clear - File:
scripts/snap-paging-bundle.test.mjs— clear
…r the lift In WebKit a frame can run between the start of the recording and the lift's dispatch; that frame still shows the edge past the limit. Each recorded frame now says whether the page had heard the pointer's lift, and the case checks only those.
|
/approve-spec 8e0e4ec |
There was a problem hiding this comment.
Approved pending CI: required CI is still running on this head.
No blocking findings. The Resizable reduced-motion browser test that failed CI's WebKit leg on the previous revision now passes that leg on this head, and nothing else needs to change.
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none
- Claim: Changeset: the listed readers (Carousel's scrolls, BottomSheet's alignment, cross-fade, haptic and settle, MobileNav's and AppShell's close hold, the keyboard scroll, press feedback's release, Resizable's close slide) read a theme's always-mark through the owner module, which loads no animator — verified (
Carousel.tsx:542,:596;BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:156,:695;MobileNav.tsx:352;AppShell.tsx:677;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1314,:1410; the owner module's imports atreducedMotion.stylex.ts:20-23). - Claim: Changeset: the guard fails a new spelling of the setting's query in any quote style beyond each listed file's count, a pointer-split constant outside its owner, and the animator's setting-only read outside the motion folder — verified (
reducedMotionReaders.test.ts:26-46,:52,:79-114). - Claim: Changeset and description: no theme can set the always value yet, so nothing changes for anyone — verified (
theme/motionKnobs.ts:82always resolves'system'). - Claim: Description: the first change of the pair, which adds the element and hook readers and moves the chat scroll and streaming text onto them, is already on the base branch — verified (
Chat/useChatStreamScroll.ts:38,hooks/useStreamingText.ts:18on the base). - Claim: Description: this must land before any change that lets a theme set the always value — an ordering statement nothing in the code enforces; it holds for Core's readers, while Lab's experimental readers (for example
TabBar/panelScroll.ts:61) still read the setting alone. - Claim: Description: no app-builder API change; maintainers get the guard — verified (no public surface rows for Core or the seven themes; guard as above).
- Claim: Description: Carousel's button and index scrolls ask the owner module on the scroller and the target — verified (
Carousel.tsx:542,:596). - Claim: Description: BottomSheet's alignment and coarse cross-fade use the hook, and the detent haptic and scroll-area settle use the element reader on the sheet — verified (
BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:149-156,:695,:1205). - Claim: Description: MobileNav asks on the dialog and AppShell uses the hook, so the close hold ends at once — verified (
MobileNav.tsx:352;AppShell.tsx:677-691). - Claim: Description: the mobile keyboard's scroll asks on the scroll body — verified (
useMobileKeyboard.ts:386). - Claim: Description: press feedback's fade bound and a fine pointer's at-once release ask on the pressed element — verified (
pressFeedback.ts:225,:567). - Claim: Description: Resizable's spring-back and close slide ask on the pane, with its inline setting-only reads gone — verified (
createResizable.ts:1314,:1410). - Claim: Description: Dialog's entrance asks the owner module and watches the setting only while open under it, never the mark — verified (
Dialog.tsx:772-786;reducedMotion.stylex.ts:98-103). - Claim: Description: the layout glide calls the owner module, which reads the element's own window, and the animator's setting-only read is documented as the setting alone — verified (
animatedLayout.ts:234;reducedMotion.stylex.ts:80-90;animator.ts:1213-1224). - Claim: Description: the keyboard-height reader is unchanged — verified (not in the diff; its allowance of 1 is used at
keyboardHeight.ts:33). - Claim: Description: the guard, recorded in the verification table, limits spellings to the owner module, the pointer-split queries, the keyboard-height reader and the theme adaptations, limits the two motion constants to their owner, lets no file but the animator's setting-only read call the element reader with no element, and keeps that setting-only read inside the motion foundation — verified (
reducedMotionReaders.test.ts:26-46,:91-124;spec.md:197). - Claim: Description: moving BottomSheetPanel, MobileNav or Resizable back to the setting alone, a template-literal keyboard read, or an AppShell read through the fade constant fails the guard — verified (each of those edits fails a guard case).
- Claim: Description: the always-mark tests for Carousel, press feedback, BottomSheet and the Resizable browser spec fail with their change reverted — verified for the Resizable case (it fails against the base's Resizable and passes at this head, in CI's WebKit leg too) and the BottomSheet cross-fade case; the others rest on the base code each test reaches, which reads the setting alone.
- Claim: Description: first-load growth and the sheet, snap-paging and touch-support bundle guards — against this base the four reference pages measure docs −19 B, form −63 B, menu +104 B, table +115 B gzip, all under the 0.3 KB allowance.
- Claim: Description: test, type-check, lint, preflight and motion frame runs, including the Resizable browser spec passing 30/30 — verified where they bear on this head: CI's type-check, lint and both WebKit interaction legs pass here, the Resizable spec passes 30 of 30 in WebKit and in Chromium, and the guard and the mark-on unit files pass.
- Claim: Description: the latest-revision bullet (a main merge whose copy of the first change equals its branch, Dialog's re-check before a replay, BottomSheet's cross-fade as the hook on a coarse pointer) — verified (
Dialog.tsx:783, pinned byDialogOpenerRead.test.tsx:197;BottomSheetPanel.tsx:1001-1002); the bullet names an earlier commit as the current one, and each code statement in it holds at this head. - Claim: Description: writing rubric results for the record change — present; the added row carries no narration, references or project status.
- Claim: Description: credit to the earlier design with a co-author trailer — verified (co-author trailers on branch commits).
- File:
.changeset/reduced-motion-script-readers.md— clear - File:
docs/specs/AST-108-theme-motion/spec.md— clear (owner-approved verification row) - File:
packages/core/src/AppShell/AppShell.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheet.test.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetPanel.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetReplace.test.tsx— clear - File:
packages/core/src/BottomSheet/useSheetGestures.ts— clear - File:
packages/core/src/Carousel/Carousel.test.tsx— clear - File:
packages/core/src/Carousel/Carousel.tsx— clear - File:
packages/core/src/Dialog/Dialog.tsx— clear (each mark branch at:772-786has a test) - File:
packages/core/src/Dialog/DialogOpenerRead.test.tsx— clear (the replay case fails without the re-check atDialog.tsx:783) - File:
packages/core/src/MobileNav/MobileNav.tsx— clear - File:
packages/core/src/Resizable/__tests__/paneSlide.interaction.browser.spec.ts— clear (the always case judges only frames after the lift at:1399; it passes in WebKit and Chromium at this head and fails against the base's Resizable) - File:
packages/core/src/Resizable/createResizable.ts— clear - File:
packages/core/src/keyboard/useMobileKeyboard.ts— clear - File:
packages/core/src/motion/animatedLayout.ts— clear - File:
packages/core/src/motion/animator.ts— clear - File:
packages/core/src/motion/reducedMotionReaders.test.ts— clear - File:
packages/core/src/privateAttributes/reducedMotion.stylex.ts— clear - File:
packages/core/src/utils/pressFeedback.test.ts— clear - File:
packages/core/src/utils/pressFeedback.ts— clear - File:
scripts/snap-paging-bundle.test.mjs— clear
|
/approve-spec e7a4048 |
There was a problem hiding this comment.
Approved pending CI: required CI started when this pull request left draft and is still running on this head; the merge guard waits for it to pass.
No blocking findings. The code is unchanged since the last review, every Reduce Motion reader still decides through the mark's owner module with a test for each, and CI has reported no failure so far.
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none
- Claim: Changeset: the listed readers (Carousel's scrolls, BottomSheet's alignment, cross-fade, haptic and settle, MobileNav's and AppShell's close hold, the keyboard scroll, press feedback's release, Resizable's close slide) read a theme's always-mark through the owner module, which loads no animator — verified (
Carousel.tsx:542,:596;BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:156,:695;MobileNav.tsx:349;AppShell.tsx:682;useMobileKeyboard.ts:386;pressFeedback.ts:225,:567;createResizable.ts:1314,:1410; the owner module's imports atreducedMotion.stylex.ts:20-23). - Claim: Changeset: the guard fails a new spelling of the setting's query in any quote style beyond each listed file's count, a pointer-split constant outside its owner, and the animator's setting-only read outside the motion folder — verified (
reducedMotionReaders.test.ts:26-46,:52,:79-114; it passes over Core's source at this head). - Claim: Changeset and description: no theme can set the always value yet, so nothing changes for anyone — verified (
theme/motionKnobs.ts:82always resolves'system'). - Claim: Description: the first change of the pair, which adds the element and hook readers and moves the chat scroll and streaming text onto them, is already on the base branch — verified (
Chat/useChatStreamScroll.ts:38on the base imports the hook reader). - Claim: Description: this must land before any change that lets a theme set the always value — an ordering statement nothing in the code enforces; it holds for Core's readers, while Lab's experimental readers (for example
TabBar/panelScroll.ts:61) still read the setting alone. - Claim: Description: no app-builder API change; maintainers get the guard — verified (no public surface rows for Core or the seven themes; guard as above).
- Claim: Description: Carousel's button and index scrolls ask the owner module on the scroller and the target — verified (
Carousel.tsx:542,:596). - Claim: Description: BottomSheet's alignment and coarse cross-fade use the hook, and the detent haptic and scroll-area settle use the element reader on the sheet — verified (
BottomSheetPanel.tsx:846,:1001-1002;useSheetGestures.ts:149-156,:695,:1205). - Claim: Description: MobileNav asks on the dialog and AppShell uses the hook, so the close hold ends at once — verified (
MobileNav.tsx:349;AppShell.tsx:680-696). - Claim: Description: the mobile keyboard's scroll asks on the scroll body — verified (
useMobileKeyboard.ts:386). - Claim: Description: press feedback's fade bound and a fine pointer's at-once release ask on the pressed element — verified (
pressFeedback.ts:225,:567). - Claim: Description: Resizable's spring-back and close slide ask on the pane, with its inline setting-only reads gone — verified (
createResizable.ts:1314,:1410). - Claim: Description: Dialog's entrance asks the owner module and watches the setting only while open under it, never the mark — verified (
Dialog.tsx:772-786;reducedMotion.stylex.ts:98-103). - Claim: Description: the layout glide calls the owner module, which reads the element's own window, and the animator's setting-only read is documented as the setting alone — verified (
animatedLayout.ts:234;reducedMotion.stylex.ts:80-90;animator.ts:1213-1224). - Claim: Description: the keyboard-height reader is unchanged — verified (not in the diff; its allowance of 1 is used at
keyboardHeight.ts:33). - Claim: Description: the guard, recorded in the verification table, limits spellings to the owner module, the pointer-split queries, the keyboard-height reader and the theme adaptations, limits the two motion constants to their owner, lets no file but the animator's setting-only read call the element reader with no element, and keeps that setting-only read inside the motion foundation — verified (
reducedMotionReaders.test.ts:26-46,:91-124;spec.md:197). - Claim: Description: moving BottomSheetPanel, MobileNav or Resizable back to the setting alone, a template-literal keyboard read, or an AppShell read through the fade constant fails the guard — verified (each such edit is counted by the pattern at
reducedMotionReaders.test.ts:52or the constant case at:91). - Claim: Description: the always-mark tests for Carousel, press feedback, BottomSheet and the Resizable browser spec fail with their change reverted — verified for the Resizable case and the BottomSheet cross-fade case; the others rest on the base code each test reaches, which reads the setting alone; all pass at this head.
- Claim: Description: first-load growth and the sheet, snap-paging and touch-support bundle guards — against this base the four reference pages measure docs −21 B, form −66 B, menu −6 B, table +78 B gzip, all under the 0.3 KB allowance, and the three bundle guards pass at this head.
- Claim: Description: test, type-check, lint, preflight and motion frame runs at earlier revisions — verified where they bear on this head: the touched suites (117 files, 2,831 tests) and Core's build, which type-checks it, pass here; CI's lint passes on this head and its other checks are still running.
- Claim: Description: the latest-revision bullet (a main merge whose copy of the first change equals its branch, Dialog's re-check before a replay, BottomSheet's cross-fade as the hook on a coarse pointer) — each code statement holds at this head (
Dialog.tsx:783, pinned byDialogOpenerRead.test.tsx:197;BottomSheetPanel.tsx:1001-1002); the bullet names an earlier commit as the current one. - Claim: Description: writing rubric results for the record change — present; the added row carries no narration, references or project status.
- Claim: Description: credit to the earlier design with a co-author trailer — verified (co-author trailers on branch commits).
- File:
.changeset/reduced-motion-script-readers.md— clear - File:
docs/specs/AST-108-theme-motion/spec.md— clear (owner-approved verification row) - File:
packages/core/src/AppShell/AppShell.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheet.test.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetPanel.tsx— clear - File:
packages/core/src/BottomSheet/BottomSheetReplace.test.tsx— clear - File:
packages/core/src/BottomSheet/useSheetGestures.ts— clear - File:
packages/core/src/Carousel/Carousel.test.tsx— clear - File:
packages/core/src/Carousel/Carousel.tsx— clear - File:
packages/core/src/Dialog/Dialog.tsx— clear (each mark branch at:772-786has a test) - File:
packages/core/src/Dialog/DialogOpenerRead.test.tsx— clear - File:
packages/core/src/MobileNav/MobileNav.tsx— clear - File:
packages/core/src/Resizable/__tests__/paneSlide.interaction.browser.spec.ts— clear (the always case judges only frames after the lift at:1399) - File:
packages/core/src/Resizable/createResizable.ts— clear - File:
packages/core/src/keyboard/useMobileKeyboard.ts— clear - File:
packages/core/src/motion/animatedLayout.ts— clear - File:
packages/core/src/motion/animator.ts— clear - File:
packages/core/src/motion/reducedMotionReaders.test.ts— clear - File:
packages/core/src/privateAttributes/reducedMotion.stylex.ts— clear - File:
packages/core/src/utils/pressFeedback.test.ts— clear - File:
packages/core/src/utils/pressFeedback.ts— clear - File:
scripts/snap-paging-bundle.test.mjs— clear
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.
Second of two stacked pull requests for
spec:AST-108FR6 (every script reader honours a theme'sreducedMotion: 'always'). Stacked on #9763, which addsreducesMotion(element)anduseReducesMotion()in the reduced-motion mark's owner module (privateAttributes/reducedMotion.stylex.ts, which loads no animator, theme or StyleX module) and moves the chat scroll and streaming text onto them. This is internal: no theme can setreducedMotion: 'always'yet, so there is no behavior change.Stack order: #9763, then this one. This pull request must merge before any change that lets a theme set
reducedMotion: 'always', so no theme can reach the state where only some readers honour it.User impact
'always'ships, every script-driven motion below reduces for everyone under that theme, as it already does for a person whose Reduce Motion setting is on.What changes
Each reader now decides through the mark's owner module, which counts the theme's mark beside the setting and loads no animator:
reducesMotionon the scroller and the target).useReducesMotion), the coarse-pointer cross-fade (useReducesMotionon a coarse pointer), and the detent haptic and the scroll-area settle inuseSheetGestures(reducesMotionon the sheet).reducesMotionon the dialog) and AppShell (useReducesMotion): the close hold ends at once.reducesMotionon the scroll body).reducesMotionon the pressed element).reducesMotionon the pane), with its inline setting-only reads gone.reducesMotion(dialog)instead of spelling the setting's query, and watches the setting through the owner module's newwatchReduceMotionSettingonly while it is open under the setting (a theme's mark is not watched), so the listener stays open-only.motion/animatedLayout.ts) callsreducesMotion(area), which now reads the element's own window, instead of its own copy of the rule.defaultPrefersReducedMotion's comment says it is the setting alone.keyboard/keyboardHeight.tsreads the setting to recognise how Chrome on Android reports a keyboard under the OS's Remove animations, which a theme does not change.Evidence
motion/reducedMotionReaders.test.ts(new guard), recorded inspec:AST-108's verification table: no core source file spells the setting's query in script, in any quote style, beyond its listed count (the owner module,motion/reducedMotion.ts's pointer-split queries,keyboardHeight, which detects how Chrome reports a keyboard, andthemeAdaptations, which writes CSS); no file but its owner usesREDUCED_MOTION_FADE_QUERYorREDUCED_MOTION_INSTANT_QUERY; no file but the animator's setting-only read callsreducesMotion()with no element; and no file outside the motion foundation calls the animator's setting-only read. Moving BottomSheetPanel, MobileNav or Resizable back to the setting alone fails it, and so do a template-literal read inuseMobileKeyboardand an AppShell read throughREDUCED_MOTION_FADE_QUERY.'always'with the setting off (each red with that component's change reverted):Carousel.test.tsx:scrollNextscrolls withbehavior: 'auto';pressFeedback.test.ts: a finger's release keeps the Reduce Motion bound;BottomSheetReplace.test.tsx: a coarse pointer's exit ends on its opacity fade, and the replaced sheet does not move down to a shorter entering sheet;paneSlide.interaction.browser.spec.ts(Chromium): the edge past the maximum returns at the lift with no spring-back frame.architecture:component-import-boundaries),node scripts/measure-reference-pages.mjsagainstmain3786705 for the whole stack, gzip: docs +74 B, form +24 B, menu +64 B, table +108 B; Carousel +112 B, a Markdown page +115 B. The bundle guardslazy-sheet-bundle,snap-paging-bundle(whose pager-only list no longer holds the owner module, which every reader loads),touch-support-bundleand Slider's touch-layer test pass.scripts/motion-node-load.test.mjspasses; the Resizable browser spec passes 30/30 twice.tsc, the repo'spnpm lint, check:knowledge and prettier pass.main3786705): review:pre, build, typecheck, lint, vitest ui, knowledge and changesets pass. vitest node passes except offline-media's two real-browser cases, which need the machine's proxy unset (24/24 without it), andpacked-gather-cache.npm-packed, the main-wide failure test(cli): keep the packed-gather-cache CLI from installing the published Core in the background #13136 fixes. Scoped browser specs (Carousel, BottomSheet, MobileNav, AppShell, Resizable and the reduced-motion specs): 85 interaction pass (1 skipped) and 206 of 207 a11y;BottomSheetPinchZoom"a pinch across the body and the handle, body finger first" failed once and passed 3 of 3 alone. Since 9a4a091 this branch also took the guard and its verification row, refactor(core): a theme's reducedMotion 'always' reaches the hooks that hold no element; the chat scroll and streaming text read it #9763's main merge (b312f7b), the Dialog entrance and layout glide reads above, the owner module's element-window read andwatchReduceMotionSetting, thedefaultPrefersReducedMotioncomment, and the guard's dropped layout-glide allowance.useReducesMotion()on a coarse pointer (the hook already includes the setting), so its setting-only query and the guard's allowance for it go. Core tsc 0; ui 6,538/6,538 across the touched suites at 90afc09, then BottomSheet, motion, Dialog and the theme readers 1,871/1,871 at this head; PR Review's motion re-take (row glide, Dialog and full-screen Dialog open, scrim reveal and fade, BottomSheet open): default matchesmainframe for frame, and'always'and the setting settle in one frame.Writing rubric results
Credit
Continues @vjeux's design from #8895. Co-authored-by trailer on the commit.
Owner: fix-loop lane 0. Land path: after #9763; Specs stamp, CodeBunny, preflight, then the drain.