tame the reply swipe so vertical scrolling stays clean
- Raise the swipe dominance threshold to 2.0 and add a 24pt activation distance so diagonal timeline scrolls never move bubbles or fire haptics, and snap the indicator back when a gesture turns vertical mid-drag. - Cover the stricter thresholds in MessageReplySwipeTests.
This commit is contained in:
1 parent
1a26651daa
commit
0ef77f7f6a
7 files changed
+61
-25
No files matched your search
@@ -177,9 +177,16 @@ struct MessageBubble: View {
|
||||
DragGesture(minimumDistance: 20)
|
||||
.onChanged { value in
|
||||
let offset = MessageReplySwipePolicy.offset(for: value.translation)
|
||||
guard offset != 0 || replySwipeOffset != 0 else {
|
||||
// A vertical timeline pan must not publish per-cell state
|
||||
// changes or compete with UIScrollView's own recognizer.
|
||||
guard offset != 0 else {
|
||||
// Vertical (or not clearly horizontal) movement: snap the
|
||||
// indicator back and never publish per-cell state changes
|
||||
// during an ordinary timeline scroll.
|
||||
if replySwipeOffset != 0 || replySwipeArmed {
|
||||
withAnimation(.spring(response: 0.24, dampingFraction: 0.82)) {
|
||||
replySwipeOffset = 0
|
||||
}
|
||||
replySwipeArmed = false
|
||||
}
|
||||
return
|
||||
}
|
||||
replySwipeOffset = offset
|
||||
|
||||
Reference in new issue
Block a user