Repository navigation
Conversation
useChatKeyboard places the dock and the transcript through utils/deferredMotionEngine.ts, which writes their translate until the runtime loads and then hands the same place to a motion engine from the runtime. Before the load a keyboard transition moves the dock at once with the layout instead of riding the keyboard's slide. wheelStrip uses the same helper. Chat reaches no touch module statically; INV13 names the helper and states the before-load ride, AST-099 Gap 13 says the same, and the gap line names only Slider.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec d2a1200 |
|
Decision: D-20261113-316 Records the owner's answer that the touch runtime loads once per page after first paint, never on demand, for Chat's keyboard ride at d2a1200. Until it loads, Chat's dock moves with the layout at once instead of riding the on-screen keyboard's slide (only Chrome on Android reports the slide); this pre-load behavior is also on the owner's queued pre-load card. It waives nothing. |
There was a problem hiding this comment.
Changes requested: deferring Chat's keyboard ride to the shared touch runtime is sound, and the record changes are approved at this head, but Chat never asks for that runtime to load.
- Blocking: Nothing ChatLayout mounts calls
useTouchRuntime(), so on a page with no other touch component (theFull AI chatstory, for one) the runtime never loads and the dock never rides the keyboard in Chrome on Android, not just for the first 2 s (packages/core/src/Chat/useChatKeyboard.ts:276-277); calluseTouchRuntime()once inuseChatKeyboardand add a test that renders ChatLayout without thebeforeAllpreload and checks the ride after first paint and idle.
Non-blocking: AST-099 Gap 13 lists the before-load dock behavior as an open gap while FR8 states it as the requirement, so keeping it in FR8 alone would be clearer.
Claims and files checked
- Claim: Chat no longer reaches a touch module statically: verified (boundary test passes here and fails on the base).
- Claim: The dock and transcript are placed through the new helper, which writes
translateuntil the load and then hands the same place to an engine: verified (deferredMotionEngine.ts:43-89,useChatKeyboard.ts:276-291). - Claim: The wheels' strip uses the same helper and no local copy remains: verified (
wheelStrip.ts:311,:336-349). - Claim: No behavior change after the load, and no API change: verified (code comparison and ride tests; the API generator lists no rows).
- Claim: Pages with ChatLayout ship less JavaScript before first paint: verified for the static graph (boundary test); no byte count taken.
- Claim: The before-load window lasts until first paint, then idle, at most 2 s: false for a ChatLayout page with no other touch component, where the runtime never loads (Chromium and jsdom probes).
- Claim: Only Chrome on Android is affected, the same result Safari on iOS gives today: verified (
useChatKeyboard.ts:331-347). - Claim:
followrides only when both engines exist: verified (useChatKeyboard.ts:276-291). - Claim: The architecture record names the helper and shrinks the gap line to Slider, and the keyboard record states the same for Chat: verified (diff).
- Claim: The allowlist keeps two entries, both Slider: verified.
- Claim: The new tests fail on the base: verified (three failures on the base with these tests and allowlist).
- Claim: Chat, DateInput, TimeInput, keyboard and touch-runtime suites, typecheck, lint and knowledge checks pass: verified.
- Claim: Record prose is in the present tense: verified.
- File:
packages/core/src/utils/deferredMotionEngine.ts: clear - File:
packages/core/src/Chat/useChatKeyboard.ts: blocking finding above - File:
packages/core/src/Chat/useChatKeyboard.test.tsx: itsbeforeAllpreload hides the blocking finding - File:
packages/core/src/DateInput/wheelStrip.ts: clear (same behavior; its wheel schedules the load) - File:
packages/core/src/utils/touchRuntime.boundary.test.ts: clear - File:
internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear - File:
docs/architecture/react-component-runtime.md: clear - File:
docs/specs/AST-099-mobile-keyboard/spec.md: non-blocking note above
| if (!transition.animated) { | ||
| // The ride's motion comes with the shared touch runtime, which loads | ||
| // after first paint. Until then the dock moves with the layout at once. | ||
| const dockEngine = dock.animator.engine(); |
There was a problem hiding this comment.
Blocking. engine() only reads getTouchRuntime(). The load is scheduled only from useTouchRuntime()'s mount effect, and nothing ChatLayout or ChatComposer mounts calls it. On a page with no other touch component, such as the Full AI chat story, the runtime stays null, and every keyboard show and hide takes the non-animated branch below for good. Calling useTouchRuntime() once in useChatKeyboard, as PickerWheel and Switch do, schedules the page's one load.
| beforeAll(async () => { | ||
| await __loadTouchRuntimeForTest(); | ||
| }); |
There was a problem hiding this comment.
This preload is why the suite passes while a real ChatLayout page never loads the runtime. Keep it for the ride tests, and add one test without it: render ChatLayout, run the first paint and the idle callback, then check that the next keyboard show rides.
| keyboard, and Chat's dock moves with the layout at once instead of riding | ||
| the keyboard's slide. |
There was a problem hiding this comment.
Non-blocking: FR8's new last sentence states this as the requirement, so listing it here as an open gap leaves a reader unsure whether it is intended. Consider keeping it in FR8 only.
|
/approve-spec c17823b |
|
/approve-spec d99b2ce |
There was a problem hiding this comment.
Changes requested: deferring Chat's keyboard ride to the shared touch runtime is sound, and the record changes are approved at this head, but Chat never asks for that runtime to load.
- Blocking: Nothing ChatLayout mounts calls
useTouchRuntime(), so on a page with no other touch component (theFull AI Chatstory, for one) the runtime never loads and the dock never rides the keyboard in Chrome on Android, not just for the first 2 s (packages/core/src/Chat/useChatKeyboard.ts:276-277); calluseTouchRuntime()once inuseChatKeyboardand add a test that renders ChatLayout without thebeforeAllpreload and checks the ride after first paint and idle. - Newly live check: the new shared module
utils/deferredMotionEngine.tsneeds its first-load gzip deltas, base against head, in the description; measured at this head, the Table, Text and Button entries are unchanged, ChatLayout drops 13,793 B, DateInput grows 3 B and TimeInput 19 B, so those numbers can go in as they are.
Non-blocking: AST-099 Gap 13 lists the before-load dock behavior as an open gap while FR8 states it as the requirement, so keeping it in FR8 alone would be clearer.
Claims and files checked
- Claim: Chat no longer reaches a touch module statically: verified (boundary test passes here and fails on the base).
- Claim: The dock and transcript are placed through the new helper, which writes
translateuntil the load and then hands the same place to an engine: verified (deferredMotionEngine.ts:43-89,useChatKeyboard.ts:276-291). - Claim: The helper exposes
setY,getY,element,attachandengine(), andengine()stays null until the load: verified (deferredMotionEngine.ts:20-35,:47-57). - Claim:
followrides only when both engines exist and otherwise sets the place at once and commits: verified (useChatKeyboard.ts:276-291). - Claim: The wheels' strip uses the same helper: verified (
wheelStrip.ts:139-148,:310). - Claim: No behavior change after the load, and no API change: verified (code comparison, the Chat, DateInput and TimeInput suites, and the API generator listing no rows).
- Claim: Pages with ChatLayout download less JavaScript before first paint: verified (ChatLayout's eager first load drops from 89,611 to 75,818 bytes gzip).
- Claim: The before-load window lasts until first paint, then idle, at most 2 s: false for a ChatLayout page with no other touch component, where the runtime never loads (Chromium and jsdom probes).
- Claim: Only Chrome on Android is affected, matching what Safari on iOS gives today: verified (
useChatKeyboard.ts:334-337). - Claim: The architecture record adds the Chat clause, names the helper and leaves only Slider in its gap line, and the keyboard record states the same for Chat: verified (record diff).
- Claim: The allowlist keeps two entries, both Slider: verified.
- Claim: The new tests fail on the base: verified (exactly three failures on the base with these tests and allowlist).
- Claim: The Chat, DateInput, TimeInput, keyboard and touch-runtime suites, typecheck, lint and knowledge checks pass: verified (1,723 tests in 62 files; Core typecheck, eslint on the changed files and the knowledge check pass).
- Claim: Record prose is in the present tense: verified.
- File:
packages/core/src/utils/deferredMotionEngine.ts: clear - File:
packages/core/src/Chat/useChatKeyboard.ts: blocking finding above - File:
packages/core/src/Chat/useChatKeyboard.test.tsx: itsbeforeAllpreload hides the blocking finding - File:
packages/core/src/DateInput/wheelStrip.ts: clear - File:
packages/core/src/utils/touchRuntime.boundary.test.ts: clear - File:
internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear - File:
docs/architecture/react-component-runtime.md: clear - File:
docs/specs/AST-099-mobile-keyboard/spec.md: non-blocking note above
# Conflicts: # docs/architecture/react-component-runtime.md
# Conflicts: # internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json
|
/approve-spec 70918e4 |
There was a problem hiding this comment.
Changes requested: Chat's keyboard ride now waits for the shared touch runtime, but nothing in Chat asks that runtime to load, and two description claims are out of date.
- Blocking: Nothing ChatLayout mounts calls
useTouchRuntime(), so on a page with no other touch component the runtime never loads and the dock never rides the on-screen keyboard in Chrome on Android, not just for the first 2 s (packages/core/src/Chat/useChatKeyboard.ts:276-277); calluseTouchRuntime()once inuseChatKeyboardand add a test that renders ChatLayout without thebeforeAllpreload and checks that the next keyboard show rides after first paint and idle. - Regression: The description's "the allowlist (2 entries left, both Slider)" and "the gap line now names only Slider" are false at this head, where the allowlist keeps AlertDialog's entry beside Slider's two and INV13's gap line names AlertDialog and Slider.
The record edits now carry an engineering owner's approval at this head, which also settles the record for the new utils/deferredMotionEngine.ts helper. The fix will be a new commit, so an engineering owner records the decision again by commenting /approve-spec <full head SHA> on that head, which the author may do as an engineering owner. Please also add the new shared module's first-load gzip deltas to the description: ChatLayout −13,803 B, DateInput +4 B and TimeInput −1 B, with the reference-page components unchanged.
Claims and files checked
Review mode: same-head; reason: none
- Claim: Chat no longer reaches a touch module statically: verified (the boundary case passes; the base imports the animator statically).
- Claim: the dock and transcript are placed through the new helper, which writes
translateuntil the load and then hands the same place to a motion engine: verified (deferredMotionEngine.ts:43-89,useChatKeyboard.ts:276-291). - Claim: the helper exposes
setY,getY,element,attachandengine(), andengine()stays null until the load and then creates the engine at the shown place: verified (deferredMotionEngine.ts:20-35,:47-57). - Claim: the ride plays only when both engines exist, and otherwise the place is set at once and committed: verified (
useChatKeyboard.ts:276-291). - Claim: the wheels' strip uses the same helper, so the concern lives in one module: verified (
wheelStrip.ts:139-148,:310). - Claim: no behavior change after the load and no API change: verified (code comparison, the Chat, DateInput and TimeInput suites, and an API comparison of both builds with no rows).
- Claim: pages with ChatLayout download less JavaScript before first paint: verified (ChatLayout's eager first load drops from 89,688 to 75,885 bytes gzip).
- Claim: the before-load window lasts until first paint, then idle, at most 2 s: false for a ChatLayout page with no other touch component, where the runtime never loads.
- Claim: only Chrome on Android is affected, matching what Safari on iOS already does: verified (
useChatKeyboard.ts:334-337). - Claim: the architecture record adds the Chat before-load clause and a line naming the helper: verified (
react-component-runtime.md:359-360,:368-371). - Claim: the architecture record's gap line now names only Slider: false (it names AlertDialog and Slider,
react-component-runtime.md:381-382). - Claim: the keyboard record states the same for Chat's dock: verified (FR8's new last sentence and Gap 13).
- Claim: the allowlist keeps two entries, both Slider: false (three entries, including AlertDialog's).
- Claim: the new boundary case and the rule's real-tree test fail on the base: verified by reading (the base imports the animator statically and still lists Chat's entry).
- Claim: a test moves the dock at once with no ride before the runtime loads, and the suite loads the runtime up front: verified (
useChatKeyboard.test.tsx:40-42,:332-351). - Claim: the Chat, DateInput, TimeInput, keyboard and touch-runtime suites pass: verified (1,722 tests at this head; the rule's tests pass too).
- Claim: core typecheck, eslint and the knowledge check pass: verified.
- Claim: the record edits have an engineering owner's approval: verified at this head.
- Claim: record prose is in the present tense: verified.
- Claim: public text and artifacts contain no internal context: verified.
- File:
packages/core/src/Chat/useChatKeyboard.ts: blocking finding above. - File:
packages/core/src/Chat/useChatKeyboard.test.tsx: itsbeforeAllpreload hides the blocking finding. - File:
packages/core/src/utils/deferredMotionEngine.ts: clear. - File:
packages/core/src/DateInput/wheelStrip.ts: clear. - File:
packages/core/src/utils/touchRuntime.boundary.test.ts: clear. - File:
internal/eslint-plugin-astryx/no-static-touch-runtime.allowlist.json: clear; the description miscounts what it keeps. - File:
docs/architecture/react-component-runtime.md: clear, approved at this head. - File:
docs/specs/AST-099-mobile-keyboard/spec.md: clear, approved at this head.
Primary intent
Performance, stacked on #11536: Chat stops importing the animator statically.
useChatKeyboardplaces the composer dock and the transcript through a small shared helper,utils/deferredMotionEngine.ts. It writes theirtranslateuntil the touch runtime loads, then hands the same place to a motion engine from the runtime. The wheels' strip (#11536) moves onto the same helper. 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: "Chat's dock moves with the layout at once instead of riding the on-screen keyboard's slide" (recommended: keep; it's the same result Safari on iOS gives today).
Problem and solution fit
useChatKeyboardcreated two motion engines up front (createMotionEngine) for the dock and the transcript, which put the animator in every ChatLayout page's first load.createDeferredMotionEngine()exposessetY,getY,element,attachandengine(). Before the load,setYwritestranslatedirectly (the animator's own format).engine()returns null until the runtime has loaded; at the first call after that, it creates the engine at the place the element shows.followrides the keyboard only when both engines exist. Otherwise it takes the existing non-animated path (set at once, commit).wheelStripused a local copy of the same placement in perf(core): the date and time wheels' drag and spin come with the touch runtime #11536; it now uses this helper, so the concern lives in one module (INV16).Authority
architecture:react-component-runtimeINV13: the before-load sentence adds the Chat clause, a why-line namesutils/deferredMotionEngine.ts, and the gap line now names only Slider.spec:AST-099Gap 13 states the same for Chat's dock.spec:AST-080DEC-5 (amended).Change and evidence
utils/deferredMotionEngine.ts(new),Chat/useChatKeyboard.ts,DateInput/wheelStrip.ts, the allowlist (2 entries left, both Slider), the boundary test, INV13 and AST-099.Scope
Components: Chat (ChatLayout's keyboard ride), DateInput (wheelStrip uses the shared helper)
Testing
Red first, failing on #11536's head:
utils/touchRuntime.boundary.test.ts: the Chat entry reaches no touch module statically.Also:
useChatKeyboard.test.tsx: "moves the dock at once with no ride before the touch runtime loads". The suite loads the runtime inbeforeAll.check:knowledgepass.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.