Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
The exact-head preview is not available yet. Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
The change works as described: a quick flick now dismisses a one-line toast, slow drags behave as before, and the new tests fail on main and pass here. Approval waits on one decision, because no current record settles Toast's swipe thresholds (spec:AST-003 leaves them to the component): should a swipe toward the edge dismiss as a flick at any travel past the 8 px slop, timed by the input events' timestamps, instead of also needing 48 px of travel? Any engineering owner, the author included, records that decision by commenting /approve-spec 6c39f1425a58b4693bf944d170732c5271e00017 on this pull request, or can point to the record that already governs it.
[Automated review]
|
Posted by Cindy's agent on her behalf. Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:
This is about where the behavior lives, not about the PR's intent. |
|
Agreed: one implementation.
|
A release toward the edge dismissed past max(40% of the card's height, 48 px), or as a flick only when it had also travelled 48 px. On any toast up to 120 px tall the two floors are the same distance, so a flick could never dismiss a one-line toast. The flick now needs no travel of its own beyond the slop the swipe already passed. The flick's speed was also timed with Date.now() in the handlers. Browsers deliver touch and pointer moves on the next frame, so the handlers trail the finger by up to two frames (measured in Chromium: a 33 ms flick handled over 55 ms), which halved the speed of a short flick. It is now timed by the input events' own timeStamp.
6c39f14 to
32035ec
Compare
|
Current records now cover the threshold: |
There was a problem hiding this comment.
Approval recommended: a quick flick now dismisses a one-line toast, slow drags behave as before, and the flick's speed is read from the input events' own timestamps. This follows the Toast component record's release rule (FR4, through spec:AST-094 FR36, which sets no travel floor for a flick) and spec:AST-100 FR4, and the new tests fail on main and pass here. The other gaps FR4 lists, the shared tracker's release velocity and cancelling a release that moves back, stay for the follow-up the description names.
[Automated review]
User impact
A quick flick toward a toast's edge snaps back on any toast up to 120 px tall (every one-line toast); only a 48 px drag dismisses it.
Problem and solution fit
Expected behavior and authority
Toast.spec.mdFR4 andspec:AST-094FR36 (current): a release decides on projected travel (travel plus the release velocity times a projection) past the commit point, with no travel floor of its own for a flick.Toast.doc.mjs: toasts "swipe-dismiss toward their configured top or bottom edge";spec:AST-003FR16 (a toast swipe dismisses only the toast) is kept.Smallest restoration
timeStamp.Evidence
Mobile Safari, iOS 26.2 simulator; each path has a named test (ring drawn by the test page).
main): a 46 px flick (about 20 ms) on a 56 px toast snaps back (real time, then ¼ speed)Chromium phone emulation, CDP touch, 56 px toast: 46 px / 33 ms and 30 px / 23 ms flicks snapped back and now dismiss; slow 40 px and 60 px drags are unchanged.
Regression tests: pen and touch flicks on a one-line toast fail on
main; a late-handled 30 ms flick fails with only the floor change.Rebased onto
main, which carries #8050, as one commit.Scope
Testing
Local gates at 32035ec:
pnpm test:ui(16 workers): 16,458 pass (654 files), with no unhandled error; the node project (16 workers): 14,560 pass, its only reds twocache.test.mjscases (see fix(cli): a crashed run's release install is recognized by the Node it ran on, whatever its name #8520).pnpm build,pnpm typecheck,CI=true pnpm lint(0 errors) andpnpm check:knowledge: clean. A merge-tree withmain(6700c24) is clean.architecture:component-style-authoringINV6, the CI's measurement): Toast's import JS 63,022 → 63,036 B gzip againstmain(9ee7457); CSS unchanged (10,143 B).main(3): the pen and touch flicks on a one-line toast and the flick timed by its input events.