Repository navigation
Conversation
A build that defines __ASTRYX_TOUCH__ as false presents every component the pointer way and leaves out each touch layer imported through the guard touchLayers.ts documents. Without the define nothing changes. The browser support guide covers the build settings, device routing and the Next.js caveat.
…aved draft The section's last sentence ended on "saves", which matches "saved" in the main searcher's "toast notice for a saved draft" query. The section took the 20th result from a shorter doc and grew that answer past the lexical ranker's, which the main searcher's byte check rejects. The sentence now ends on "is worth"; a guard test pins that the guide is found for its own topic and not for that query.
…ind it through one internal hook @astryxdesign/core/touch-support exports TouchSupport: install() (idempotent, a no-op on the server, adds no listeners) and isInstalled(), nothing else. The module (main's gesture core; the animator joins it) sits in one module-level registry that components read only through the internal useTouchSupport hook, null on the server and until installed. Lint keeps the internals to Core and Lab, and the exports map holds only the public entry. A bundle test pins that core's root, hooks and utils entries and a component reading the hook carry none of the module, and that an install carries it. Replaces this branch's __ASTRYX_TOUCH__ define, resolver change and guide section, which the install makes unnecessary.
CI-Rerun: one RTL story navigation timed out in pr-rtl (core 2/3) of run 40273227303; it does not reproduce at this tree.
…ere a coarse pointer is present install() registers the module now where some input is a coarse pointer (any-pointer: coarse), and otherwise waits on that query's change event, registering once a coarse pointer appears (a tablet attached to a laptop), so a page used only with a mouse registers nothing. isInstalled() reports whether install() ran. The doc comment says layout and presence motion works without it. Tests cover a fine-pointer page and one that gains a coarse pointer later.
…sture core Core's root, hooks and utils entries are checked to carry none of the touch module (touch-support/touchModule.ts) until an app installs TouchSupport: an entry that imports the module, directly or through TouchSupport, still fails. Whether an entry carries the gesture core itself is a separate check, held until components have moved onto the module, so this check does not fail a component that still imports a recognizer directly. Glue on useTouchSupport is still checked to carry neither the module nor the gesture core.
…d shared tables; useTouchLayer runs a one-element layer touchModule gains the pan recognizer and velocity tracker, the spring, decay, projection and rubber-band math, the motion roles, and the shared UIKit tables, so a component's touch glue takes every primitive it needs off the installed module. useTouchLayer(ref, setup) runs a one-element layer's setup once the module is installed and the element is mounted, re-runs it only when either changes, and cleans up on unmount; resetTouchSupportForTests() forgets an install, and the install-ran flag moves into the registry so it does too. The bundle test checks that glue on either hook carries none of the gesture core or motion math, and that the install entry carries all of it.
…n a story without it
Storybook's preview installs TouchSupport before any story renders, as an app's client entry does, unless the URL global touchSupport:off turns it off. The interaction harness's openStory takes OpenStoryOptions {touchSupport: false} to set it, building the globals as key:value pairs, so a browser spec can check a component's plain behavior.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
CI-Rerun: Vercel's deployment of 1a0c61d failed on Vercel's side; that head changed only a test file, and the branches pushed in the same second deployed.
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Approval waits on an engineering owner's spec decision: the public @astryxdesign/core/touch-support entry and its page-level touch module follow architecture:react-component-runtime INV13, which is not on main yet and is only proposed in #8464. An engineering owner can settle it by landing INV13 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so too if they are an engineering owner), and that decision should say whether install() may still ship the module's code to mouse-only pages. Whatever the decision, please address:
- The changeset and
TouchSupport's doc say people using only a mouse pay nothing, but the statictouchModuleimport ships about 13.2 KB gzip with every page that importsTouchSupport. resetTouchSupportForTests()leaves an earlier fine-pointer install's media-query listener attached, so a later coarse pointer registers the module whileisInstalled()isfalse.useTouchLayerdoes not follow an element that a child swaps without the host re-rendering.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `@astryxdesign/core/touch-support` exports `TouchSupport`, the one install for the global touch and gesture module. Call `TouchSupport.install()` once in your client entry, before you render or hydrate. It registers the module only where some input is a coarse pointer, or once one appears, so people using only a mouse pay nothing. It can be called more than once, does nothing on the server, and `TouchSupport.isInstalled()` reports whether it ran. A page that never installs it carries none of the module and keeps every component's current behavior. Components take their touch behavior from the module in their own releases. |
There was a problem hiding this comment.
This says people using only a mouse pay nothing, but touch-support/index.ts imports touchModule statically, so every page that imports TouchSupport ships the whole module (about 13.2 KB gzip with the size report's esbuild options) whatever its pointer; only registration waits for a coarse pointer. Wording that says what holds would avoid misleading app authors, for example that it registers nothing for people using only a mouse while the module's code still ships with the entry that imports it.
| * keep their plain behavior and stay fully usable, and a tap still acts as | ||
| * a click. | ||
| * - Layout and presence motion works without it. | ||
| * - People using only a mouse pay nothing: `install()` registers the module |
There was a problem hiding this comment.
Same claim as the changeset: the static import {touchModule} from './touchModule' on line 14 puts the module in any bundle that imports TouchSupport, so mouse-only visitors download it; only registration is skipped.
There was a problem hiding this comment.
The doc says so now (ce1641a): the module's code ships with this entry, so a page that imports it sends that code to every visitor, one using only a mouse included.
| * Forgets the install, as on a fresh page, and tells every reader. For tests | ||
| * only; it is not on `TouchSupport`. | ||
| */ | ||
| export function resetTouchSupportForTests(): void { |
There was a problem hiding this comment.
This clears ran and the module, but an earlier install() on a fine-pointer page keeps its (any-pointer: coarse) change listener (index.ts lines 66-72). If a coarse pointer appears after the reset, the module registers while isInstalled() is false. Keeping the pending listener where the reset can remove it, plus a fine-pointer reset test, would give the fresh page the doc promises.
There was a problem hiding this comment.
Fixed in 8b0ca63: the registry keeps the waiting registration's cancel, and the reset calls it. A new test installs on a fine-pointer page, resets, then adds a coarse pointer: no listener is left, nothing registers, and isInstalled() stays false. It fails without the fix.
| // After every render: attach, detach, or move to a new element. Comparing | ||
| // the module and the element keeps a re-render from setting up again. | ||
| useIsomorphicLayoutEffect(() => { | ||
| const element = ref.current; |
There was a problem hiding this comment.
ref.current is read only after the host renders, so if the ref sits on an element a child swaps through its own state, the new element never gets the layer and the detached one keeps it until unmount. Either document that the ref must be on an element the host renders, or return a callback ref that owns attach and replacement.
There was a problem hiding this comment.
Documented in 8b0ca63: the ref goes on an element its own component renders, and an element a child replaces through its own state needs the hook in that child.
The module holds the gesture core and no component uses it yet; the module's code ships with the entry, so a page that imports it sends that code to every visitor, and only registration waits for a coarse pointer. The doc no longer promises an animator, components' touch behavior or Reduce Motion handling, which arrive in later releases.
…ng for a coarse pointer; useTouchLayer says where its ref goes An install on a fine-pointer page waits with one (any-pointer: coarse) change listener. The reset left it attached, so a coarse pointer appearing after a reset registered the module while isInstalled() read false. The registry now keeps that registration's cancel, and the reset calls it. useTouchLayer follows its ref's element after each render of its own component, so its doc says the ref must be on an element that component renders. TouchSupport's doc names the motion functions the module now carries.
There was a problem hiding this comment.
Approval waits on an engineering owner's spec decision: the public @astryxdesign/core/touch-support entry and its page-level touch module follow architecture:react-component-runtime INV13, which is not on main yet and is only proposed in #8464, and making component touch behavior wait for an app's install departs from spec:AST-094's "without an opt-in" until that proposal is adopted. An engineering owner can settle it by landing INV13 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so too if they are an engineering owner), and that decision should say whether install() may keep shipping the module's code to mouse-only pages, because the draft says such a page "loads nothing" and asks the docs to promise mouse-only visitors "pay nothing", while this branch documents the opposite. The earlier points about the changeset wording, the test reset and useTouchLayer's ref are addressed, and no other code change is needed.
[Automated review]
|
Posted by Cindy's agent on her behalf. Thanks, vjeux. Cindy has simplified the touch model: there's no install step. The gesture and touch code is a set of reusable internal modules that components import directly, and the bundler keeps one copy per page. That replaces
What this means per PR:
If these stay idle, we'll make the changes after about 30 minutes, keeping your authorship on the commits. |
…ntry @astryxdesign/core/internal/touch exports useTouchSupport and the touch module's type, so a Lab component reaches the module the way a Core component does. Like every internal entry, it is undocumented, outside the public API, and allowed by lint only in Core and Lab, which now refuses @astryxdesign/core/internal/* elsewhere in place of the old touch-support/* ban. sync-exports lists it with the other file subpaths. A component that reads the module through it still carries none of the gesture core.
There was a problem hiding this comment.
Approval waits on an engineering owner’s spec decision: the new @astryxdesign/core/internal/touch entry exports a gesture and motion module that spec:AST-017 FR21 on main says is never exported and that architecture:public-component-api INV12 treats as public once reachable, and the bundle test rules out the lazy import() that architecture:component-style-authoring INV6 and spec:AST-080 DEC-4 still allow. #8464, which updates those records, has an engineering owner’s approval on its head but is not merged yet, so an engineering owner can settle this by landing #8464 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so too if they are an engineering owner). Whatever the decision, one fix is needed in touchSupportRegistry.ts: readPointer() caches the (pointer: coarse) answer even when no layer is subscribed, so a layer first rendered inside a hidden <Activity> keeps a stale answer and can attach under a fine primary pointer (spec:AST-094 FR19); reading the query’s live matches instead of a cached boolean, with a test for that case, fixes it.
[Automated review]
| function readPointer(): boolean { | ||
| if (isCoarse === null) { | ||
| query = | ||
| typeof window === 'undefined' || typeof window.matchMedia !== 'function' | ||
| ? null | ||
| : window.matchMedia(TOUCH_QUERY); | ||
| isCoarse = query?.matches ?? false; | ||
| } | ||
| return isCoarse; | ||
| } |
There was a problem hiding this comment.
readPointer() caches isCoarse on any read, but only subscribeTouchModule adds the change listener. A render whose effects never run, such as a layer inside a hidden <Activity>, leaves an answer nothing updates: if the pointer turns fine before the layer shows, it sets up with the module under a fine primary pointer (spec:AST-094 FR19) and stays attached until the pointer changes again, and the coarse case gets no setup. Since the snapshot is only ever the frozen module or null, reading the query live removes the stale path:
function readPointer(): boolean {
query ??=
typeof window === 'undefined' || typeof window.matchMedia !== 'function'
? null
: window.matchMedia(TOUCH_QUERY);
return query?.matches ?? false;
}A hidden-<Activity> case in useTouchLayer.test.tsx would pin it.
useSyncExternalStore reads the snapshot on renders no commit follows (a layer first rendered in a hidden Activity), before anything subscribes. The registry kept that answer, so after the pointer changed a layer could attach under a fine primary pointer (spec:AST-094 FR19). A read with no subscriber now asks the media query afresh and keeps nothing; the first subscriber reads and follows it. The new test fails on the previous head. Co-authored-by: Christopher Chedeau <[email protected]>
There was a problem hiding this comment.
Approval waits on an engineering owner's spec decision: the new @astryxdesign/core/internal/touch entry exports a gesture and motion module that spec:AST-017 FR21 on main says is never exported and that architecture:public-component-api INV12 treats as public once reachable, and the bundle test rules out the lazy import() that architecture:component-style-authoring INV6 and spec:AST-080 DEC-4 still allow. #8464 updates those records but is not merged, so an engineering owner can settle this by landing #8464 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so too if they are an engineering owner). The registry change fixes the earlier stale-pointer problem and no other code change is required; re-reading the pointer in useTouchLayer's attach effect would also remove one setup and cleanup that can still run when a hidden <Activity> is shown under a fine pointer.
[Automated review]
| * banding) and the motion roles; no UIKit table, since a component imports | ||
| * only the rows it uses (architecture:component-style-authoring INV6) |
There was a problem hiding this comment.
The module lists no UIKit table itself, but its members read UIKit rows, and because touchModule is one frozen object an adopter carries all of them: an internal/touch import holds 425 B of motion/uikit/gestures.ts (the tap, long-press, pan and velocity rows) and 219 B of motion/uikit/scroll.ts, where a tap recognizer imported directly holds 179 B of gesture rows and no scroll table. So "a component imports only the rows it uses" holds for direct imports, not for a component that adopts this module (architecture:component-style-authoring INV6's table-rows sentence).
| useIsomorphicLayoutEffect(() => { | ||
| const element = ref.current; | ||
| const attached = attachedRef.current; | ||
| if (attached?.touch === touch && attached.element === element) { | ||
| return; | ||
| } | ||
| attached?.cleanup(); | ||
| attachedRef.current = | ||
| touch !== null && element !== null | ||
| ? {touch, element, cleanup: setupRef.current(touch, element)} | ||
| : null; | ||
| }); |
There was a problem hiding this comment.
One case still runs the layer under a fine pointer: a layer first rendered inside a hidden <Activity> while the pointer was coarse, shown after it turned fine without re-rendering, gets one setup and one cleanup during the reveal, because this effect uses the hidden render's snapshot until React's post-subscribe check re-renders. Nothing stays attached. Re-reading the answer here removes it, and the existing tests still pass:
const live = touch === null ? null : getTouchModule(); // the pointer now, not at renderthen use live in place of touch for the comparison and the setup.
The attach effect used the render's snapshot, so a layer rendered in a hidden Activity under a coarse pointer and shown after the pointer turned fine ran one setup and cleanup during the reveal (spec:AST-094 FR19). The effect now reads the pointer itself. A reveal test covers the case (jsdom does not reproduce the stale snapshot, so it passes before and after). Co-authored-by: Christopher Chedeau <[email protected]>
…ith no gathering object architecture:component-style-authoring INV6 (UIKit tables ship only the rows a component uses) and the maintainer's direction that internal modules are imported statically, each with one job, with no grab-bag object: a frozen touchModule made every adopter carry every member it held, and the rows they read. internal/touch now re-exports the gesture core's primitives by name, so a bundler keeps one copy per page and only what a component uses; touch-support/touchModule.ts goes. The entry test moves to internal/touch.test.ts and checks the named re-exports, no gathering object and no listeners on load; the bundle test imports GestureArena by name. Co-authored-by: Christopher Chedeau <[email protected]>
… useTouchLayer Rebuilt on meta#8465's direction (architecture:component-style-authoring INV6; each module one job, imported statically): there is no touchModule object, so this PR drops its gathering too and keeps only useTouchLayer and its registry. A layer's setup gets the element alone and imports the touch modules it uses itself; the registry answers whether a layer runs now (isTouchLayerActive: the primary pointer is coarse), with resetTouchSupportForTests kept as the internal test reset. The pointer read, the Activity re-read and the fine-pointer tests are unchanged. Co-authored-by: Christopher Chedeau <[email protected]>
There was a problem hiding this comment.
Approval waits on an engineering owner's spec decision: the new @astryxdesign/core/internal/touch entry exports Core's gesture core, which spec:AST-017 FR21 on main says is never exported and architecture:public-component-api INV12 treats as public once reachable, and the bundle test bans the lazy import() that architecture:component-style-authoring INV6 and spec:AST-080 DEC-4 still allow. #8464 updates those records and carries an engineering owner's approval for its own head but is not merged, so an engineering owner can settle this by landing #8464 or by commenting /approve-spec <full head SHA> on this pull request (the author, an engineering owner, may do so too). useTouchLayer itself needs no change; one suggested test fix: the hidden-<Activity> test in useTouchLayer.test.tsx still passes with the attach-time pointer re-read removed, because its rerender renders Layer again, and revealing a memoized Layer through parent state makes it catch that.
[Automated review]
| ); | ||
| turn(false); | ||
| await act(async () => { | ||
| view.rerender( |
There was a problem hiding this comment.
This passes even with the attach-time re-read at useTouchLayer.ts:70 removed (const live = isActive;): this rerender renders Layer again, and that render already reads the fine pointer. The re-read matters when the reveal does not render the layer again. Revealing a memoized layer through parent state covers that case, passes on this head and fails without the re-read (memo and useState join the react import):
const turn = primaryPointer(true);
const {setup, Layer} = recorder();
// Memoized, so the reveal shows the hidden render without rendering again.
const Hidden = memo(Layer);
let show: (visible: boolean) => void = () => {};
function Host() {
const [visible, setVisible] = useState(false);
show = setVisible;
return (
<Activity mode={visible ? 'visible' : 'hidden'}>
<Hidden />
</Activity>
);
}
render(<Host />);
turn(false);
await act(async () => {
show(true);
});
expect(setup).not.toHaveBeenCalled();… the layer again The reveal test rerendered the layer, and that render already read the fine pointer, so it passed without the attach-time re-read. A memoized layer revealed through its parent's state shows the hidden render as it was; the test now fails when the effect uses the render's answer. Co-authored-by: Christopher Chedeau <[email protected]>
There was a problem hiding this comment.
Changes requested for one test gap: the code matches the current spec now that INV13 has landed with #8464, but no test fails if the touch-layer registry keeps its media-query listener after the last layer unmounts, if one layer's unmount stops the others following the pointer, or if a moved layer sets up its new element before cleaning up the old one, which architecture:component-test-sufficiency INV2 and INV6 require tests to catch for cleanup and lifetime. A two-layer test that counts the stubbed media-query listeners and turns the pointer after the first unmount, plus one that records setup and cleanup order, would close it. Optionally, adding internal to no-core-internal-import's source-path pattern would also report a relative import of packages/core/src/internal/touch from outside Core and Lab, which currently lints clean. The description still describes the earlier TouchSupport.install() shape and could be refreshed before merge.
[Automated review]
| listeners.delete(listener); | ||
| if (listeners.size === 0) { | ||
| // Unfollowed, the read would go stale: the next layer reads afresh. | ||
| query?.removeEventListener('change', onChange); | ||
| query = null; | ||
| isCoarse = null; | ||
| } |
There was a problem hiding this comment.
No test fails if this block stops removing the media-query listener after the last layer, or runs on every unsubscribe instead of only the last: useTouchLayer.test.tsx stays green with either edit. A two-layer test that counts the stubbed listeners (one while both are mounted, zero after the last unmount) and turns the pointer coarse after the first unmount would catch both, as architecture:component-test-sufficiency INV2 and INV6 ask for cleanup and lifetime.
| attached?.cleanup(); | ||
| attachedRef.current = | ||
| element !== null ? {element, cleanup: setupRef.current(element)} : null; |
There was a problem hiding this comment.
This cleanup-before-setup order is what architecture:react-component-runtime INV6 requires, but the element-move test only counts calls, so setting up the new element before cleaning up the old one still passes. Recording the calls in order (['setup DIV', 'cleanup DIV', 'setup SPAN']) would pin it.
| // their own: by package path, or by a path into Core's source. | ||
| const DEEP = [ | ||
| /^@astryxdesign\/core\/(?:gestures|motion)(?:\/|$)/, | ||
| /(?:^|\/)core\/src\/(?:gestures|motion|touch-support)(?:\/|$)/, |
There was a problem hiding this comment.
This covers source paths into gestures, motion and touch-support but not core/src/internal, so ../../../packages/core/src/internal/touch imported from a story lints clean although it re-exports the same GestureArena. Adding internal to the alternation, with one invalid case, would close that route (not blocking: the @astryxdesign/core/internal/* subpath itself is reported).
…rder architecture:component-test-sufficiency INV2 and INV6: two layers share one media-query listener, the second keeps following the pointer after the first unmounts, and the listener goes after the last; a moved layer cleans the old element up before it sets the new one up (react-component-runtime INV6). Each test fails when its behavior is broken (always or never unfollowing; setting up before cleaning up). Co-authored-by: Christopher Chedeau <[email protected]>
…internal From CodeBunny on #8518: a path into Core's source covered gestures, motion and touch-support but not internal, so '../../packages/core/src/internal/touch' from a story linted clean while re-exporting the same gesture core. The source-path pattern adds internal, with an invalid case (and a valid 'core/src/internals' that must not match); the message, header and README say so.
There was a problem hiding this comment.
This looks ready to merge: with #8464 on main, the useTouchLayer hook, the @astryxdesign/core/internal/touch entry and its lint fence match the current touch-runtime and internal-subpath specs, and the new two-layer and ordering tests now catch the lifecycle regressions raised on the previous revision. Two optional follow-ups: adding internal to the source-path pattern in no-core-internal-import.js would also report a relative import of packages/core/src/internal/touch from outside Core and Lab, which currently lints clean, and the description below its update line still describes the earlier TouchSupport.install() design and could be refreshed.
[Automated review]
|
An offer for what the review left after your e19b389:
Whether to take either is your call. Refreshed descriptionReview only this PR's change: vjeux/astryx@3ca280f...e19b389 Depends on #8465 (merged in): Maintainer impactA component's touch glue gets one lifecycle: Intended invariant
Change
Evidence
Scope
Testing
|
|
Posted by Cindy's agent on her behalf: closed and reopened only to restart this PR's CI on the current workflow after tonight's queue-wide cancel; nothing in the PR changed. |
# Conflicts: # eslint.config.js # internal/eslint-plugin-astryx/README.md # internal/eslint-plugin-astryx/no-core-internal-import.js # internal/eslint-plugin-astryx/no-core-internal-import.test.mjs # packages/core/package.json # scripts/sync-exports.js
There was a problem hiding this comment.
Changes requested: useTouchLayer still follows the touch rule that kept recognizers off fine pointers, and the pull request needs a Changeset. Since spec:AST-094 FR43 landed, FR19 reads "Recognizers attach for every pointer, with FR43's exceptions" and architecture:react-component-runtime INV13 says the gesture host attaches "with no touch-only query", so please either scope the hook to coarse-only jobs (FR13 touch presentations, spec:AST-017 FR59) and cite those claims instead of FR19, or drop the (pointer: coarse) gate, updating the fine-pointer test either way. Please also add a Changeset naming @astryxdesign/core, since the required lint check fails changeset coverage for touchSupportRegistry.ts and useTouchLayer.ts, and refresh the description, which still documents the removed TouchSupport.install() design.
[Automated review]
| useIsomorphicLayoutEffect(() => { | ||
| // The pointer now, not at render: a layer rendered hidden (an Activity) | ||
| // under a coarse pointer and shown after it turned fine sets nothing up. | ||
| const live = isActive && isTouchLayerActive(); |
There was a problem hiding this comment.
This gate keeps every layer off under a fine primary pointer, and the header (lines 20-22) cites spec:AST-094 FR19 for that. On main, FR19 now reads "Recognizers attach for every pointer, with FR43's exceptions", and architecture:react-component-runtime INV13 says the gesture host attaches "with no touch-only query". Either scope the hook to coarse-only jobs (FR13 touch presentations, spec:AST-017 FR59) and cite those claims, or drop the gate; the fine-pointer case at useTouchLayer.test.tsx:79 changes with it.
| * Nothing is installed: components import the touch modules statically, and | ||
| * this only says whether a touch layer runs now. Under a fine primary pointer | ||
| * the answer is false, so a component keeps its plain behavior and attaches | ||
| * no input listener (`spec:AST-094` FR19). The media query is read when first |
There was a problem hiding this comment.
Same citation as in useTouchLayer.ts: FR19 no longer says a fine pointer attaches no input listener; since FR43 it says recognizers attach for every pointer. Cite the claim that keeps this answer coarse-only (FR13 for touch presentations), or let the layer run for every pointer.
|
An offer for this review, as one commit on your head c03f33e (a fast-forward, so the branch can take it as is): vjeux/astryx@c03f33e...0b15f2f
|
|
Closing as requested: later decisions replaced this pull request. The branch stays. |
Review only this PR's change: vjeux/astryx@aaf573b...c03f33e
Why
Components that grow touch behavior need one place that decides when it may run: only for a touch presentation, under a coarse primary pointer and after hydration (
spec:AST-094FR13), so people on a mouse or trackpad keep exactly what they have today (spec:AST-017FR59). Without it, each component reads the pointer itself, and one slip attaches touch listeners under a fine pointer or during hydration.What led to it
This began as
TouchSupport.install(), a module apps installed to gather the touch code. In review the design changed: there is no install step, and components import the touch code they use directly. What remains is the lifecycle their touch glue shares: an internal hook,useTouchLayer, and the pointer registry behind it. The open review asks the coarse-only rule to cite FR13 and FR59 instead of FR19, which since FR43 lets gestures attach for every pointer; an offer in the comments makes that change.Options and tradeoffs
(pointer: coarse)itself: no shared code, but every component repeats the hydration and pointer-change handling.Why this choice
It keeps fine-pointer behavior unchanged by construction, which FR59 asks of touch work, and it applies FR13's rule for when a touch presentation runs. Nothing uses the hook yet, so nothing a consumer sees or bundles changes; components adopt it as their touch presentations land.
How to check it
pnpm exec vitest run --project ui packages/core/src/touch-support: 11 tests pass. They cover:isTouchLayerActivereturntrue: 5 of the 11 fail, the fine-pointer test among them.Evidence
touch-support/useTouchLayer.ts,touch-support/touchSupportRegistry.ts,touch-support/useTouchLayer.test.tsx.