Skip to content

Commit 39690bf

Browse files
authored
spec(AST-100): one velocity tracker and one release filter for every gesture (#8312)
New system spec spec:AST-100 (release velocity) plus architecture:interaction-modality INV10: one Core tracker; one release filter that reads a moving finger as iOS does (pan 0.2/0.8, scroll release 0.25/0.75) with a stillness reset; thresholds per component; event-clock timestamps; direction from the rendered direction.
1 parent ebfae1a commit 39690bf

2 files changed

Lines changed: 184 additions & 17 deletions

File tree

‎docs/architecture/interaction-modality.md‎

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authority: current
77
archive_reason: null
88
superseded_by: null
99
approved_by: cixzhang
10-
approved_at: 2026-09-10
10+
approved_at: 2026-10-24
1111
owners: [cixzhang]
1212
applies_to:
1313
[
@@ -25,7 +25,7 @@ verified_by:
2525
packages/core/src/Selector/Selector.test.tsx,
2626
packages/core/src/Slider/Slider.test.tsx,
2727
]
28-
deciding_specs: []
28+
deciding_specs: [spec:AST-100/DEC-1]
2929
---
3030

3131
# Interaction modality architecture
@@ -46,8 +46,9 @@ deciding_specs: []
4646
Astryx components behave predictably when people move between keyboard, pointer,
4747
touch, pen, and programmatic focus. Essential actions remain perceivable and
4848
reachable while their controlled state or task context is presented, and newer user
49-
intent remains authoritative over stale work. This record defines those shared
50-
interaction invariants, the shared modality state, the boundary between modality and
49+
intent remains authoritative over stale work, and every Core and Lab gesture of one kind, dragged or scrolling, reads the
50+
same release velocity. This record defines those shared interaction invariants, the
51+
one gesture velocity source, the shared modality state, the boundary between modality and
5152
component focus ownership, and the evidence required when any of them changes.
5253

5354
It does not define focus-ring appearance, hover paint, press treatment, or new
@@ -146,6 +147,19 @@ work.
146147
correction already settled by current component, family, design, theme, or
147148
objective accessibility authority; that correction uses rendered-pixel evidence
148149
and its direct owner rather than being recast as interaction reachability.
150+
- **INV10 — Gesture velocity has one owner.** In `@astryxdesign/core`, one
151+
internal velocity tracker owns a gesture's pointer samples and reports
152+
velocity, and its one release filter is the only lift velocity a Core
153+
component reads (`spec:AST-100`). The filter is iOS's measured blend: a
154+
pan's velocity is 0.2 times the newest interval's velocity plus 0.8 times
155+
the previous interval's, updated on each moved sample, and a scrolling
156+
surface's release is 0.25 times the newest pan value plus 0.75 times the
157+
previous one; a contact
158+
still for longer than the stillness interval before lifting reads 0. It is not exported. No Core component keeps its own sample
159+
buffer, velocity math, or alternative release filter; a component's flick
160+
threshold compares the tracker's release velocity. Lab cannot import the
161+
tracker; a Lab gesture keeps one local tracker with the same blend and
162+
stillness interval, so it reports the same velocity for the same motion.
149163

150164
## Allowed variation
151165

@@ -209,28 +223,32 @@ is asked to carry a new decision.
209223
behavior, essential-action availability, accepted intent, supersession, pending
210224
lifetimes, and focus-paint ownership.
211225
- `architecture:react-component-runtime` owns shared lifecycle and resource
212-
mechanisms. This record owns only the cross-cutting modality-path and
213-
no-stale-interaction-outcome requirements.
226+
mechanisms. This record owns only the cross-cutting modality-path,
227+
no-stale-interaction-outcome, and gesture-velocity-source requirements.
228+
- The Core velocity tracker and its release filter (INV10) — the one source of
229+
gesture velocity for Core components; not exported.
214230

215231
## Deciding specs
216232

217-
No separate specification changes this record. The last-input rule was approved as
233+
`spec:AST-100/DEC-1` decides one release velocity per kind of surface (INV10).
234+
Otherwise no separate specification changes this record. The last-input rule was approved as
218235
a system architecture decision by `cixzhang` on 2026-08-30. Essential-action
219236
reachability, newer-intent precedence, and the evidence/scope guard were approved by
220237
`cixzhang` on 2026-09-10.
221238

222239
## Verification
223240

224-
| Invariant | Evidence | Failure signal |
225-
| ---------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
226-
| 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 |
227-
| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out |
228-
| INV4 | Keyboard, mouse, touch, and pen browser paths where applicable | Hover-only behavior, sticky touch hover, or unreachable action |
229-
| INV5 | Disabled, busy, and read-only DOM and activation assertions | Inactive control reacts, eligible control loses focus, or state changes with modality |
230-
| INV6 | Public API review and representative source inspection | A component adds caller-controlled modality without a separate API decision |
231-
| 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 |
232-
| 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 |
233-
| 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 |
241+
| Invariant | Evidence | Failure signal |
242+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
243+
| 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 |
244+
| INV3 | Direct-owner, wrapper-owner, replaceable-indicator, and nested-action cases | No indicator, two indicators, or replacement content can opt out |
245+
| INV4 | Keyboard, mouse, touch, and pen browser paths where applicable | Hover-only behavior, sticky touch hover, or unreachable action |
246+
| INV5 | Disabled, busy, and read-only DOM and activation assertions | Inactive control reacts, eligible control loses focus, or state changes with modality |
247+
| INV6 | Public API review and representative source inspection | A component adds caller-controlled modality without a separate API decision |
248+
| 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 |
249+
| 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 |
250+
| 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 |
251+
| 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 |
234252

235253
Real-browser evidence is required when the behavior depends on
236254
`:focus-visible`, pointer capability, touch or pen synthesis, rendered focus

0 commit comments

Comments
 (0)