Skip to content

Commit 61dc026

Browse files
committed
fix(ui/message): increase thresholds for swipe-to-reply
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 533cfaf commit 61dc026

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • ui/components/src/main/kotlin/com/getcode/ui/components/chat

ui/components/src/main/kotlin/com/getcode/ui/components/chat/MessageNode.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fun MessageNode(
219219

220220
BoxWithConstraints(modifier = Modifier.fillMaxWidth()) {
221221
val maxWidth = maxWidth
222-
val swipeThreshold = with(density) { maxWidth.toPx() } * 0.30f
222+
val swipeThreshold = with(density) { maxWidth.toPx() } * 0.20f
223223
var hasTriggeredTick by remember { mutableStateOf(false) }
224224
var hasFiredReply by remember { mutableStateOf(false) }
225225

@@ -234,8 +234,8 @@ fun MessageNode(
234234
AnchoredDraggableState(
235235
initialValue = MessageNodeDragAnchors.DEFAULT,
236236
anchors = anchors,
237-
positionalThreshold = { swipeThreshold },
238-
velocityThreshold = { with(density) { 50.dp.toPx() } },
237+
positionalThreshold = { it * 0.3f },
238+
velocityThreshold = { with(density) { 200.dp.toPx() } },
239239
confirmValueChange = { targetValue ->
240240
if (targetValue == MessageNodeDragAnchors.REPLY && !hasFiredReply) {
241241
hasFiredReply = true

0 commit comments

Comments
 (0)