Repository navigation
Commit 33dbb83
committed
feat(Toast): the swipe follows iOS notification banners
Toast's touch swipe now reads the notification banner's measured values
(iOS 26.2 simulator, 60 fps recordings of HID-driven drags) from a new
Toast domain of the UIKit table, motion/uikit/toast.ts:
- the pan begins at UIKit's hysteresis, but the card stays still for the
first 14 px of finger travel and then follows at 0.55 of the finger, so
it never jumps;
- a release dismisses when the card is 15.7 px out or the finger was
moving toward the edge at 105 px/s (UIKit's estimator keeps a stopped
finger's last speed); anything else springs back on the smooth system
spring (0.5 s, critically damped) on the compositor, handed the card's
release velocity, kept under Reduce Motion as the banner keeps it;
- a dismissed card plays the ordinary exit from where the finger left it
(its row stops clipping it), never moving back toward rest;
- no fade or scale while dragging, and touches pass through while the
card springs back, as the banner never catches a settling card.
The four private --_toast-swipe-* variables are gone. toastSwipe.ts holds
the math, unit-tested against every recorded banner release; a real-touch
interaction spec covers the follow, the settle curve, the dismiss paths,
the pass-through, the settle through a blocked main thread and no Layout
or Paint while dragging or settling.1 parent d1b2046 commit 33dbb83
15 files changed
Lines changed: 1326 additions & 818 deletions
File tree
- .changeset
- apps/storybook/stories
- packages/core/src
- Toast
- __tests__
- motion
- uikit
- theme
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 105 | | |
130 | 106 | | |
131 | 107 | | |
132 | 108 | | |
133 | 109 | | |
134 | | - | |
| 110 | + | |
135 | 111 | | |
136 | 112 | | |
137 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| |||
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
| 192 | + | |
185 | 193 | | |
186 | 194 | | |
187 | 195 | | |
| |||
262 | 270 | | |
263 | 271 | | |
264 | 272 | | |
265 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
266 | 279 | | |
267 | 280 | | |
268 | 281 | | |
269 | 282 | | |
270 | 283 | | |
271 | 284 | | |
272 | 285 | | |
| 286 | + | |
273 | 287 | | |
274 | 288 | | |
275 | 289 | | |
| |||
294 | 308 | | |
295 | 309 | | |
296 | 310 | | |
297 | | - | |
298 | 311 | | |
299 | 312 | | |
300 | 313 | | |
| |||
0 commit comments