Repository navigation
Conversation
A gesture's deadline whose timer runs late yields one task, so input queued behind the block can come first. Touch moves can reach the page later than that: Chromium sends them with the next frame. Then a long press whose finger drifted in time still begins. These cases expect the deadline to wait for that input: a drift that reaches the page after the next task fails the press, and an on-time deadline waits while input from before it still comes late. An input stamped at or past the deadline ends the wait at once.
The arena's late timer yielded one task before it ran a deadline, so input queued behind a block could come first. A touch move can reach the page later than that: Chromium sends it with the next frame. So a long press, a List reorder hold or a Pager's catch could begin though its finger drifted or lifted in time. Now a deadline whose timer runs more than 17 ms late waits 50 ms for that input. The arena notes each touch input that reaches the page more than 33 ms after its own time, and such input from before the deadline keeps it waiting. An input stamped at or past the deadline runs the deadline first, which ends the wait. A timer up to 17 ms late keeps the one-task yield. spec:AST-094 FR16 records the wait. The arena's and the Pager's tests that run a deadline late now run the wait too. A comment's citation of FR16 goes, as the source-comment rule asks.
A coalesced move carries the samples since the previous one. The arena runs every deadline due by the move's last sample before it delivers the move, so a drift sampled before a long press's deadline reaches the press after it began. This case expects the samples stamped before the deadline to come first, so the drift fails the press. A move whose samples stay inside the press's tolerance still lets it begin at its deadline.
The arena ran every deadline due by a move's last sample before it delivered the move, so a coalesced move's earlier samples reached recognizers after a deadline they came before. A long press began though its finger drifted before its deadline, as when the samples of a blocked page arrive in one pointer move. Now a timer deadline that falls among a move's new samples splits the move: the samples stamped before the deadline go first, the deadline runs at its own time, and the rest follow. spec:AST-094 FR16 records it, beside the late deadline's wait.
Two long presses whose deadlines both ran late behind one block: the first waits 50 ms for queued input, and the second comes due during that wait. Today the second waits 50 ms more, though no input came late. This case expects it to run as the first wait ends.
A deadline that came due while the arena waited for queued input counted as late on its own and waited 50 ms more, though no input came late. The arena now notes when a wait ends with none still coming late, and counts a deadline's lateness from then. spec:AST-094 FR16 says so.
The late wait's comment in GestureArena.ts and the changeset's second sentence each ran past 25 words. Each is now two sentences. No code changes.
The owners asked for the late wait's cost in its own line, since it changes when every recognizer can resolve. spec:AST-094 FR16 now says that every recognizer's deadline whose timer runs more than 17 ms late waits those 50 ms, even when no input is queued.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 88132ea |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval waits on an engineering owner's spec decision, and two findings need changes before this can be approved.
This pull request writes a new rule into spec:AST-094 FR16 — a deadline whose timer runs more than 17 ms late waits 50 ms even with nothing queued, input from before it that arrives more than 33 ms late keeps it waiting, and a coalesced move's samples are reordered around a deadline — that no current record states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, the author included if they are an engineering owner, or says what to change.
- The 50 ms wait is armed for every recognizer and every pointer kind (
packages/core/src/gestures/GestureArena.ts:1253-1271reads no pointer type), so on a busy page a mouse or trackpad user's Pager catch, long press and deferred click resolve up to 50 ms later, as this pull request's own mouse case shows (packages/core/src/hooks/usePager.test.ts:3561-3566); gate the wait to coarse and pen contacts, or cite an explicit owner decision for the desktop change. - The release note says "A long press, a List reorder hold or a Pager's catch whose finger drifted or lifted in time now ends as it should", but the held-finger long press of ContextMenu and menu triggers runs on
packages/core/src/hooks/longPressDetector.ts:160-173, which keeps the single-task yield this change replaces in the arena; narrow the note to the gesture arena's recognizers, or extend that detector here too.
Two smaller points: a wait whose own timer runs more than 17 ms late starts another 50 ms wait, with no bound while the page keeps blocking (GestureArena.ts:1253-1259), and the description's reading of FR16 ("a blocked page delays a report, never changes it") is not what the current clause says ("delays the report and never the moment reported"), so it does not by itself make today's behavior a defect.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims
- Each fix's red-first cases fail on its parent — verified: the head's three test files run against the issued base fail exactly the five named cases, and the wait-end case fails on its own parent's arena.
- Each case passes after the change — verified: 40 gesture and Pager test files, 1,076 tests green at this head.
- A timer at most 17 ms late runs its deadline at once, as before — verified: the one-task yield still runs for a deadline whose lateness is within the threshold.
- One arena test and three Pager tests now wait out the new window — verified: one case in the arena suite and three in the Pager suite.
- Size +329/−13, source +178/−6, tests +135/−5, record and release note +16/−2 — verified line for line (342 authored lines).
- No new public API — verified: the repository's API generator reports no added, changed or removed rows for Core and the seven published themes.
- First-load JavaScript on the docs, form, menu and table pages changes by 0 B — verified: no growth on any of the four, and the new code is in none of their eager graphs.
- Thirteen components grow 425–521 B gzip — verified: thirteen component imports grow 432–491 B in the repository's own size harness; CSS unchanged — verified, zero delta for every component.
- Every other component moves 6 B or less — not confirmed: the same harness showed larger moves on seven text and locale-heavy entries that a gesture change cannot explain, which reads as build noise rather than a defect.
- Public text and artifacts carry no internal context — verified: every added line, each commit message, the title, body and branch name scanned.
- Strict lint, formatting, changeset and knowledge checks pass at this head — verified by running them.
- The record clause quoted as "a blocked page delays a report, never changes it" — false as a reading of the current clause, which is about the moment reported, not about which report comes out.
- "No new interaction model is hidden under the bug-fix label" — not supported: a 50 ms wait on every late deadline, with nothing queued and no pointer gate, is new interaction timing.
- The wider test run (hundreds of files, the interaction specs in two engines) — not checked: the heavy checks are skipped at this head, so only the gesture and Pager units were run here.
Files
packages/core/src/gestures/GestureArena.ts— findings 1 and 3..changeset/gesture-arena-late-input.md— finding 2.docs/specs/AST-094-touch-presentations/spec.md— held for an engineering owner's approval.packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts— clear: five cases, red-first on the base, each asserting one rule.packages/core/src/gestures/__tests__/arena.test.ts— clear: the renamed case matches the new behavior.packages/core/src/hooks/usePager.test.ts— clear as a file; its three edits are the evidence behind finding 1.
From review: the late deadline's wait reads no pointer kind and can re-arm itself. - A mouse's late deadline keeps the one-task yield it has on main, with no wait. The Pager's mouse catch case returns to main's form. - A pen's late deadline waits, as a finger's does. - A wait whose own timer runs late, with nothing queued, runs the deadline instead of waiting again.
From review, and the owners' ruling on desktop timing: - A late deadline waits for queued input only while the latest contact is a finger or a pen, and only their late input keeps it waiting. A mouse or trackpad keeps the one-task yield it has on main. - Only the deadline's own timer counts as late. A wait whose own timer runs late runs the deadline, since only input from before the deadline extends a wait. spec:AST-094 FR16 states the gate, and its cost line names a finger's or pen's deadline. The changeset names the gesture arena's users only.
The header's sentence on the late wait ran past 25 words. It is now two sentences. No code changes.
|
Deployment failed for project astryx with the following error: |
|
/approve-spec b411003 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft and its branch is in a fork, so CI runs once it is marked ready for review and a maintainer adds the ci:run label.
The arena change matches FR16 of the touch-presentations record as this pull request amends it, an engineering owner approved that text for this head, and the new arena cases fail on main and pass here; the earlier findings on mouse timing, the repeated wait and the release note are fixed. One non-blocking note:
- FR16's first new sentence gates the wait on the latest contact being a finger or a pen, but its third says "a finger's or pen's deadline", so the two disagree when a mouse and a finger are both in use; giving the third sentence the same gate fixes it (
spec.md:517-521).
Claims and files checked
Review mode: full; reason: spec-record
Claims (description):
- On a busy page a touch deadline can run before the finger's input arrives, so a hold or a catch begins anyway: verified, the new arena cases fail on
main(arenaTimersAndClaims.test.ts:111,:234). - A late deadline yields one task while a touch move can arrive a frame later: verified for the yield in
main's arena; the frame lag is browser behavior, not measured here. - A coalesced move's earlier samples arrive after the deadline: verified,
mainruns every timer due by the move's last sample before delivering it. - The quoted current FR16 text: verified against the record on
main. - The FR16 text this pull request adds: verified, identical to
spec.md:517-526. - Only
GestureArena.tschanges in source, and a mouse or trackpad keeps the one-task yield: verified (GestureArena.ts:1291,:1310-1316; trackpad gestures begin as a mouse,GestureHost.ts:2641). - A ContextMenu touch-hold pull request builds on this: outside this pull request, not checked.
- Each fix's red-first cases fail on its parent: verified; six fail on
main, the mouse and wait-bound cases fail on the commit before them, and the due-during-a-wait case fails on the commit before it. - A mouse's late deadline and a timer at most 17 ms late run as on
main: verified (GestureArena.ts:1310-1316). - One arena test and two Pager tests now wait: verified, one arena case (present in two test files) and
usePager.test.ts:902,:2051. - The listed test, typecheck, lint and build runs: partly reproduced; the gesture and Pager suites (41 files, 1,088 tests), the core typecheck, eslint, prettier and the knowledge check pass at this head; the interaction specs and the Storybook build were not rerun.
- The last commit changes only a comment: verified.
- No public API change: verified, the API generator reports 0 rows for core and the seven themes.
- Size +400/−14 with the stated split: verified.
- First-load gzip: docs and form 0 B, menu and table −1 B: verified within 1 B (0, 0, −2, −2 B).
- 13 components grow 542–699 B: partly verified; Lightbox grows 543 B, the others were not measured.
- FR16's addition is seven sentences, one rule each: seven sentences verified; sentences one and three state the gate differently (note above).
Claims (release note):
- A touch gesture's deadline now runs after the input stamped before it: verified for the arena's deadlines.
- A finger's or pen's deadline more than 17 ms late waits 50 ms: verified (
GestureArena.ts:1289-1306). - Each input from before it that comes late keeps it waiting: verified (
GestureArena.ts:1136-1143). - A mouse's or trackpad's deadline does not wait: verified, except a mouse's deadline while a finger is the latest contact (note above).
- A deadline among a coalesced move's samples runs between them: verified (
GestureArena.ts:400-418). - A List reorder hold or a Pager catch whose finger drifted or lifted in time now ends as it should: verified, both are arena-timed (
ListReorderTouch.ts:70,usePager.ts:489).
Files:
.changeset/gesture-arena-late-input.md: clear.docs/specs/AST-094-touch-presentations/spec.md: non-blocking note on the two gate sentences.packages/core/src/gestures/GestureArena.ts: non-blocking note on two doc comments; otherwise clear.packages/core/src/gestures/__tests__/arena.test.ts: clear.packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts: clear.packages/core/src/hooks/usePager.test.ts: clear.
From review's two non-blocking notes: - spec:AST-094 FR16's third sentence now uses the first sentence's gate, "while the latest contact is a finger or a pen", as the arena does. It no longer names a finger's or pen's deadline. - GestureArena.ts drops the two comments that restated isFingerOrPenContact and isFingerOrPen. noteArrival's comment now says why only a finger's or pen's late input is noted. No code changes.
Main's meta#11735 re-aligned spec:AST-094's verification table and widened its FR5 row. The one conflict is that table. The merge takes main's table and re-applies this pull request's two additions to the FR15-FR17 row: the late-deadline cases and the failure they catch.
|
/approve-spec ec2e905 |
There was a problem hiding this comment.
Changes requested. The arena change itself is in good shape: the wait, its end conditions and the coalesced split match the amended FR16, every case the verification row names exists, and six of the new cases fail on the base. Two claims have to be corrected before approval.
- Miss: The release note says "A mouse's or trackpad's deadline does not wait" (and the description's "a mouse or trackpad keeps main's one-task yield" repeats it), but the arena gates the wait on the latest contact rather than on the deadline's own pointer, so on a touch-screen laptop or a pen tablet a mouse-held deadline waits 50 ms once a finger or pen lands, and a finger's deadline falls back to the single-task yield once a mouse press lands; state the record's gate instead, for example "While the latest contact is a finger or a pen, a deadline whose timer runs more than 17 ms late waits 50 ms for input still queued; with a mouse or trackpad as the latest contact, deadlines keep today's single-task yield."
- Miss: Dropping
(FR16)from thestop()comment inpackages/core/src/gestures/GestureArena.tsleaves anFR16entry behind ininternal/eslint-plugin-astryx/no-comment-provenance.baseline.json, sonode internal/eslint-plugin-astryx/no-comment-provenance.baseline.mjs --checkfails at this head (it passes on the base) and the Lint job runs that check for this pull request, because it changes a file the baseline lists; run the script without--checkand commit the one-entry change.
The amended FR16 is right as approved, and pnpm specs:for returns the same records and cited claims for that file before and after, so the citation itself needs no replacement.
Claims and files checked
Review mode: same-head; reason: none
- Release note, a touch gesture's deadline now runs after the input stamped before it: verified (the new unit cases fail on the base and pass at this head).
- Release note, a finger's or pen's late deadline waits 50 ms for queued input: verified in substance, but gated on the latest contact rather than on the deadline's pointer kind (see the finding).
- Release note, a mouse's or trackpad's deadline does not wait: false (the finding above; probed on this head).
- Release note, a deadline among a coalesced move's samples runs between them: verified (two cases, one of them red-first).
- Release note, a List reorder hold or a Pager's catch whose finger drifted or lifted in time now ends as it should: verified (both recognizers are arena-timed, and the Pager's touch cases now wait the 50 ms out).
- Description, the fix touches the gesture arena only and the held-finger detector keeps its yield: verified (that detector is untouched and is not arena-timed).
- Description, red-first cases each failing on their parent commit: verified for the base (six of the new cases fail there); the per-parent runs are carried from the previous review.
- Description, the gesture and Pager unit tests pass at this head (1,079): verified, exactly that count.
- Description, strict lint, formatting and the core typecheck pass at this head: verified for the changed files and the core project; the comment-provenance baseline check fails (see the finding).
- Description, the cost is one arena test and two Pager tests that now wait: verified in substance, though the same arena case exists in two test files.
- Description, first-load JavaScript on the four reference pages changes by at most 1 byte: carried from the previous review, which rebuilt the pages and reproduced the numbers within 2 bytes.
- Description, the merge's only conflict was the record's verification table: verified against the merged tree.
- Description, browser interaction and WebKit runs: not checked here; no browser is available to this review.
.changeset/gesture-arena-late-input.md: finding (the mouse sentence above).docs/specs/AST-094-touch-presentations/spec.md: clear (FR16's additions and the verification row match the code, and an engineering owner approved them for this head).packages/core/src/gestures/GestureArena.ts: finding (the dropped citation above); the wait, its end conditions, the latest-contact gate and the coalesced split otherwise read correctly and add no public surface.packages/core/src/gestures/__tests__/arena.test.ts: clear (the existing case now waits the 50 ms out).packages/core/src/gestures/__tests__/arenaTimersAndClaims.test.ts: clear (nine new cases, mutation-sensitive).packages/core/src/hooks/usePager.test.ts: clear (two touch catch cases wait the 50 ms out; the mouse catch case is unchanged).
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A touch gesture's deadline now runs after the input stamped before it. Behind a blocked page, a finger's or pen's deadline whose timer runs more than 17 ms late waits 50 ms for input still queued. Each input from before it that comes late keeps it waiting. A mouse's or trackpad's deadline does not wait. A deadline that falls among a coalesced move's samples runs between them. A List reorder hold or a Pager's catch whose finger drifted or lifted in time now ends as it should. |
There was a problem hiding this comment.
Miss: "A mouse's or trackpad's deadline does not wait" is not what the arena does, and neither is "a finger's or pen's deadline … waits 50 ms": the gate is the latest contact (isLatestContactFingerOrPen, written in began() and untrackedBegan() and read in the timer's gate), which is also what the amended FR16 says. Probed on this head: a long press begun with a mouse waits the 50 ms once a finger lands elsewhere, and a long press begun with a finger keeps the single-task yield once a mouse press lands, so its drift stamped before the deadline still misses it. Suggested wording: "While the latest contact is a finger or a pen, a deadline whose timer runs more than 17 ms late waits 50 ms for input still queued; with a mouse or trackpad as the latest contact, deadlines keep today's single-task yield."
There was a problem hiding this comment.
The description now states the record's gate. Its unchanged-path line reads:
main's one-task yield, with a mouse or trackpad as the latest contact or a timer at most 17 ms late.
The release note changes in this pull request's next push, which merges main once #11450 lands. That commit is ready, and its note uses FR16's words:
While the latest contact is a finger or a pen, a deadline behind a blocked page waits for input still queued before it.
It adds: "With a mouse or trackpad as the latest contact, deadlines keep today's single-task yield."
Records overlap with #11450 and #11205; this PR reconciles after they merge.
User impact
On a busy page, a touch gesture's deadline can run before the finger's input arrives. A long press, a List reorder hold or a Pager's catch then begins anyway.
Problem and solution fit
spec:AST-094FR16 makes durations "deadlines on that clock, so a blocked main thread delays the report and never the moment reported". On that clock a drift at 300 ms precedes a deadline at 500 ms. Behind a block, the arena can still run the deadline first.Expected behavior and authority
spec:AST-094FR16, in its gesture arena section, gains:Smallest restoration
GestureArena.tsonly.Evidence
Scope
Components: gestures, Pager's tests
Testing
Red-first cases, each failing on its parent (
arenaTimersAndClaims.test.tsunless named):waits more than one task for input queued behind the block: a drift that comes after the next task still fails the press;keeps an on-time deadline waiting while input from before it still comes late. A third case expects the wait.delivers the samples stamped before the deadline first: a drift among them fails the press.runs a deadline that came due during a wait just after it, with no second wait.keeps the one-task yield for a mouse: its late deadline runs after the next task, with no wait;ends the wait when its own timer runs late with nothing queued, with no second wait; andusePager.test.ts'sa mouse that catches a settle stops it and leaves the text selectable. A pen guard,waits for a pen’s late deadline as for a finger’s, passes on both sides.On main 6d00dd5, one worker, at b7e19e3:
test:ui --changed): 348 files, 9,855 passed;pnpm review:pre(0 findings; merges clean).The runs above are at b7e19e3. Commits b411003 and 3503b02 change only comments in
GestureArena.tsand FR16's third sentence. Merge ec2e905 brings main 64806d0; its one conflict is AST-094's verification table, which #11735 re-aligned. At ec2e905, strict eslint, prettier, check:knowledge, the core typecheck, the gesture and Pager units (1,079 passed) andpnpm review:pre(0 findings; merges clean) run again. From #11735,ItemSwipeActions.interaction.browser.spec.tsruns too: Chromium 27 passed, 8 skipped; WebKit 28 passed, 7 skipped. So do the interaction harness's busy units (199 passed).Writing rubric results
Over
spec:AST-094FR16: seven sentences, one rule each; its evidence row names the new cases.Public and internal API delta
None public. Internal: a
GestureArenadeadline waits for input still queued behind a block, as FR16 now says. It waits only while the latest contact is a finger or a pen..github/scripts/lib/component-size.jsmeasures an import.