Repository navigation
fix(core): a BottomSheet touch release takes UIKit's sheet values, and turning back cancels - #10234
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| BottomSheet | 59.4 kB (+825 B) · 7.5 kB CSS (0) | — | ✓ · ✓ · — |
| PowerSearch | 271.8 kB (+815 B) · 23.1 kB CSS (0) | — | — · — · — |
| TimeInput | 150.5 kB (+813 B) · 15.5 kB CSS (0) | — | — · — · — |
22 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DateTimeInput | 195.9 kB (+811 B) · 18.1 kB CSS (0) | — | — · — · — |
| DateInput | 173.5 kB (+782 B) · 16.4 kB CSS (0) | — | — · — · — |
| DropdownMenu | 86.1 kB (+1 B) · 16.7 kB CSS (0) | — | — · — · — |
| MoreMenu | 86.3 kB (+1 B) · 16.7 kB CSS (0) | — | — · — · — |
| Popover | 78.5 kB (+1 B) · 13.4 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 137.6 kB (+1 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 301.4 kB (+1 B) · 2.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 244.1 kB (+1 B) · 454 B CSS (0) | — | — · — · — |
| BottomSheetSwitcher | 17.5 kB (0) · 3.4 kB CSS (0) | — | ✓ · ✓ · — |
| ContextMenu | 90.5 kB (0) · 16.6 kB CSS (0) | — | — · — · — |
| Markdown | 162.2 kB (0) · 19.5 kB CSS (0) | — | — · — · — |
| MultiSelector | 88.7 kB (0) · 16.3 kB CSS (0) | — | — · — · — |
| Pagination | 103.3 kB (0) · 17.3 kB CSS (0) | — | — · — · — |
| Selector | 93.2 kB (0) · 16.9 kB CSS (0) | — | — · — · — |
| Table | 100.0 kB (0) · 17.3 kB CSS (0) | — | — · — · — |
| TableCell | 91.7 kB (0) · 17.0 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 91.3 kB (0) · 16.8 kB CSS (0) | — | — · — · — |
| Tokenizer | 84.8 kB (0) · 18.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 96.5 kB (0) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 97.6 kB (0) · 1.1 kB CSS (0) | — | — · — · — |
| lab/Comments | 306.5 kB (0) · 2.5 kB CSS (0) | — | — · — · — |
| lab/TourStep | 84.7 kB (0) · 590 B CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 6.79 MB packed (+3.4 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 19 rows, core 24 rows; run pnpm api:report.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 821f7cd |
There was a problem hiding this comment.
#8105 — approve. A sheet that a touch drag closes now leaves at the finger's speed, and its scrim fades on the same clock, as the approved BottomSheet FR19 and spec:AST-094 FR38 require. No blocking findings.
#10234 — approve. A touch release now follows the approved FR19 and spec:AST-094 FR36 values: a short fast flick at the lowest detent closes the sheet, and a moderate throw from the top stops at the next detent. No blocking findings; two optional comment trims are inline.
Whole stack — passes. A pull request lands only when it and every pull request below it are approved, so #10234 lands after #8105.
Approved pending CI: CI has not run on this head yet because the pull request is a draft.
[Automated review]
| // A touch release takes UIKit's sheet values, with closed counted as | ||
| // one position. A flick lands on the first position at or past its | ||
| // projection. A release that moves back toward where the drag began | ||
| // cancels to that detent. |
There was a problem hiding this comment.
Non-blocking (INV29 comment style): the last two sentences restate what flickPastProjection: true and start: baseOffset already say. Suggest keeping only the reason:
// UIKit's sheet counts closed as one more position.| // The first snap point at or past the projection in the flick's | ||
| // direction, or the last one there when the projection passes them all. |
There was a problem hiding this comment.
Non-blocking (INV29 comment style): this narrates the loop below it, and the file header already states the rule ("a flick lands on the first snap point at or past its projection"). Suggest deleting it.
821f7cd to
48de3c5
Compare
|
/approve-spec 48de3c5 |
There was a problem hiding this comment.
#8105 — approve. A sheet that a touch drag closes now leaves at the finger's speed, and its scrim fades on the same clock, as the approved BottomSheet FR19 and spec:AST-094 FR38 require. The title, description and FR19's mouse and pen gap now match the change. No blocking findings.
#10234 — approve. A touch release now follows the approved FR19 and spec:AST-094 FR36 values: a short fast flick at the lowest detent closes the sheet, and a moderate throw from the top stops at the next detent. No blocking findings; the two optional comment trims from the earlier review still apply.
Whole stack — passes. A pull request lands only when it and every pull request below it are approved, so #10234 lands after #8105.
Approved pending CI: the required checks were still running on this head when this review finished.
[Automated review]
…d turning back cancels A touch drag's release takes UIKit's measured sheet values. It is projected 0.1 s ahead (measured), with closed counted as one position, and a release slower than 250 px/s is not projected (measured). A release at 1,008 px/s or faster is a flick, as UIKit's sheet counts one. It lands on the first position at or past its projection, and at least on the next one. So a short fast flick at the lowest detent closes the sheet instead of springing back. From a higher detent, a flick that 0.1 s of its speed carries past the next detent goes on: a hard flick closes the sheet, and a softer one stops at the next detent (AST-094 FR36). A faster touch release never travels less than a slower one. A touch release moving back toward where the drag began cancels to that detent (AST-094 FR37). The touch release calls the shared release policy, resolveSnapPoint, whose new flickPastProjection option lands a flick at or past its projection. A slow or medium touch throw now travels less than it did, and a slow touch drag closes the sheet only past halfway from the lowest detent to closed. A mouse or pen drag keeps its release: the scroll projection and the dismiss line, with no flick. The BottomSheet record's FR19 adds these touch values to the release rule, with the mouse and pen differences as implementation gaps, and its verification rows merge. AST-094 FR36's BottomSheet sentence names the touch values. DEC-4 and its compatibility note say so.
48de3c5 to
47383e1
Compare
|
/approve-spec 47383e1 |
There was a problem hiding this comment.
Approve. The BottomSheet touch-release rule (FR19's measured values, DEC-4 and the new spec:AST-094 FR36 sentence) has an engineering owner's /approve-spec for this head, the touch cancel meets FR37, and CI passed on this head. The new release tests fail before the change and pass after, and in Chromium a short fast flick at the lowest detent now closes the sheet while a moderate throw from the top snap point stops at half. No blocking findings.
Optional:
- Miss: FR19 and the new FR36 sentence say any touch release from 1,008 px/s is a flick, but the code (like DEC-4) also needs more than 8 px of travel, so adding that to FR19 keeps the record exact.
- Miss: the cancel unit case also passes before the change; a case such as a slow drag to 390 px followed by 10 px back at 100 px/s fails before and passes after.
- The two comment trims from the earlier inline comments still apply.
[Automated review]
Stack: #8105 → #10234
User impact
On a phone, a short fast flick sprang a BottomSheet back, and a moderate throw from its top snap point closed it.
Problem and solution fit
spec:AST-094FR37). Any other is projected 0.1 s ahead (UIKit's value), closed counting as a position, except under 250 px/s.resolveSnapPoint's newflickPastProjection). So a hard flick from the top closes; a softer one stops at the next detent.Expected behavior and authority
component:BottomSheetFR19's touch values, DEC-4 and its compatibility note;spec:AST-094FR36's BottomSheet sentence and FR37. Owner-gated.Smallest restoration
The touch release on
resolveSnapPointand three measuredsheetvalues. No public API.Evidence
resolveSnapPoint'sflickPastProjection), and a 1,200 px/s flick from tall closes the sheet instead of landing on half (Chromium). The release spec imports the newsheettable, so it cannot load on the arm.Scope
Writing rubric results
R1–R6 pass for FR19's touch values and its verification row, DEC-4, the compatibility note and AST-094 FR36's sentence.
Testing
Rebuilt on
main010db3f, which has #8105 and the Popover group: this pull request's own diff, unchanged apart frommotion/uikit/index.ts's header list, which now names bothpopoverandsheet. Local (Linux), at that head: coretsc; units for BottomSheet, motion, hooks and Popover (2,605);check:motion-roles(36 roles);check:knowledge; ESLint on the changed files (0 errors); Prettier; the Changeset coverage check;pnpm review:pre(0 findings). BottomSheet's a11y specs in Chromium 81 of 81 and in WebKit 54 passed, 2 skipped; its interaction specs in Chromium 16 of 16 and in WebKit 7 passed, 9 skipped. Card 83's paths measure as at the stamped 8bcccb5 product, within 0.1 ms: flicks at 1,200 and 1,500 px/s from tall land on half; 4,000 and 10,000 px/s flicks close in 728.6 and 707.3 ms; a 3,000 px/s close plays 534.7, 710.1 and 1055.9 ms at tempo 0.75, 1 and 1.5, each fade ending with its close.