An open source design system that's fully customizable and agent ready
TypeScript
spec(AST-094): a held finger does what the hold does, not a selection (FR41, DEC-9) (#8454)
Cindy Zhange1deabdfe25b
diff --git a/docs/specs/AST-094-touch-presentations/spec.md b/docs/specs/AST-094-touch-presentations/spec.mdindex 9dbfc87631..37cc20e910 100644--- a/docs/specs/AST-094-touch-presentations/spec.md+++ b/docs/specs/AST-094-touch-presentations/spec.md@@ -383,6 +383,25 @@ FR33 apply to menus only. A mouse keeps today's behavior.- **FR40 — Release velocity.** The velocity FR36–FR38 read is governed by`spec:AST-100`.+### Text selection++- **FR41 — A held finger does what the hold does, not a selection.** A tap+ activates as it does today and never selects text. On an element whose hold+ does something, such as a ContextMenu trigger or a row with a context menu+ (a long press at FR12's threshold), or a control whose own record defines a+ hold action, such as a slider's thumb or a stepper's hold-repeat, the hold+ does that and the browser's text-selection start and callout are suppressed+ for that press only, lifted at the lift or a cancel; that element's text is+ not selectable by a long press, and Astryx adds no Copy item to a menu. An+ element's existing always-on suppression stays as it is. On a label or plain+ text whose hold does nothing, such as a checkbox row's label, a long press+ selects natively, with the browser's handles; any other element follows its+ own record. Keyboard and assistive-technology selection are unchanged, and a+ mouse keeps its released behavior (`spec:AST-017` FR59; DEC-9).++ Guidance: a caller whose menu element carries text a person may want offers+ a Copy action in its menu.+### Haptics- **FR23 — Haptics where the native counterpart plays them.** A touch@@ -443,6 +462,11 @@ FR33 apply to menus only. A mouse keeps today's behavior.(FR13) sit beside the shared modality state; its invariants are unchanged.- `architecture:react-component-runtime`: FR24 states the caller-visibleoutcome of INV5 and INV7 for touch work; both are unchanged.+- Under FR41: ContextMenu's trigger, DropdownMenu's built-in trigger and its menu, and+ Slider's track already turn selection off at all times (the menus also the+ callout), and that stays. A held finger on other rows and controls with a+ hold action can start a selection or the callout today, and no shared,+ press-scoped suppression exists.- `family:buttons`: the control and cell press profiles (FR11).- Each overlay member's own record (Dialog, BottomSheet, Drawer, Popover, themenus): its touch exit and its Reduce Motion cross-fade (FR7, FR8), since@@ -475,29 +499,30 @@ FR33 apply to menus only. A mouse keeps today's behavior.## Verification-| Contract | Verification | Representative states | Mutation or failure expectation |-| --------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails |-| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values |-| FR4 | Theme unit tests and a browser test of a themed spring | no theme (table defaults); a theme writing a spring, a duration and a curve, at its root and in an adaptation | a role that ignores the theme, a literal played in place of a role, or a default that differs from the table fails |-| FR5 | Browser proof: an animation keeps advancing frame by frame through a 1 s main-thread block, with no layout or paint per frame | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out |-| FR6 | Unit and browser tests catching an animation mid-flight and retargeting it | catch at peak velocity; retarget with a new spring | a layout read, a jump, or a lost velocity fails |-| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), or an opacity fade over 200 ms fails |-| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a blocked page pinch, fails |-| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger | the wrong profile's timing, a press that survives the browser taking the touch, or a control activated other than by the browser's click fails |-| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails |-| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails |-| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis fails |-| FR18–FR22 | Browser tests with real touch input | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag | a ghost click, a blocked scroll or zoom, or a cancelled unowned touchmove outside FR19's two exceptions fails |-| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails |-| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a touch listener on a fine pointer, a per-instance `document` or `window` listener, or a leak fails |-| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails |-| FR26–FR28, FR30 | Menu press tests on synthetic touch streams and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails |-| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails |-| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a blocked pinch, a tap outside that reaches the page, or a changed mouse path fails |-| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse | a drill-in that leaves the parent's rows in place, a change between levels that does not play on its roles, a tap during growth that closes, scrolls or moves focus, a blocked pinch, or a changed mouse path fails |-| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity, or an action with no keyboard or mouse path fails |-| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari and Android Chrome devices | per component | an unmatched curve or timing is a parity defect |+| Contract | Verification | Representative states | Mutation or failure expectation |+| --------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| FR1, FR2 | Value check over every measured value and its uses | every value; a guess and its measurement task; a platform-specific value; two components playing the same motion | an unsourced value, an unknown source kind, a guess without a listed measurement, an unsourced platform split, or two values for one use fails |+| FR3 | Unit tests of the spring, decay, rubber band and projection math against an independent integration and values read from UIKit | under-, critically and overdamped springs; release velocities; both rates; overscroll depths | changing a formula or a constant breaks the agreement with UIKit's values |+| FR4 | Theme unit tests and a browser test of a themed spring | no theme (table defaults); a theme writing a spring, a duration and a curve, at its root and in an adaptation | a role that ignores the theme, a literal played in place of a role, or a default that differs from the table fails |+| FR5 | Browser proof: an animation keeps advancing frame by frame through a 1 s main-thread block, with no layout or paint per frame | Chromium phone emulation; WebKit | a script-driven or layout-animating implementation freezes or lays out |+| FR6 | Unit and browser tests catching an animation mid-flight and retargeting it | catch at peak velocity; retarget with a new spring | a layout read, a jump, or a lost velocity fails |+| FR7, FR8 | Component browser tests and storyboards with and without Reduce Motion | entrance, exit, move; a drag and its lift under Reduce Motion | a missing exit, any travel, scale or spring under Reduce Motion other than a coast after a throw and its settle at an edge (`design:reduced-motion` DR2), or an opacity fade over 200 ms fails |+| FR9, FR10 | Recognizer unit tests on synthetic streams and browser tests with real touch input | drag, second finger, pinch, page zoom, main-thread block | a second finger that breaks a drag, or a blocked page pinch, fails |+| FR11, FR12 | Press and long-press tests on synthetic streams with explicit timestamps | inside and outside a scroll view; a drag the browser takes; a lift inside; a menu row under a finger | the wrong profile's timing, a press that survives the browser taking the touch, or a control activated other than by the browser's click fails |+| FR13 | Resolver unit tests and a server-render test | coarse and fine pointer; narrow, wide and short; server render; hydrating render | a component that answers the conditions differently, or a touch presentation in the server or hydrating render, fails |+| FR14 | Browser tests of a sheet over a scrolled list | scrolled and at its top | a midway handoff fails |+| FR15–FR17 | Recognizer unit tests on synthetic streams with explicit timestamps | exclusive, simultaneous, require-to-fail, nested; a blocked main thread; a pan at 10 pt per axis | a wrong winner, a late deadline, or a translation that keeps the hysteresis fails |+| FR18–FR22 | Browser tests with real touch input | per-axis pans beside native scrolling, page zoom, cancelled touches, clicks after taps, keyboard activation, a modal scroll lock, a control that keeps its press through a drag | a ghost click, a blocked scroll or zoom, or a cancelled unowned touchmove outside FR19's two exceptions fails |+| FR23 | Haptics tests on the recorded moments | tap, drag, lift | a haptic outside a native moment fails |+| FR24 | Resource tests counting listeners, observers and timers | fine primary pointer; coarse pointer enabled and disabled; many instances; unmount | a touch listener on a fine pointer, a per-instance `document` or `window` listener, or a leak fails |+| FR25 | Component tests of each moved default and its `presentation` value | default; `presentation` set to the released surface | a moved default that `presentation` does not restore, or a public threshold, fails |+| FR26–FR28, FR30 | Menu press tests on synthetic touch streams and a real-Chromium touch test | a slide from one row to another; a lift outside; a cancel; a second finger; edge autoscroll | an act on the press-start row, two acts for one gesture, a lift outside that closes, or a lit row after a cancel fails |+| FR29 | Trigger tests with explicit timestamps | a press in a fixed bar; a press in scrolling content held 149 and 150 ms; a quick tap in scrolling content; a scroll before 150 ms; a drift of 12 and 14 pt; moves before and after the handoff; `presentation="popover"` | a fixed-bar press that waits, a held finger's scroll-view open before 150 ms or after a scroll, a quick tap that does not open at its lift, an open past the drift allowance, a lift that acts before the handoff, or a `popover` trigger that opens on press fails |+| FR31–FR33 | Browser tests and storyboards under a finger | a menu, a Popover and a ContextMenu lift: open, close, a pan outside, a tap outside, a pinch over the surface; a mouse | a surface that does not grow from and shrink into its trigger, a pan outside that leaves a menu open, a Popover whose dismissal changed, a blocked pinch, a tap outside that reaches the page, or a changed mouse path fails |+| FR34, FR35 | Browser tests and storyboards under a finger | a sub-menu drilling in and its Back row returning; a tap and a drag during a popover's and a menu's growth; a pinch during growth; a mouse | a drill-in that leaves the parent's rows in place, a change between levels that does not play on its roles, a tap during growth that closes, scrolls or moves focus, a blocked pinch, or a changed mouse path fails |+| FR36–FR40 | Release tests on synthetic touch streams with explicit timestamps, per use | below and past each commit point; a flick that projects past it; a slow drag past it; a release moving back; Reduce Motion; keyboard and mouse paths | a decision that changes mid-settle, a release moving back that commits, a settle that does not start at the release velocity, or an action with no keyboard or mouse path fails |+| FR41 | Browser tests with real touch input (`spec:AST-013` FR10) | a tap; a long press on a ContextMenu trigger, a DropdownMenu trigger the caller renders, a row with a context menu, and a slider thumb; a long press on a checkbox row's label and on plain text; a cancelled press; mouse and keyboard selection | a tap that selects, a hold with an action that starts a selection or callout, a label or plain text whose long press does not select natively, a suppression that outlives the press, or a change to native selection elsewhere or to mouse, keyboard, or assistive-technology selection fails |+| all | iOS simulator: the UIKit reference capture and the same gesture in Safari; real iOS Safari and Android Chrome devices | per component | an unmatched curve or timing is a parity defect |## Decision log@@ -580,6 +605,23 @@ watching a touch never delays the browser's scroll, and it is not cancelledwhen the browser takes the touch: it follows the scroll to the lift, so a barthat reacts to scrolling keeps hearing it.+### DEC-9 — A hold does its action, not a selection; copying is the caller's menu item++**Reference:** `spec:AST-094/DEC-9`+**Decider:** `cixzhang`, `2026-10-25`++Under a finger, a tap, a hold that does something, and a long press on plain+text are different intents. A tap activates. A hold on an element whose hold+does something (a long-press menu, a stepper's hold-repeat, a slider's thumb)+does that without starting a selection or the loupe, as UIKit's context menus+and controls and Android's long clicks do. A long press on a label or plain text whose+hold does nothing selects natively, so labels stay selectable; other elements+follow their own records. Text on a menu+element is not selectable by a long press, and the system adds no Copy item,+so a caller that wants copying puts a Copy action in its own menu.++Rejected: a system Copy item; suppressing selection on every press-tracked control.+## Open questions- **OQ1 — Scroll view bounce-back curve.** What curve brings a scroll view