From 30d5ead77eb5201e53e16a0415c9804d60f4d669 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 15:12:57 -0700 Subject: [PATCH 01/13] spec(AST-100): one velocity tracker and one release filter; thresholds stay per component New system spec: one Core tracker owns pointer samples and reports px/s; one release filter (window plus a stillness reset) is the only lift velocity a component reads; flick thresholds stay internal per component; event-clock timestamps for touch, pen, and mouse; direction from the caller's axis after the right-to-left check. --- docs/specs/AST-100-release-velocity/spec.md | 140 ++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 docs/specs/AST-100-release-velocity/spec.md diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md new file mode 100644 index 0000000000000..59c530792d6b4 --- /dev/null +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -0,0 +1,140 @@ +--- +schema_version: 4 +template_version: 2 +kind: system-spec +id: spec:AST-100 +authority: current +archive_reason: null +superseded_by: null +approved_by: cixzhang +approved_at: 2026-10-24 +phase: accepted +owners: [cixzhang] +affects_architecture: [] +affects_families: [] +affects_contributing: [] +affects_consumer_docs: [] +--- + +# Release velocity system spec + + + +```json +{ + "paths": [ + "packages/core/src/BottomSheet/**", + "packages/core/src/Item/**", + "packages/core/src/Toast/**" + ] +} +``` + + + +## Intent + +When a person flicks a sheet, a toast, a row, a page, or a wheel and lifts +their finger, every Astryx component reads the same speed from that motion, so +a flick of the same speed does the same thing everywhere, and a finger that +stopped before lifting never counts as a flick. One velocity tracker in Core +owns the samples and the release filter; components decide only what a given +velocity means for them. + +## Non-goals + +- What a component does with the velocity: its flick threshold, its commit + point, its projection, and its settle curve stay with the component and its + record. +- Pinch scale velocity and scroll physics the browser owns. +- Public API: the tracker, its filter values, and every threshold stay + internal (`spec:AST-002` FR3). +- Equivalent internal implementations remain valid when they satisfy this + contract. + +## Requirements + +- **FR1 — One tracker owns the samples.** Core has one velocity tracker. A + gesture feeds it the contact's positions with their event timestamps, and it + reports velocity in CSS pixels per second on each physical axis. Every Core + and Lab component that reads the velocity of a pointer gesture uses it, + including a sheet's drag, a toast's swipe, a row swipe, paging, a wheel + picker, a navigation pop, and interactive dismiss. No component keeps its own + sample buffer or velocity math. +- **FR2 — One release filter.** The velocity a component reads when the + contact lifts comes only from the tracker's release filter: it uses the + samples within a fixed window before the newest sample, and reports 0 when + the contact stayed still for longer than a fixed stillness interval before + lifting. A component reads no other estimate and selects no alternative + filter. The window and the stillness interval are internal tuning values. +- **FR3 — Thresholds sit on top of the one velocity.** A component's flick, + fling, or commit threshold compares the FR2 velocity, possibly with travel + or projection the component owns. Thresholds are per-component tuning that + stays internal (`spec:AST-002` FR3); a component never derives a second + velocity to compare against. +- **FR4 — Event-clock timestamps for every pointer.** Samples carry the input + event's own timestamp, never the time the handler ran or the wall clock, and + the tracker and filter behave the same for touch, pen, and mouse pointers. +- **FR5 — Direction comes from the caller's axis.** The tracker reports + physical x and y. A caller that acts along a logical axis maps the velocity + onto that axis after resolving the element's direction with the shared + right-to-left check, so a flick toward the inline end means the same in both + directions. + +### Platform support + +- Supported feature/engine floor: the package's supported browsers + (`spec:AST-013` FR3); pointer events with event timestamps. +- Unsupported behavior: a gesture with fewer than two samples in the window + has a release velocity of 0. +- Browser evidence: unit tests over recorded and synthetic sample streams + prove FR1–FR5; real-device feel for each component remains that component's + evidence. + +## Current-state impact + +- No velocity tracker exists in Core on `main`. Its first landing meets FR1–FR5: + one release filter with the FR2 stillness reset, with no selectable + alternative filters. +- BottomSheet's drag estimates velocity from a two-point window over its + recent samples with event timestamps. Under FR1 and FR2 it reads the tracker. +- Item's row swipe compares a speed in pixels per millisecond timed with the + handler's clock. Under FR1, FR2, and FR4 it reads the tracker in pixels per + second with event timestamps, and keeps its own threshold (FR3). +- Toast's swipe averages travel over the whole drag timed with the wall clock. + Under FR1, FR2, and FR4 it reads the tracker, and keeps its own threshold + (FR3). +- A component that later reads gesture velocity, such as paging, a wheel + picker, a navigation pop, or interactive dismiss, reads it from the tracker. + +## Verification + +| Contract | Verification | Representative states | Mutation or failure expectation | +| -------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| FR1 | Source boundary check over Core and Lab plus tracker unit tests | each gesture component; a new gesture component; steady motion in x and y | A component with its own sample buffer or velocity math; a unit other than pixels per second | +| FR2 | Release filter unit tests | steady flick; acceleration before lift; a pause longer than the stillness interval before lift; one sample; samples outside the window | A non-zero release after a still pause; samples outside the window changing the result; a second filter reachable | +| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | A component comparing a velocity it computed itself, or a threshold reachable from public API | +| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | +| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | + +## Decision log + +### DEC-1 — One tracker and one release filter; thresholds stay per component + +**Reference:** `spec:AST-100/DEC-1` +**Decider:** `cixzhang`, `2026-10-24` + +Each component estimating velocity its own way makes the same flick dismiss a +toast but not a sheet, and a finger that paused before lifting count as a +flick in one place and not another. One tracker with one release filter gives +every component the same speed for the same motion, and the stillness reset +stops a resting finger from flinging. What a speed means stays with each +component as internal tuning, so components keep their feel without a second +estimator. + +Rejected: several selectable estimators or per-component release filters, +which reintroduce the disagreement this record removes. + +## Open questions + +None. From 7be9e81894e9704e2b586f97f1aec3a2158e4ef2 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 16:05:58 -0700 Subject: [PATCH 02/13] spec(AST-100): observable FR1/FR2/FR4/FR5 with the tracker in interaction-modality INV10; cite bidirectionality DR13 and internationalization INV11 --- docs/architecture/interaction-modality.md | 15 ++++- docs/specs/AST-100-release-velocity/spec.md | 62 ++++++++++----------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index cfac1d6f5e046..4bdea9fc40ae4 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -7,7 +7,7 @@ authority: current archive_reason: null superseded_by: null approved_by: cixzhang -approved_at: 2026-09-10 +approved_at: 2026-10-24 owners: [cixzhang] applies_to: [ @@ -25,7 +25,7 @@ verified_by: packages/core/src/Selector/Selector.test.tsx, packages/core/src/Slider/Slider.test.tsx, ] -deciding_specs: [] +deciding_specs: [spec:AST-100/DEC-1] --- # Interaction modality architecture @@ -146,6 +146,13 @@ work. correction already settled by current component, family, design, theme, or objective accessibility authority; that correction uses rendered-pixel evidence and its direct owner rather than being recast as interaction reachability. +- **INV10 — Gesture velocity has one owner.** In `@astryxdesign/core`, one + internal velocity tracker owns a gesture's pointer samples and reports + velocity, and its one release filter, a fixed sample window with a reset to + 0 after a still contact, is the only lift velocity a component reads + (`spec:AST-100`). It is not exported. No component keeps its own sample + buffer, velocity math, or alternative release filter; a component's flick + threshold compares the tracker's release velocity. ## Allowed variation @@ -214,7 +221,8 @@ is asked to carry a new decision. ## Deciding specs -No separate specification changes this record. The last-input rule was approved as +`spec:AST-100/DEC-1` decides one release velocity for every gesture (INV10). +Otherwise no separate specification changes this record. The last-input rule was approved as a system architecture decision by `cixzhang` on 2026-08-30. Essential-action reachability, newer-intent precedence, and the evidence/scope guard were approved by `cixzhang` on 2026-09-10. @@ -231,6 +239,7 @@ reachability, newer-intent precedence, and the evidence/scope guard were approve | INV7 | Rendered-browser affected-state checks across geometry, clipping, scrolling, hit testing, built-in and custom-renderer paths | At an offered interaction point one modality loses every essential path, or evidence substitutes class equality for reachability/perceptibility | | INV8 | Owner-defined intent order, pending, close, cancellation, disablement, and unmount mutations | Older work changes current content, selection, status or announcement, visibility, focus, or activation after owner-defined supersession | | INV9 | Concrete-harm reproduction, representative normal/legacy/no-new-prop paths, and coincident public-delta inventory | Unsupported or aesthetic preference is treated as harm, unaffected behavior changes, or an API, layout, sizing, default, sticky, or exception delta escapes direct authority | +| INV10 | Source boundary check over Core and Lab plus tracker and release-filter unit tests | A component with its own sample buffer, velocity math, or release filter; an export of the tracker; a non-zero release after a still pause | Real-browser evidence is required when the behavior depends on `:focus-visible`, pointer capability, touch or pen synthesis, rendered focus diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 59c530792d6b4..8b8279778634a 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -10,7 +10,7 @@ approved_by: cixzhang approved_at: 2026-10-24 phase: accepted owners: [cixzhang] -affects_architecture: [] +affects_architecture: [architecture:interaction-modality] affects_families: [] affects_contributing: [] affects_consumer_docs: [] @@ -37,7 +37,7 @@ affects_consumer_docs: [] When a person flicks a sheet, a toast, a row, a page, or a wheel and lifts their finger, every Astryx component reads the same speed from that motion, so a flick of the same speed does the same thing everywhere, and a finger that -stopped before lifting never counts as a flick. One velocity tracker in Core +stopped before lifting never counts as a flick. One velocity source in Core owns the samples and the release filter; components decide only what a given velocity means for them. @@ -47,55 +47,55 @@ velocity means for them. point, its projection, and its settle curve stay with the component and its record. - Pinch scale velocity and scroll physics the browser owns. -- Public API: the tracker, its filter values, and every threshold stay +- Public API: the velocity source, its filter values, and every threshold stay internal (`spec:AST-002` FR3). - Equivalent internal implementations remain valid when they satisfy this contract. ## Requirements -- **FR1 — One tracker owns the samples.** Core has one velocity tracker. A - gesture feeds it the contact's positions with their event timestamps, and it - reports velocity in CSS pixels per second on each physical axis. Every Core - and Lab component that reads the velocity of a pointer gesture uses it, - including a sheet's drag, a toast's swipe, a row swipe, paging, a wheel - picker, a navigation pop, and interactive dismiss. No component keeps its own - sample buffer or velocity math. -- **FR2 — One release filter.** The velocity a component reads when the - contact lifts comes only from the tracker's release filter: it uses the - samples within a fixed window before the newest sample, and reports 0 when - the contact stayed still for longer than a fixed stillness interval before - lifting. A component reads no other estimate and selects no alternative - filter. The window and the stillness interval are internal tuning values. +- **FR1 — One velocity for every gesture.** Every Core and Lab component that + reads the velocity of a pointer gesture, including a sheet's drag, a toast's + swipe, a row swipe, paging, a wheel picker, a navigation pop, and interactive + dismiss, reports the same velocity, in CSS pixels per second on each physical + axis, for the same contact motion. `architecture:interaction-modality` INV10 + owns the single source of that velocity. +- **FR2 — A still finger never flicks.** The velocity a component reads when + the contact lifts reflects only the motion just before the lift: it is 0 + when the contact stayed still for longer than a fixed stillness interval + before lifting, and motion older than a fixed window before the lift does not + change it. Every component reads the same release velocity and none reads + another estimate. The window and the stillness interval are internal tuning + values. - **FR3 — Thresholds sit on top of the one velocity.** A component's flick, fling, or commit threshold compares the FR2 velocity, possibly with travel or projection the component owns. Thresholds are per-component tuning that stays internal (`spec:AST-002` FR3); a component never derives a second velocity to compare against. -- **FR4 — Event-clock timestamps for every pointer.** Samples carry the input - event's own timestamp, never the time the handler ran or the wall clock, and - the tracker and filter behave the same for touch, pen, and mouse pointers. -- **FR5 — Direction comes from the caller's axis.** The tracker reports - physical x and y. A caller that acts along a logical axis maps the velocity - onto that axis after resolving the element's direction with the shared - right-to-left check, so a flick toward the inline end means the same in both - directions. +- **FR4 — Event time for every pointer.** The velocity follows the input + events' own timestamps, so a handler that runs late does not change it, and + the same motion gives the same velocity for touch, pen, and mouse pointers. +- **FR5 — Direction follows the rendered direction.** A flick toward the + logical end moves toward the logical end in both directions + (`design:bidirectionality` DR13); a component maps the physical velocity onto + its logical axis from the rendered direction + (`architecture:internationalization` INV11). ### Platform support - Supported feature/engine floor: the package's supported browsers - (`spec:AST-013` FR3); pointer events with event timestamps. + (`spec:AST-013` FR1, FR3); pointer events with event timestamps. - Unsupported behavior: a gesture with fewer than two samples in the window has a release velocity of 0. -- Browser evidence: unit tests over recorded and synthetic sample streams - prove FR1–FR5; real-device feel for each component remains that component's - evidence. +- Browser evidence: none required by this record; the unit, source-boundary, + and component tests in Verification prove FR1–FR5, and real-device feel for + each component remains that component's evidence. ## Current-state impact -- No velocity tracker exists in Core on `main`. Its first landing meets FR1–FR5: - one release filter with the FR2 stillness reset, with no selectable - alternative filters. +- No single velocity source exists in Core on `main`. Its first landing meets + FR1–FR5 and `architecture:interaction-modality` INV10: one release filter + with the FR2 stillness reset, with no selectable alternative filters. - BottomSheet's drag estimates velocity from a two-point window over its recent samples with event timestamps. Under FR1 and FR2 it reads the tracker. - Item's row swipe compares a speed in pixels per millisecond timed with the From a539d7f7c07149567841c533110d6c2ee6022fb4 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 16:39:32 -0700 Subject: [PATCH 03/13] =?UTF-8?q?spec(AST-100):=20Lab=20conformance=20and?= =?UTF-8?q?=20owning=20code=20in=20interaction-modality;=20observable=20FR?= =?UTF-8?q?1=E2=80=93FR3=20verification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/architecture/interaction-modality.md | 20 +++++++++++++------- docs/specs/AST-100-release-velocity/spec.md | 14 +++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index 4bdea9fc40ae4..7d47c636626e2 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -46,8 +46,9 @@ deciding_specs: [spec:AST-100/DEC-1] Astryx components behave predictably when people move between keyboard, pointer, touch, pen, and programmatic focus. Essential actions remain perceivable and reachable while their controlled state or task context is presented, and newer user -intent remains authoritative over stale work. This record defines those shared -interaction invariants, the shared modality state, the boundary between modality and +intent remains authoritative over stale work, and every gesture reads the same +release velocity. This record defines those shared interaction invariants, the +one gesture velocity source, the shared modality state, the boundary between modality and component focus ownership, and the evidence required when any of them changes. It does not define focus-ring appearance, hover paint, press treatment, or new @@ -149,10 +150,13 @@ work. - **INV10 — Gesture velocity has one owner.** In `@astryxdesign/core`, one internal velocity tracker owns a gesture's pointer samples and reports velocity, and its one release filter, a fixed sample window with a reset to - 0 after a still contact, is the only lift velocity a component reads - (`spec:AST-100`). It is not exported. No component keeps its own sample + 0 after a still contact, is the only lift velocity a Core component reads + (`spec:AST-100`). It is not exported. No Core component keeps its own sample buffer, velocity math, or alternative release filter; a component's flick - threshold compares the tracker's release velocity. + threshold compares the tracker's release velocity. Packages outside Core + cannot import the tracker; a gesture there keeps one local tracker with the + same release filter, window, and stillness interval, so it reports the same + velocity for the same motion. ## Allowed variation @@ -216,8 +220,10 @@ is asked to carry a new decision. behavior, essential-action availability, accepted intent, supersession, pending lifetimes, and focus-paint ownership. - `architecture:react-component-runtime` owns shared lifecycle and resource - mechanisms. This record owns only the cross-cutting modality-path and - no-stale-interaction-outcome requirements. + mechanisms. This record owns only the cross-cutting modality-path, + no-stale-interaction-outcome, and gesture-velocity-source requirements. +- The Core velocity tracker and its release filter (INV10) — the one source of + gesture velocity for Core components; not exported. ## Deciding specs diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 8b8279778634a..083b7510cab07 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -109,13 +109,13 @@ velocity means for them. ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| -------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| FR1 | Source boundary check over Core and Lab plus tracker unit tests | each gesture component; a new gesture component; steady motion in x and y | A component with its own sample buffer or velocity math; a unit other than pixels per second | -| FR2 | Release filter unit tests | steady flick; acceleration before lift; a pause longer than the stillness interval before lift; one sample; samples outside the window | A non-zero release after a still pause; samples outside the window changing the result; a second filter reachable | -| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | A component comparing a velocity it computed itself, or a threshold reachable from public API | -| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | -| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | +| Contract | Verification | Representative states | Mutation or failure expectation | +| -------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components reporting different velocities for the same stream, or a unit other than pixels per second | +| FR2 | Release velocity tests through a component | steady flick; acceleration before lift; a pause longer than the stillness interval before lift; one sample; samples outside the window | A non-zero release after a still pause, or motion outside the window changing the result | +| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components acting on different velocities for the same flick, or a threshold reachable from public API | +| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | +| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | ## Decision log From c3001f06953b6181236e6b74bb5c8043c743a150 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 16:39:46 -0700 Subject: [PATCH 04/13] spec(architecture): INV10 verification covers Lab parity --- docs/architecture/interaction-modality.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index 7d47c636626e2..9c9f1f6248cbe 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -235,17 +235,17 @@ reachability, newer-intent precedence, and the evidence/scope guard were approve ## Verification -| Invariant | Evidence | Failure signal | -| ---------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| INV1, INV2 | Programmatic-focus cases after keyboard and pointer input in representative component tests | Programmatic focus invents a modality, or pointer history paints the keyboard indicator | -| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out | -| INV4 | Keyboard, mouse, touch, and pen browser paths where applicable | Hover-only behavior, sticky touch hover, or unreachable action | -| INV5 | Disabled, busy, and read-only DOM and activation assertions | Inactive control reacts, eligible control loses focus, or state changes with modality | -| INV6 | Public API review and representative source inspection | A component adds caller-controlled modality without a separate API decision | -| INV7 | Rendered-browser affected-state checks across geometry, clipping, scrolling, hit testing, built-in and custom-renderer paths | At an offered interaction point one modality loses every essential path, or evidence substitutes class equality for reachability/perceptibility | -| INV8 | Owner-defined intent order, pending, close, cancellation, disablement, and unmount mutations | Older work changes current content, selection, status or announcement, visibility, focus, or activation after owner-defined supersession | -| INV9 | Concrete-harm reproduction, representative normal/legacy/no-new-prop paths, and coincident public-delta inventory | Unsupported or aesthetic preference is treated as harm, unaffected behavior changes, or an API, layout, sizing, default, sticky, or exception delta escapes direct authority | -| INV10 | Source boundary check over Core and Lab plus tracker and release-filter unit tests | A component with its own sample buffer, velocity math, or release filter; an export of the tracker; a non-zero release after a still pause | +| Invariant | Evidence | Failure signal | +| ---------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| INV1, INV2 | Programmatic-focus cases after keyboard and pointer input in representative component tests | Programmatic focus invents a modality, or pointer history paints the keyboard indicator | +| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out | +| INV4 | Keyboard, mouse, touch, and pen browser paths where applicable | Hover-only behavior, sticky touch hover, or unreachable action | +| INV5 | Disabled, busy, and read-only DOM and activation assertions | Inactive control reacts, eligible control loses focus, or state changes with modality | +| INV6 | Public API review and representative source inspection | A component adds caller-controlled modality without a separate API decision | +| INV7 | Rendered-browser affected-state checks across geometry, clipping, scrolling, hit testing, built-in and custom-renderer paths | At an offered interaction point one modality loses every essential path, or evidence substitutes class equality for reachability/perceptibility | +| INV8 | Owner-defined intent order, pending, close, cancellation, disablement, and unmount mutations | Older work changes current content, selection, status or announcement, visibility, focus, or activation after owner-defined supersession | +| INV9 | Concrete-harm reproduction, representative normal/legacy/no-new-prop paths, and coincident public-delta inventory | Unsupported or aesthetic preference is treated as harm, unaffected behavior changes, or an API, layout, sizing, default, sticky, or exception delta escapes direct authority | +| INV10 | Source boundary check over Core, a Lab-to-Core comparison on one recorded stream, and release-filter unit tests | A Core component with its own sample buffer, velocity math, or release filter; a Lab tracker reporting a different velocity for the same stream; an export of the tracker; a non-zero release after a still pause | Real-browser evidence is required when the behavior depends on `:focus-visible`, pointer capability, touch or pen synthesis, rendered focus From a31b503eef8e77ce715c118dbf4c8b96ddd33073 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 17:11:28 -0700 Subject: [PATCH 05/13] spec(AST-100): Intent, FR1, DEC-1 and current state match INV10 Core source plus matching Lab tracker --- docs/specs/AST-100-release-velocity/spec.md | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 083b7510cab07..8216fa5f6703e 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -37,9 +37,9 @@ affects_consumer_docs: [] When a person flicks a sheet, a toast, a row, a page, or a wheel and lifts their finger, every Astryx component reads the same speed from that motion, so a flick of the same speed does the same thing everywhere, and a finger that -stopped before lifting never counts as a flick. One velocity source in Core -owns the samples and the release filter; components decide only what a given -velocity means for them. +stopped before lifting never counts as a flick. One release filter defines the +speed every component reads; components decide only what a given velocity +means for them. ## Non-goals @@ -59,7 +59,7 @@ velocity means for them. swipe, a row swipe, paging, a wheel picker, a navigation pop, and interactive dismiss, reports the same velocity, in CSS pixels per second on each physical axis, for the same contact motion. `architecture:interaction-modality` INV10 - owns the single source of that velocity. + owns the source in Core and how a component outside Core matches it. - **FR2 — A still finger never flicks.** The velocity a component reads when the contact lifts reflects only the motion just before the lift: it is 0 when the contact stayed still for longer than a fixed stillness interval @@ -87,15 +87,16 @@ velocity means for them. (`spec:AST-013` FR1, FR3); pointer events with event timestamps. - Unsupported behavior: a gesture with fewer than two samples in the window has a release velocity of 0. -- Browser evidence: none required by this record; the unit, source-boundary, - and component tests in Verification prove FR1–FR5, and real-device feel for +- Browser evidence: none required by this record; the unit and component + tests in Verification prove FR1–FR5, and real-device feel for each component remains that component's evidence. ## Current-state impact -- No single velocity source exists in Core on `main`. Its first landing meets - FR1–FR5 and `architecture:interaction-modality` INV10: one release filter - with the FR2 stillness reset, with no selectable alternative filters. +- No velocity source exists in Core on `main`. Its first landing meets FR1–FR5 + and `architecture:interaction-modality` INV10: one release filter with the + FR2 stillness reset, with no selectable alternative filters. A Lab gesture + matches it as INV10 describes. - BottomSheet's drag estimates velocity from a two-point window over its recent samples with event timestamps. Under FR1 and FR2 it reads the tracker. - Item's row swipe compares a speed in pixels per millisecond timed with the @@ -119,15 +120,16 @@ velocity means for them. ## Decision log -### DEC-1 — One tracker and one release filter; thresholds stay per component +### DEC-1 — One release filter for every gesture; thresholds stay per component **Reference:** `spec:AST-100/DEC-1` **Decider:** `cixzhang`, `2026-10-24` Each component estimating velocity its own way makes the same flick dismiss a toast but not a sheet, and a finger that paused before lifting count as a -flick in one place and not another. One tracker with one release filter gives -every component the same speed for the same motion, and the stillness reset +flick in one place and not another. One release filter, with one source in +Core and the same filter wherever a package cannot reach it, gives every +component the same speed for the same motion, and the stillness reset stops a resting finger from flinging. What a speed means stays with each component as internal tuning, so components keep their feel without a second estimator. From 749e5ca67c8630b703207b066795e3564b6d9be5 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 17:44:41 -0700 Subject: [PATCH 06/13] spec(AST-100): scope the matching tracker to Lab, leaving native platforms to AST-082 --- docs/architecture/interaction-modality.md | 4 ++-- docs/specs/AST-100-release-velocity/spec.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index 9c9f1f6248cbe..03be616d38e2f 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -153,8 +153,8 @@ work. 0 after a still contact, is the only lift velocity a Core component reads (`spec:AST-100`). It is not exported. No Core component keeps its own sample buffer, velocity math, or alternative release filter; a component's flick - threshold compares the tracker's release velocity. Packages outside Core - cannot import the tracker; a gesture there keeps one local tracker with the + threshold compares the tracker's release velocity. Web packages outside + Core, such as Lab, cannot import the tracker; a gesture there keeps one local tracker with the same release filter, window, and stillness interval, so it reports the same velocity for the same motion. diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 8216fa5f6703e..483e8ca7e3a7b 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -59,7 +59,7 @@ means for them. swipe, a row swipe, paging, a wheel picker, a navigation pop, and interactive dismiss, reports the same velocity, in CSS pixels per second on each physical axis, for the same contact motion. `architecture:interaction-modality` INV10 - owns the source in Core and how a component outside Core matches it. + owns the source in Core and how a Lab component matches it. - **FR2 — A still finger never flicks.** The velocity a component reads when the contact lifts reflects only the motion just before the lift: it is 0 when the contact stayed still for longer than a fixed stillness interval @@ -128,7 +128,7 @@ means for them. Each component estimating velocity its own way makes the same flick dismiss a toast but not a sheet, and a finger that paused before lifting count as a flick in one place and not another. One release filter, with one source in -Core and the same filter wherever a package cannot reach it, gives every +Core and the same filter in Lab, gives every component the same speed for the same motion, and the stillness reset stops a resting finger from flinging. What a speed means stays with each component as internal tuning, so components keep their feel without a second From 8bde1f2781e10cdbc7a8edc2bdf599db781ad98f Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 18:21:17 -0700 Subject: [PATCH 07/13] spec(AST-100): scope Intent and Purpose to Core and Lab --- docs/architecture/interaction-modality.md | 4 ++-- docs/specs/AST-100-release-velocity/spec.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index 03be616d38e2f..461dcb3e0253e 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -46,8 +46,8 @@ deciding_specs: [spec:AST-100/DEC-1] Astryx components behave predictably when people move between keyboard, pointer, touch, pen, and programmatic focus. Essential actions remain perceivable and reachable while their controlled state or task context is presented, and newer user -intent remains authoritative over stale work, and every gesture reads the same -release velocity. This record defines those shared interaction invariants, the +intent remains authoritative over stale work, and every Core and Lab gesture +reads the same release velocity. This record defines those shared interaction invariants, the one gesture velocity source, the shared modality state, the boundary between modality and component focus ownership, and the evidence required when any of them changes. diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 483e8ca7e3a7b..2d5c49b78773a 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -35,8 +35,8 @@ affects_consumer_docs: [] ## Intent When a person flicks a sheet, a toast, a row, a page, or a wheel and lifts -their finger, every Astryx component reads the same speed from that motion, so -a flick of the same speed does the same thing everywhere, and a finger that +their finger, every Core and Lab component reads the same speed from that +motion, so a flick of the same speed does the same thing in each of them, and a finger that stopped before lifting never counts as a flick. One release filter defines the speed every component reads; components decide only what a given velocity means for them. From 286feb32994076d1c1ab09efed934ef8a371f04a Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 19:00:12 -0700 Subject: [PATCH 08/13] spec(architecture): INV10 names Lab --- docs/architecture/interaction-modality.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index 461dcb3e0253e..d1ea550f1d74a 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -153,8 +153,8 @@ work. 0 after a still contact, is the only lift velocity a Core component reads (`spec:AST-100`). It is not exported. No Core component keeps its own sample buffer, velocity math, or alternative release filter; a component's flick - threshold compares the tracker's release velocity. Web packages outside - Core, such as Lab, cannot import the tracker; a gesture there keeps one local tracker with the + threshold compares the tracker's release velocity. Lab cannot import the + tracker; a Lab gesture keeps one local tracker with the same release filter, window, and stillness interval, so it reports the same velocity for the same motion. From f26ad7b9fd59364871decf205341a307aebee65d Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 19:27:42 -0700 Subject: [PATCH 09/13] spec(AST-100): FR2 reads as iOS with a stillness reset; INV10 records the blend --- docs/architecture/interaction-modality.md | 36 ++++++++------- docs/specs/AST-100-release-velocity/spec.md | 51 +++++++++++---------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index d1ea550f1d74a..2d5e1eaed5c91 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -149,14 +149,16 @@ work. and its direct owner rather than being recast as interaction reachability. - **INV10 — Gesture velocity has one owner.** In `@astryxdesign/core`, one internal velocity tracker owns a gesture's pointer samples and reports - velocity, and its one release filter, a fixed sample window with a reset to - 0 after a still contact, is the only lift velocity a Core component reads - (`spec:AST-100`). It is not exported. No Core component keeps its own sample + velocity, and its one release filter is the only lift velocity a Core + component reads (`spec:AST-100`). The filter is iOS's measured blend: a + pan's velocity is 0.2 times the newest interval's velocity plus 0.8 times + the previous interval's, updated on each moved sample, and a scrolling + surface's release blends the last two pan values 0.25 and 0.75; a contact + still for longer than the stillness interval before lifting reads 0. It is not exported. No Core component keeps its own sample buffer, velocity math, or alternative release filter; a component's flick threshold compares the tracker's release velocity. Lab cannot import the - tracker; a Lab gesture keeps one local tracker with the - same release filter, window, and stillness interval, so it reports the same - velocity for the same motion. + tracker; a Lab gesture keeps one local tracker with the same blend and + stillness interval, so it reports the same velocity for the same motion. ## Allowed variation @@ -235,17 +237,17 @@ reachability, newer-intent precedence, and the evidence/scope guard were approve ## Verification -| Invariant | Evidence | Failure signal | -| ---------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| INV1, INV2 | Programmatic-focus cases after keyboard and pointer input in representative component tests | Programmatic focus invents a modality, or pointer history paints the keyboard indicator | -| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out | -| INV4 | Keyboard, mouse, touch, and pen browser paths where applicable | Hover-only behavior, sticky touch hover, or unreachable action | -| INV5 | Disabled, busy, and read-only DOM and activation assertions | Inactive control reacts, eligible control loses focus, or state changes with modality | -| INV6 | Public API review and representative source inspection | A component adds caller-controlled modality without a separate API decision | -| INV7 | Rendered-browser affected-state checks across geometry, clipping, scrolling, hit testing, built-in and custom-renderer paths | At an offered interaction point one modality loses every essential path, or evidence substitutes class equality for reachability/perceptibility | -| INV8 | Owner-defined intent order, pending, close, cancellation, disablement, and unmount mutations | Older work changes current content, selection, status or announcement, visibility, focus, or activation after owner-defined supersession | -| INV9 | Concrete-harm reproduction, representative normal/legacy/no-new-prop paths, and coincident public-delta inventory | Unsupported or aesthetic preference is treated as harm, unaffected behavior changes, or an API, layout, sizing, default, sticky, or exception delta escapes direct authority | -| INV10 | Source boundary check over Core, a Lab-to-Core comparison on one recorded stream, and release-filter unit tests | A Core component with its own sample buffer, velocity math, or release filter; a Lab tracker reporting a different velocity for the same stream; an export of the tracker; a non-zero release after a still pause | +| Invariant | Evidence | Failure signal | +| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| INV1, INV2 | Programmatic-focus cases after keyboard and pointer input in representative component tests | Programmatic focus invents a modality, or pointer history paints the keyboard indicator | +| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out | +| INV4 | Keyboard, mouse, touch, and pen browser paths where applicable | Hover-only behavior, sticky touch hover, or unreachable action | +| INV5 | Disabled, busy, and read-only DOM and activation assertions | Inactive control reacts, eligible control loses focus, or state changes with modality | +| INV6 | Public API review and representative source inspection | A component adds caller-controlled modality without a separate API decision | +| INV7 | Rendered-browser affected-state checks across geometry, clipping, scrolling, hit testing, built-in and custom-renderer paths | At an offered interaction point one modality loses every essential path, or evidence substitutes class equality for reachability/perceptibility | +| INV8 | Owner-defined intent order, pending, close, cancellation, disablement, and unmount mutations | Older work changes current content, selection, status or announcement, visibility, focus, or activation after owner-defined supersession | +| INV9 | Concrete-harm reproduction, representative normal/legacy/no-new-prop paths, and coincident public-delta inventory | Unsupported or aesthetic preference is treated as harm, unaffected behavior changes, or an API, layout, sizing, default, sticky, or exception delta escapes direct authority | +| INV10 | Source boundary check over Core, a Lab-to-Core comparison on one recorded stream, and release-filter unit tests over recorded iOS pan and scroll-view streams | A Core component with its own sample buffer, velocity math, or release filter; a Lab tracker reporting a different velocity for the same stream; an export of the tracker; a non-zero release after a still pause | Real-browser evidence is required when the behavior depends on `:focus-visible`, pointer capability, touch or pen synthesis, rendered focus diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 2d5c49b78773a..735cf1b5923f9 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -60,13 +60,15 @@ means for them. dismiss, reports the same velocity, in CSS pixels per second on each physical axis, for the same contact motion. `architecture:interaction-modality` INV10 owns the source in Core and how a Lab component matches it. -- **FR2 — A still finger never flicks.** The velocity a component reads when - the contact lifts reflects only the motion just before the lift: it is 0 - when the contact stayed still for longer than a fixed stillness interval - before lifting, and motion older than a fixed window before the lift does not - change it. Every component reads the same release velocity and none reads - another estimate. The window and the stillness interval are internal tuning - values. +- **FR2 — A moving finger reads as on iOS; a still finger never flicks.** The + velocity a component reads when the contact lifts is the velocity iOS + reports for the same motion: a pan's velocity for a dragged surface, and a + scroll view's release velocity for a scrolling surface. It is 0 when the + contact stayed still for longer than a fixed stillness interval before + lifting, the one case where it differs from iOS. Every component reads the + same release velocity and none reads another estimate. The stillness + interval is an internal tuning value; how the velocity is computed is + `architecture:interaction-modality` INV10. - **FR3 — Thresholds sit on top of the one velocity.** A component's flick, fling, or commit threshold compares the FR2 velocity, possibly with travel or projection the component owns. Thresholds are per-component tuning that @@ -94,8 +96,8 @@ means for them. ## Current-state impact - No velocity source exists in Core on `main`. Its first landing meets FR1–FR5 - and `architecture:interaction-modality` INV10: one release filter with the - FR2 stillness reset, with no selectable alternative filters. A Lab gesture + and `architecture:interaction-modality` INV10: iOS's blend with the FR2 + stillness reset, and no selectable alternative filters. A Lab gesture matches it as INV10 describes. - BottomSheet's drag estimates velocity from a two-point window over its recent samples with event timestamps. Under FR1 and FR2 it reads the tracker. @@ -110,17 +112,17 @@ means for them. ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| -------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components reporting different velocities for the same stream, or a unit other than pixels per second | -| FR2 | Release velocity tests through a component | steady flick; acceleration before lift; a pause longer than the stillness interval before lift; one sample; samples outside the window | A non-zero release after a still pause, or motion outside the window changing the result | -| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components acting on different velocities for the same flick, or a threshold reachable from public API | -| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | -| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | +| Contract | Verification | Representative states | Mutation or failure expectation | +| -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components reporting different velocities for the same stream, or a unit other than pixels per second | +| FR2 | Release velocity tests through a component over recorded iOS streams | recorded pan and scroll-view releases; acceleration before lift; a pause longer than the stillness interval before lift; one sample | A release that differs from the velocity iOS recorded for the same stream, or a non-zero release after a still pause | +| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components acting on different velocities for the same flick, or a threshold reachable from public API | +| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | +| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | ## Decision log -### DEC-1 — One release filter for every gesture; thresholds stay per component +### DEC-1 — One release filter that reads as iOS does, with a stillness reset; thresholds stay per component **Reference:** `spec:AST-100/DEC-1` **Decider:** `cixzhang`, `2026-10-24` @@ -129,13 +131,14 @@ Each component estimating velocity its own way makes the same flick dismiss a toast but not a sheet, and a finger that paused before lifting count as a flick in one place and not another. One release filter, with one source in Core and the same filter in Lab, gives every -component the same speed for the same motion, and the stillness reset -stops a resting finger from flinging. What a speed means stays with each -component as internal tuning, so components keep their feel without a second -estimator. - -Rejected: several selectable estimators or per-component release filters, -which reintroduce the disagreement this record removes. +component the same speed for the same motion. Reading a moving finger the way +iOS does keeps flicks, paging, and dismissal near their thresholds where an +iPhone puts them, and the stillness reset stops a resting finger from flinging, +which is the one place the filter departs from iOS. What a speed means stays +with each component as internal tuning, so components keep their feel without +a second estimator. + +Rejected: a fixed time window, which reads quick flicks much faster than iOS; iOS's blend with no stillness reset, which flings after a rest; and several selectable estimators or per-component filters, which reintroduce the disagreement this record removes. ## Open questions From 3c06f3ead8a2d9450e5f6e7deb7977ac2a0971b9 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 19:28:10 -0700 Subject: [PATCH 10/13] spec(AST-100): unsupported case counts moved samples --- docs/specs/AST-100-release-velocity/spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 735cf1b5923f9..ace9984669988 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -87,7 +87,7 @@ means for them. - Supported feature/engine floor: the package's supported browsers (`spec:AST-013` FR1, FR3); pointer events with event timestamps. -- Unsupported behavior: a gesture with fewer than two samples in the window +- Unsupported behavior: a gesture with fewer than two moved samples has a release velocity of 0. - Browser evidence: none required by this record; the unit and component tests in Verification prove FR1–FR5, and real-device feel for From bbc451584b413323b15a57244c5baae9bfb2ddb5 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 19:59:18 -0700 Subject: [PATCH 11/13] spec(AST-100): sameness per kind of surface (dragged vs scrolling); INV10 names the newest pan value's weight --- docs/architecture/interaction-modality.md | 3 ++- docs/specs/AST-100-release-velocity/spec.md | 24 +++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index 2d5e1eaed5c91..de4340a1a3261 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -153,7 +153,8 @@ work. component reads (`spec:AST-100`). The filter is iOS's measured blend: a pan's velocity is 0.2 times the newest interval's velocity plus 0.8 times the previous interval's, updated on each moved sample, and a scrolling - surface's release blends the last two pan values 0.25 and 0.75; a contact + surface's release is 0.25 times the newest pan value plus 0.75 times the + previous one; a contact still for longer than the stillness interval before lifting reads 0. It is not exported. No Core component keeps its own sample buffer, velocity math, or alternative release filter; a component's flick threshold compares the tracker's release velocity. Lab cannot import the diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index ace9984669988..9a8d4517e21f6 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -35,8 +35,9 @@ affects_consumer_docs: [] ## Intent When a person flicks a sheet, a toast, a row, a page, or a wheel and lifts -their finger, every Core and Lab component reads the same speed from that -motion, so a flick of the same speed does the same thing in each of them, and a finger that +their finger, every Core and Lab component of that kind reads the same speed +from that motion, as iOS does, so a flick of the same speed does the same thing +in each of them, and a finger that stopped before lifting never counts as a flick. One release filter defines the speed every component reads; components decide only what a given velocity means for them. @@ -54,19 +55,20 @@ means for them. ## Requirements -- **FR1 — One velocity for every gesture.** Every Core and Lab component that - reads the velocity of a pointer gesture, including a sheet's drag, a toast's - swipe, a row swipe, paging, a wheel picker, a navigation pop, and interactive - dismiss, reports the same velocity, in CSS pixels per second on each physical - axis, for the same contact motion. `architecture:interaction-modality` INV10 +- **FR1 — One velocity per kind of surface.** Every Core and Lab component that + reads the velocity of a pointer gesture reports it in CSS pixels per second + on each physical axis, and components of the same kind report the same + velocity for the same contact motion. Dragged surfaces are a sheet's drag, a + toast's swipe, a row swipe, a navigation pop, and interactive dismiss; + scrolling surfaces are paging and a wheel picker. `architecture:interaction-modality` INV10 owns the source in Core and how a Lab component matches it. - **FR2 — A moving finger reads as on iOS; a still finger never flicks.** The velocity a component reads when the contact lifts is the velocity iOS reports for the same motion: a pan's velocity for a dragged surface, and a scroll view's release velocity for a scrolling surface. It is 0 when the contact stayed still for longer than a fixed stillness interval before - lifting, the one case where it differs from iOS. Every component reads the - same release velocity and none reads another estimate. The stillness + lifting, the one case where it differs from iOS. Every component of a kind + reads the same release velocity and none reads another estimate. The stillness interval is an internal tuning value; how the velocity is computed is `architecture:interaction-modality` INV10. - **FR3 — Thresholds sit on top of the one velocity.** A component's flick, @@ -130,8 +132,8 @@ means for them. Each component estimating velocity its own way makes the same flick dismiss a toast but not a sheet, and a finger that paused before lifting count as a flick in one place and not another. One release filter, with one source in -Core and the same filter in Lab, gives every -component the same speed for the same motion. Reading a moving finger the way +Core and the same filter in Lab, gives every component of a kind the same +speed for the same motion. Reading a moving finger the way iOS does keeps flicks, paging, and dismissal near their thresholds where an iPhone puts them, and the stillness reset stops a resting finger from flinging, which is the one place the filter departs from iOS. What a speed means stays From 0d6f631400bf5c4578ed97c9c9f256751e1ebe61 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 20:41:51 -0700 Subject: [PATCH 12/13] spec(AST-100): sameness per kind in Purpose, Deciding specs and failure cells; components share the reading, not the outcome --- docs/architecture/interaction-modality.md | 6 ++--- docs/specs/AST-100-release-velocity/spec.md | 26 ++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/architecture/interaction-modality.md b/docs/architecture/interaction-modality.md index de4340a1a3261..0a1eda3d38be2 100644 --- a/docs/architecture/interaction-modality.md +++ b/docs/architecture/interaction-modality.md @@ -46,8 +46,8 @@ deciding_specs: [spec:AST-100/DEC-1] Astryx components behave predictably when people move between keyboard, pointer, touch, pen, and programmatic focus. Essential actions remain perceivable and reachable while their controlled state or task context is presented, and newer user -intent remains authoritative over stale work, and every Core and Lab gesture -reads the same release velocity. This record defines those shared interaction invariants, the +intent remains authoritative over stale work, and every Core and Lab gesture of one kind, dragged or scrolling, reads the +same release velocity. This record defines those shared interaction invariants, the one gesture velocity source, the shared modality state, the boundary between modality and component focus ownership, and the evidence required when any of them changes. @@ -230,7 +230,7 @@ is asked to carry a new decision. ## Deciding specs -`spec:AST-100/DEC-1` decides one release velocity for every gesture (INV10). +`spec:AST-100/DEC-1` decides one release velocity per kind of surface (INV10). Otherwise no separate specification changes this record. The last-input rule was approved as a system architecture decision by `cixzhang` on 2026-08-30. Essential-action reachability, newer-intent precedence, and the evidence/scope guard were approved by diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index 9a8d4517e21f6..cc5d1f0caec09 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -36,9 +36,9 @@ affects_consumer_docs: [] When a person flicks a sheet, a toast, a row, a page, or a wheel and lifts their finger, every Core and Lab component of that kind reads the same speed -from that motion, as iOS does, so a flick of the same speed does the same thing -in each of them, and a finger that -stopped before lifting never counts as a flick. One release filter defines the +from that motion, as iOS does, and a finger that stopped before lifting never +counts as a flick. Components share the reading of a flick; each decides, by +its own threshold, what that speed does. One release filter defines the speed every component reads; components decide only what a given velocity means for them. @@ -114,13 +114,13 @@ means for them. ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components reporting different velocities for the same stream, or a unit other than pixels per second | -| FR2 | Release velocity tests through a component over recorded iOS streams | recorded pan and scroll-view releases; acceleration before lift; a pause longer than the stillness interval before lift; one sample | A release that differs from the velocity iOS recorded for the same stream, or a non-zero release after a still pause | -| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components acting on different velocities for the same flick, or a threshold reachable from public API | -| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | -| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | +| Contract | Verification | Representative states | Mutation or failure expectation | +| -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components of the same kind reporting different velocities for the same stream, or a unit other than pixels per second | +| FR2 | Release velocity tests through a component over recorded iOS streams | recorded pan and scroll-view releases; acceleration before lift; a pause longer than the stillness interval before lift; one sample | A release that differs from the velocity iOS recorded for the same stream, or a non-zero release after a still pause | +| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components of the same kind reading different velocities for the same flick, or a threshold reachable from public API | +| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | +| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | ## Decision log @@ -129,9 +129,9 @@ means for them. **Reference:** `spec:AST-100/DEC-1` **Decider:** `cixzhang`, `2026-10-24` -Each component estimating velocity its own way makes the same flick dismiss a -toast but not a sheet, and a finger that paused before lifting count as a -flick in one place and not another. One release filter, with one source in +Each component estimating velocity its own way reads the same flick at +different speeds in components of the same kind, and counts a finger that +paused before lifting as a flick in one place and not another. One release filter, with one source in Core and the same filter in Lab, gives every component of a kind the same speed for the same motion. Reading a moving finger the way iOS does keeps flicks, paging, and dismissal near their thresholds where an From 9a6e9a4e7acc1a8f56b6f8bf283c5c0e2c4b6cd1 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Sat, 24 Oct 2026 21:31:59 -0700 Subject: [PATCH 13/13] spec(AST-100): FR4 needs real-browser evidence (AST-013 FR10) --- docs/specs/AST-100-release-velocity/spec.md | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/specs/AST-100-release-velocity/spec.md b/docs/specs/AST-100-release-velocity/spec.md index cc5d1f0caec09..da0600a3a3d49 100644 --- a/docs/specs/AST-100-release-velocity/spec.md +++ b/docs/specs/AST-100-release-velocity/spec.md @@ -91,9 +91,11 @@ means for them. (`spec:AST-013` FR1, FR3); pointer events with event timestamps. - Unsupported behavior: a gesture with fewer than two moved samples has a release velocity of 0. -- Browser evidence: none required by this record; the unit and component - tests in Verification prove FR1–FR5, and real-device feel for - each component remains that component's evidence. +- Browser evidence: FR4 depends on the timestamps browsers put on pointer + events, so it needs real-browser evidence in Safari on iOS and Chrome on + Android (`spec:AST-013` FR10); unit and component tests in Verification prove + FR1–FR3 and FR5, and real-device feel for each component remains that + component's evidence. ## Current-state impact @@ -114,13 +116,13 @@ means for them. ## Verification -| Contract | Verification | Representative states | Mutation or failure expectation | -| -------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components of the same kind reporting different velocities for the same stream, or a unit other than pixels per second | -| FR2 | Release velocity tests through a component over recorded iOS streams | recorded pan and scroll-view releases; acceleration before lift; a pause longer than the stillness interval before lift; one sample | A release that differs from the velocity iOS recorded for the same stream, or a non-zero release after a still pause | -| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components of the same kind reading different velocities for the same flick, or a threshold reachable from public API | -| FR4 | Unit tests with handler delay and per-pointer streams | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | -| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | +| Contract | Verification | Representative states | Mutation or failure expectation | +| -------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| FR1 | One recorded sample stream read through two different components, plus a unit check | a sheet drag and a row swipe fed the same stream; a Lab gesture and a Core gesture fed the same stream; steady motion in x and y | Two components of the same kind reporting different velocities for the same stream, or a unit other than pixels per second | +| FR2 | Release velocity tests through a component over recorded iOS streams | recorded pan and scroll-view releases; acceleration before lift; a pause longer than the stillness interval before lift; one sample | A release that differs from the velocity iOS recorded for the same stream, or a non-zero release after a still pause | +| FR3 | Component tests at each threshold | a flick just under and just over a component's threshold; the same velocity across two components | Two components of the same kind reading different velocities for the same flick, or a threshold reachable from public API | +| FR4 | Unit tests with handler delay and per-pointer streams, plus real-browser pointer-event streams in Safari on iOS and Chrome on Android | delayed handlers with fixed event timestamps; touch, pen, and mouse streams | Velocity that changes with handler delay or pointer type | +| FR5 | Component tests in both directions | a flick toward the inline end in left-to-right and right-to-left | A flick toward the inline end treated as the opposite action in right-to-left | ## Decision log