From 92b1ad2b388dcf057682ece4b2d3eaa349bef53b Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 6 Aug 2026 13:47:52 -0400 Subject: [PATCH] fix(chat): allow swipe-to-dismiss on the conversation sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chat message list is a reverseLayout=true LazyColumn but had sheetResignmentBehavior applied — a guard built for top-anchored lists and the only reversed-list usage in the app. That guard treats firstVisibleItemIndex==0 && offset==0 as the sheet's downward dismiss boundary. In a reversed list that position is the resting state (newest message), not a scroll edge, so the guard forced the sheet's allowDismiss flag to false at rest. Swiping down let the reversed list consume the drag as a history scroll, flipping the guard into onScrolledAway() which permanently disabled dismiss and cancelled the re-enable timer. allowDismiss gates confirmDetentChange for the whole sheet, so it snapped back instead of dismissing — even for header/handle drags. Remove the modifier from the chat list: a downward drag on messages already scrolls history via nested scroll, and dismiss comes from the header/handle drag, scrim tap, and back. --- .../messenger/internal/screens/components/MessageList.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/MessageList.kt b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/MessageList.kt index a924ec89ae..db02e531da 100644 --- a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/MessageList.kt +++ b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/MessageList.kt @@ -47,7 +47,6 @@ import com.flipcash.shared.chat.models.SeparatorConfig import com.flipcash.shared.chat.ui.bubblePositionOf import com.getcode.theme.CodeTheme import com.getcode.ui.utils.rememberKeyboardController -import com.getcode.ui.utils.sheetResignmentBehavior import com.getcode.util.vibration.LocalVibrator import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.distinctUntilChanged @@ -122,8 +121,14 @@ internal fun MessageList( } LazyColumn( + // NB: no sheetResignmentBehavior here. That guard is built for top-anchored lists, + // where index0/offset0 is the scroll edge that abuts the sheet's downward dismiss drag. + // This list is reverseLayout=true, so index0/offset0 is the *resting* position (newest), + // and a downward drag there scrolls into history rather than overscrolling. Applying the + // guard would flip the sheet's allowDismiss to false at rest and never cleanly re-enable + // it, so the sheet snaps back instead of dismissing. Dismiss here comes from the + // header/handle drag, scrim tap, and back — all gated by that same allowDismiss flag. modifier = modifier - .sheetResignmentBehavior(listState) .pointerInput(Unit) { detectTapGestures { keyboard.hide() } },