Repository navigation
Conversation
Slider renders useSliderTouch as a runtime part once the runtime has loaded, so the thumbs' pans, the track's tap, the lift and the coast no longer sit in its first load. Until then a press takes the pointer handlers: a press on the track sets the value and a mouse drag moves a thumb, with no finger drag on a thumb, no lift and no coast; a press on a thumb still changes no value. No Core component now reaches the animator or the gesture host statically: the allowlist is empty and INV13's gap line is gone. INV13 and Slider FR7 state the before-load behavior.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 3136856 |
|
Decision: D-20261113-321 Records the owner's answer that the touch runtime loads once per page after first paint, never on demand, for Slider at 3136856, the last component behind the loader. Until it loads, a press on the track sets the value and a mouse drag moves a thumb, with no finger drag on a thumb, lift or coast. It waives nothing. |
There was a problem hiding this comment.
Requesting changes: Slider's touch tracking moves behind the shared touch runtime cleanly after the runtime loads, but before it loads a thumb press that moves changes the value.
Blocking
- Before the touch runtime loads, a press on a Slider thumb that moves at all changes the value: in Chromium, a mouse press 8 px off-centre plus a 1 px move goes from 50 to 53, and a finger press 20 px off-centre plus a 3 px wobble goes to 59, because
Slider.tsx:1166-1168guards only the press and the firstpointermovewrites the pointer's own position (:1261), which contradicts the new FR7 sentence ("no finger drag on a thumb … a press on a thumb still changes no value"); keep touch and pen thumb presses out of the pre-load drag and give the mouse drag FR7's grab offset and 10 px start, or amend FR7 with a new owner approval.
Also worth fixing in the same pass: a finger swipe that starts on the track now sets the value before the load (it commits on the press, so a page scroll commits 88 where the base sets nothing); the new before-load test drives the finger with touch events only, which never reach the pointer handlers; and touchRuntimeModules.tsx's header does not list Slider.
Claims and files checked
- Claim: Slider renders its touch tracking as a runtime part once the loader has loaded it. Verified:
Slider.tsx:1404-1407,touchRuntimeModules.tsx:302-321. - Claim: no Core component reaches the animator or the gesture host statically, and the allowlist is empty. Verified: boundary test, rule test and allowlist file.
- Claim: no behavior change after the load, and no API change. Verified: identical Chromium frames after the load; the API generator reports 0 rows.
- Claim: less JavaScript before first paint. Verified at the module-graph level by the bundle test; not measured.
- Claim: before the load, a press or tap on the track sets the value. Verified.
- Claim: before the load, a mouse drag moves a thumb. Verified, but the thumb jumps to the pointer (blocking).
- Claim: before the load, a finger doesn't drag a thumb. False for small moves (blocking).
- Claim: no lift and no coast before the load. Verified: the runtime part is not mounted.
- Claim: a thumb press in the pointer path keeps its value. False once the press moves (blocking).
- Claim: the bundle test checks the controller's one import site in the runtime graph and its absence from Slider's graph. Verified.
- Claim: the new tests fail on the base. Consistent with the base source; not re-run.
- Claim: the Slider and touch-runtime suites, typecheck, lint and the record check pass. Verified: 224 tests, build typecheck, eslint, knowledge check.
- Claim: the records are in present tense. Verified.
- Claim: the WebKit slow-release stall is pre-existing. Not checked; outside this change.
- File
docs/architecture/react-component-runtime.md: clear. - File
docs/specs/components/Slider/Slider.spec.md: clear; the code does not meet its new sentence (blocking). - File
internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear. - File
packages/core/src/Slider/Slider.tsx: blocking finding; one comment-style suggestion. - File
packages/core/src/Slider/sliderTouchBundle.test.ts: clear. - File
packages/core/src/Slider/useSliderTouch.test.tsx: the before-load test misses a finger's pointer events. - File
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File
packages/core/src/utils/touchRuntimeModules.tsx: header does not list Slider.
| // A press on a thumb changes no value; only its drag does. | ||
| if (parks || pressedThumbIndex < 0) { | ||
| updateValue(thumbIndex, parks ? values[thumbIndex] : newVal); | ||
| } |
There was a problem hiding this comment.
Blocking: this guard covers only the press. Before the runtime loads, the first pointermove (handlePointerMove, line 1261) writes the pointer's own position, with no 10 px start and no grab offset. In Chromium, a mouse press 8 px right of the thumb's centre plus a 1 px move commits 53 from 50. A finger press 20 px off-centre on the 48 px target plus a 3 px wobble commits 59. Both fire onChangeEnd. FR7's new sentence says a press on a thumb still changes no value and that a finger does not drag a thumb before the load. Suggested fix: before the load, a touch or pen press on a thumb focuses it and returns, as after the load. A mouse thumb press records its press point and the thumb's value, then moves by travel once 10 px is crossed.
| } | ||
| if (e.pointerType === 'touch' || e.pointerType === 'pen') { | ||
| return; | ||
| if (touchRuntime != null) { |
There was a problem hiding this comment.
Non-blocking: before the load, a finger's track press now commits on pointerdown, so a vertical page scroll that starts on the track commits the value under the finger (88 in Chromium, with onChangeEnd). Base sets nothing there. If touch and pen track presses commit on lift and pointercancel commits nothing, a tap still sets the value and a scroll does not.
| // The thumbs' pans, the track's tap, the lift and the coast come with the | ||
| // shared touch runtime, which loads after first paint. Until then a press | ||
| // takes the pointer handlers: a press on the track sets the value, and a | ||
| // mouse drag moves the thumb, with no lift and no coast. |
There was a problem hiding this comment.
Non-blocking (comment style): the second sentence runs 29 words over three topics. Suggested: "Until then a press takes the pointer handlers. A press on the track sets the value. A mouse drag moves the thumb, with no lift and no coast."
| detachAcross(); | ||
| }); | ||
|
|
||
| it('before the touch runtime loads, a finger drag on a thumb moves nothing and a mouse press on it changes no value', async () => { |
There was a problem hiding this comment.
Non-blocking: this test drives the finger with touchstart/touchmove only. jsdom raises no pointer events for those, so it never reaches the pointer handlers a real finger reaches before the load. A pointerType: 'touch' press on the thumb with a small pointerMove fails today (the value moves).
|
/approve-spec 9f44395 |
|
/approve-spec f34e122 |
There was a problem hiding this comment.
Requesting changes: Slider's touch tracking now comes with the shared touch runtime and nothing changes once the runtime has loaded, but the pointer path that serves presses before the load lets a thumb press that moves change the value.
Blocking
- Before the touch runtime loads, a thumb press that moves even 1 px jumps the value to the pointer and fires
onChangeandonChangeEnd(in Chromium, a mouse press 8 px off-centre plus a 1 px move goes from 30 to 33, and a finger press 20 px off-centre plus a 3 px move goes from 30 to 37), becausehandlePointerDownskips only the press (Slider.tsx:1166-1168) whilehandlePointerMovewrites the pointer's own position on the first move (Slider.tsx:1261), which contradicts FR7's new sentence ("no finger drag on a thumb … a press on a thumb still changes no value") and its travel clause.
Suggested fix: before the load, return early for a touch or pen press on a thumb (focusing it, as after the load), start a mouse thumb drag only after the 10 px threshold and move it by travel from where it was grabbed, and add a pointerType: 'touch' thumb press with a small pointermove to the before-load test, which today drives the finger with touch events only. A finger scroll that starts on the track also commits a value before the load; committing touch and pen track presses on lift, and nothing on pointercancel, would avoid that.
Claims and files checked
Claims:
- Slider renders its touch tracking as a touch-runtime part once the loader has loaded the runtime: verified (
Slider.tsx:1404-1407,touchRuntimeModules.tsx:302-310). - No Core component reaches the animator or the gesture host statically, the allowlist is empty and INV13's gap line is gone: verified (the rule's real-tree test passes with the empty allowlist; the boundary test covers Slider).
- Nothing changes after the load and there is no API change: verified (Chromium frames identical after the load; the API generator lists no rows).
- A page with a Slider downloads less JavaScript before first paint: verified (Slider import 113,609 B to 72,708 B gzip).
- Before the load, a press on the track sets the value and a mouse drag moves a thumb, with no lift and no coast: verified.
- Before the load, a finger does not drag a thumb: false (finger press plus a 3 px move: 30 to 37).
- A press on a thumb still changes no value: false once the press moves (1 px: 30 to 33).
- The bundle test checks that the controller is imported only from
useSliderTouchwithin the runtime's graph and is absent from Slider's own graph: verified. - The boundary, bundle and lint-rule tests fail without this change: verified (they fail with the base's code and pass at this head).
- The new before-load test shows a finger drag on a thumb moves nothing: false as evidence (it sends touch events only, which reach no pointer handler in jsdom).
- The Slider and touch-runtime suites (214 tests) and the rule test pass, and typecheck, eslint and the knowledge check pass: verified.
- A WebKit slow-release stall is pre-existing and unrelated: not checked.
Files:
docs/architecture/react-component-runtime.md: clear.docs/specs/components/Slider/Slider.spec.md: clear (the code contradicts its new sentence, above).internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear.packages/core/src/Slider/Slider.tsx: the blocking finding above; the comment at lines 833-836 could split its 29-word sentence.packages/core/src/Slider/sliderTouchBundle.test.ts: clear.packages/core/src/Slider/useSliderTouch.test.tsx: the before-load test misses the finger's pointer path.packages/core/src/utils/touchRuntime.boundary.test.ts: clear.packages/core/src/utils/touchRuntimeModules.tsx: clear; its header's list of touch parts omits Slider.
# Conflicts: # docs/architecture/react-component-runtime.md
# Conflicts: # internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json
|
/approve-spec 48ea800 |
There was a problem hiding this comment.
Review on hold: Slider's touch tracking moves behind the shared touch runtime cleanly — after the runtime loads, behaviour and frames match the base, and the Slider import's first load drops from 117,057 B to 77,006 B gzip — but the record changes this pull request proposes carry no owner approval at this head, and two findings need changes whatever that decision is.
Approval needs an engineering owner to approve, at this head, architecture:react-component-runtime INV13's new before-load clause for Slider, its gap line and lint allowlist keeping AlertDialog's animator import alone, and component:Slider FR7's new before-load sentence: main still has components import the touch modules statically and an FR7 with no before-load sentence. The approval given at an earlier head no longer counts, because two commits followed it; an engineering owner records the decision by commenting /approve-spec with this pull request's full head SHA, and the author may do so if they are an engineering owner.
Blocking
- Before the touch runtime loads, a thumb press that moves even 1 px jumps the value to the pointer and fires
onChangeandonChangeEnd(in Chromium, a mouse press 8 px off the thumb's centre plus a 1 px move goes from 30 to 33, and a Pixel 7 finger press 20 px off-centre plus a 3 px move goes from 30 to 37), becausehandlePointerDownskips only the press (Slider.tsx:1166-1168) whilehandlePointerMovewrites the pointer's own position on the first move (Slider.tsx:1261), which contradicts FR7's new sentence ("no finger drag on a thumb … a press on a thumb still changes no value") and its travel clause. - The description says the lint allowlist is empty, that INV13's gap line is gone and that no Core component reaches the animator or the gesture host statically, which is false at this head: AlertDialog's
useAlertMotionstill imports the animator, the allowlist keeps that entry and INV13 keeps a gap line for it, so the wording should say that Slider leaves the allowlist and AlertDialog stays.
Suggested fix for the first one: before the load, return early for a touch or pen press on a thumb (focusing it, as after the load), start a mouse thumb drag only after the 10 px threshold and move it by travel from where it was grabbed, and add a pointerType: 'touch' thumb press with a small pointermove to the before-load test, which today drives the finger with touch events only and so passes. A finger scroll that starts on the track also commits a value before the load; committing touch and pen track presses on lift, and nothing on pointercancel, would avoid that.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Slider renders its touch tracking as a touch-runtime part once the loader has loaded the runtime: verified (
Slider.tsx:1404-1407,touchRuntimeModules.tsx:302-310). - No Core component reaches the animator or the gesture host statically, the allowlist is empty and INV13's gap line is gone: false (AlertDialog's
useAlertMotionstill imports the animator; the allowlist and the gap line keep it). - Nothing changes after the load, and there is no API change: verified (post-load frames pixel-identical to the base; the API generator lists 0 rows for every published package).
- A page with a Slider downloads less JavaScript before first paint: verified (117,057 B to 77,006 B gzip).
- Before the load, a press on the track sets the value and a mouse drag moves a thumb, with no lift and no coast: verified.
- Before the load, a finger does not drag a thumb: false (a finger press plus a 3 px move goes from 30 to 37).
- Before the load, a press on a thumb still changes no value: false once that press moves (1 px: 30 to 33).
- The bundle test checks that the controller is imported only from
useSliderTouchinside the runtime's graph and is absent from Slider's own graph: verified. - The boundary, bundle and lint-rule tests fail without this change: verified (all four cases fail with the base's code and the head's tests, and pass at this head).
- The new before-load test shows that a finger drag on a thumb moves nothing: false as evidence (it sends touch events only, which reach no pointer handler in jsdom).
- The Slider and touch-runtime suites pass, and typecheck, eslint and the knowledge check pass: verified (213 tests in that scope here, against the 214 the description reports).
- A WebKit slow-release stall is pre-existing and unrelated: not checked.
Files:
docs/architecture/react-component-runtime.md: clear; the Slider clause and the AlertDialog-only gap line match the code, and they need the owner decision above.docs/specs/components/Slider/Slider.spec.md: clear as text (the code contradicts its new sentence, above); the other rows change only in padding.internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear; the two Slider entries go and AlertDialog's stays, which the rule's real-tree test confirms.packages/core/src/Slider/Slider.tsx: the blocking finding above; the comment at lines 833-836 runs 29 words over three topics.packages/core/src/Slider/sliderTouchBundle.test.ts: clear.packages/core/src/Slider/useSliderTouch.test.tsx: the before-load test misses the finger's pointer path.packages/core/src/utils/touchRuntime.boundary.test.ts: clear.packages/core/src/utils/touchRuntimeModules.tsx: clear; its file header's list of touch parts omits Slider.
There was a problem hiding this comment.
Changes requested: Slider's touch tracking moves behind the shared touch runtime cleanly — after the runtime loads, behaviour and frames match the base, the Slider import's first load drops from 117,057 B to 77,006 B gzip, and an engineering owner has approved the record changes at this head — but two findings need fixing.
Blocking
- Before the touch runtime loads, a thumb press that moves even 1 px jumps the value to the pointer and fires
onChangeandonChangeEnd(in Chromium, a mouse press 8 px off the thumb's centre plus a 1 px move goes from 30 to 33, and a Pixel 7 finger press 20 px off-centre plus a 3 px move goes from 30 to 37), becausehandlePointerDownskips only the press (Slider.tsx:1165-1168) whilehandlePointerMovewrites the pointer's own position on the first move (Slider.tsx:1261), which contradicts FR7's new sentence ("no finger drag on a thumb … a press on a thumb still changes no value") and its travel clause. - The description says the lint allowlist is empty, that INV13's gap line is gone and that no Core component reaches the animator or the gesture host statically, which is false at this head because AlertDialog's
useAlertMotionstill imports the animator and the allowlist and INV13's gap line keep it, so the wording should say that Slider leaves the allowlist and AlertDialog stays.
Suggested fix for the first one: before the load, return early for a touch or pen press on a thumb (focusing it, as after the load), start a mouse thumb drag only after the 10 px threshold and move it by travel from where it was grabbed, and add a pointerType: 'touch' thumb press with a small pointermove to the before-load test, which today drives the finger with touch events only and so passes. A finger scroll that starts on the track also commits a value before the load; committing touch and pen track presses on lift, and nothing on pointercancel, would avoid that.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Slider renders its touch tracking as a touch-runtime part once the loader has loaded the runtime: verified (
Slider.tsx:1404-1407,touchRuntimeModules.tsx:307-321). - No Core component reaches the animator or the gesture host statically, the allowlist is empty and INV13's gap line is gone: false (AlertDialog's
useAlertMotionstill imports the animator; the allowlist and the gap line keep it). - Nothing changes after the load, and there is no API change: verified (post-load frames pixel-identical to the base; the API generator lists no rows for any published package).
- A page with a Slider downloads less JavaScript before first paint: verified (117,057 B to 77,006 B gzip).
- Before the load, a press on the track sets the value and a mouse drag moves a thumb, with no lift and no coast: verified.
- Before the load, a finger does not drag a thumb: false (a finger press plus a 3 px move goes from 30 to 37).
- Before the load, a press on a thumb still changes no value: false once that press moves (1 px: 30 to 33).
- Before the load, thumb, touch and pen presses take the pointer path instead of the absent controller: verified (
Slider.tsx:1098-1106). - The bundle test checks that the controller is imported only from
useSliderTouchinside the runtime's graph and is absent from Slider's own graph: verified (sliderTouchBundle.test.ts:88-95). - INV13 gains the Slider clause and FR7 carries the before-load line: verified; INV13's gap line stays for AlertDialog.
- The boundary, bundle and lint-rule tests fail without this change: verified (they fail with the base's code and the head's tests, and pass at this head).
- The new before-load test shows that a finger drag on a thumb moves nothing: false as evidence (it sends touch events only, which reach no pointer handler in jsdom).
- The Slider and touch-runtime suites pass, and typecheck, eslint and the knowledge check pass: verified (213 tests in that scope, against the 214 the description reports).
- A WebKit slow-release stall is pre-existing and unrelated: not checked.
Files:
docs/architecture/react-component-runtime.md: clear; the Slider clause and the AlertDialog-only gap line match the code and are owner-approved at this head.docs/specs/components/Slider/Slider.spec.md: clear as text (the code contradicts its new sentence, above); the other rows change only in padding.internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear; the two Slider entries go and AlertDialog's stays, which the rule's real-tree test confirms.packages/core/src/Slider/Slider.tsx: the first blocking finding above; the comment at lines 833-836 runs 29 words over three topics.packages/core/src/Slider/sliderTouchBundle.test.ts: clear.packages/core/src/Slider/useSliderTouch.test.tsx: the before-load test misses the finger's pointer path.packages/core/src/utils/touchRuntime.boundary.test.ts: clear.packages/core/src/utils/touchRuntimeModules.tsx: clear; its file header's list of touch parts omits Slider.
Primary intent
Performance, stacked on #11540, and the last component in the touch-loader stack: Slider renders its touch tracking (
useSliderTouch: the thumbs' pans, the track's tap, the lift and the coast) as a touch-runtime part, once the shared loader has loaded the runtime. With this, no Core component reaches the animator or the gesture host statically. The lint rule's allowlist is empty, and INV13's gap line is gone. No behavior changes after the load, and there's no API change.User or maintainer impact
Before-load behavior for the pre-load decision card: "a Slider takes a press on its track and a mouse drag on a thumb through its pointer handlers, with no finger drag on a thumb, no lift and no coast" (recommended: keep).
Problem and solution fit
Slider.tsxcalleduseSliderTouch, whose controller imports the gesture host and the animator. It now builds the same options and renderstouchRuntime.SliderTouchwith them, which calls the unchanged hook.handlePointerDownno longer hands thumb presses and touch or pen presses to the absent controller; they take the pointer path. A press on a thumb in that path keeps its value, so FR7's rule still holds.sliderTouchBundle.test.tsnow checks that the controller is imported only fromuseSliderTouchwithin the runtime's graph, and that Slider's own graph doesn't contain it.Authority
architecture:react-component-runtimeINV13: the before-load sentence adds the Slider clause, and the gap line is removed (the lint rule sentence stays).component:SliderFR7 carries the line.spec:AST-080DEC-5 (amended).Change and evidence
Slider/Slider.tsx,utils/touchRuntimeModules.tsx(SliderTouch), the allowlist (now empty),sliderTouchBundle.test.ts,useSliderTouch.test.tsx, the boundary test, INV13 and Slider FR7.Scope
Components: Slider
Testing
Red first, failing on #11540's head:
utils/touchRuntime.boundary.test.ts: the Slider entry reaches no touch module statically.sliderTouchBundle.test.ts: "keeps the touch layer out of Slider's static graph".Also:
useSliderTouch.test.tsx: "before the touch runtime loads, a finger drag on a thumb moves nothing and a mouse press on it changes no value". The suite loads the runtime inbeforeAll.check:knowledgepass.Note: a pre-existing WebKit slow-release stall at a 335 px track, which main shows too, is unrelated to this change and is tracked separately.
Writing rubric results
Owner and land path
Owner: the Astryx fix loop, lane 3. Lands after #8690 merges, in stack order (#11450, #11463, #11466, #11476, #11478, #11508, #11518, #11525, #11530, #11536, #11540, #11544), each after Specs, CodeBunny at its head and green CI; the drain merges.