Skip to content

fix(chat): allow swipe-to-dismiss on the conversation sheet - #1187

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/chat-sheet-swipe-dismiss
Aug 6, 2026
Merged

fix(chat): allow swipe-to-dismiss on the conversation sheet#1187
bmc08gt merged 1 commit into
code/cashfrom
fix/chat-sheet-swipe-dismiss

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

Swiping down on a chat sheet starts to move it but snaps back before reaching the dismiss threshold — the sheet can't be dismissed by drag.

Root cause

The chat message list (MessageList.kt) is a reverseLayout = true LazyColumn (newest at the bottom, index 0 = bottom), but it had .sheetResignmentBehavior(listState) applied. That modifier is built for top-anchored lists — and this was the only reversed-list usage among the 9 in the app.

The guard decides "am I at the sheet's downward dismiss boundary?" via firstVisibleItemIndex == 0 && firstVisibleItemScrollOffset == 0. For a normal list that's the top scroll edge. For the reversed chat list, index0/offset0 is the resting position (newest message), not a scroll edge:

  1. At rest the guard forces the sheet's allowDismiss flag to false (it gates confirmDetentChange for the whole sheet).
  2. Swiping down lets the reversed list consume the drag as a history scrollfirstVisibleItemScrollOffset changes → the modifier flips into onScrolledAway(), which disables gestures with no auto-reset and cancels the 700 ms re-enable timer.
  3. allowDismiss stays false, so the sheet can't settle to Hidden and snaps back — even for header/handle drags.

Fix

Remove .sheetResignmentBehavior(listState) (and its now-unused import) from the chat list. Its model — "only allow dismiss at the list's scroll edge" — doesn't fit a chat: a downward drag on messages already scrolls history via nested scroll, and dismiss is meant to come from the header/handle drag, scrim tap, and back.

Testing

  • :apps:flipcash:features:messenger:compileDebugKotlin passes.
  • Manual: open a chat, swipe the sheet down — it now reaches the threshold and dismisses.

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.
@bmc08gt bmc08gt self-assigned this Aug 6, 2026
@bmc08gt
bmc08gt merged commit 8694f87 into code/cash Aug 6, 2026
@bmc08gt
bmc08gt deleted the fix/chat-sheet-swipe-dismiss branch August 6, 2026 17:52
@github-actions github-actions Bot added the type: fix Bug fix label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant