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
@@ -46,6 +46,30 @@ final class MessageReplySwipeTests: XCTestCase {
|
||||
))
|
||||
}
|
||||
|
||||
func testDiagonalScrollAtOldThresholdDoesNotReply() {
|
||||
// width/height ≈ 1.5 passed the old 1.4 dominance and moved bubbles
|
||||
// during scrolling; the stricter policy must stay silent.
|
||||
XCTAssertFalse(MessageReplySwipePolicy.shouldReply(
|
||||
translation: CGSize(width: 60, height: 40),
|
||||
predictedEndTranslation: CGSize(width: 60, height: 40)
|
||||
))
|
||||
XCTAssertEqual(
|
||||
MessageReplySwipePolicy.offset(for: CGSize(width: 60, height: 40)),
|
||||
0
|
||||
)
|
||||
}
|
||||
|
||||
func testIndicatorStaysHiddenUntilActivationDistance() {
|
||||
XCTAssertEqual(
|
||||
MessageReplySwipePolicy.offset(for: CGSize(width: 20, height: 0)),
|
||||
0
|
||||
)
|
||||
XCTAssertGreaterThan(
|
||||
MessageReplySwipePolicy.offset(for: CGSize(width: 24, height: 0)),
|
||||
0
|
||||
)
|
||||
}
|
||||
|
||||
func testVisualOffsetIsCapped() {
|
||||
XCTAssertEqual(
|
||||
MessageReplySwipePolicy.offset(for: CGSize(width: 500, height: 0)),
|
||||
|
||||
Reference in new issue
Block a user