Skip to content

Commit aaaf0df

Browse files
authored
Add scroll-to-first-unread pill to the message view (#6409)
* Surface unreadLabel on MessageListState Adds an UnreadLabel field on MessageListState so UI layers can react to the sticky unread-boundary signal without depending on the live unreadCount, which collapses to 0 once the SDK auto-marks the latest message as read on chat open. The new field mirrors MessageListController.unreadLabelState via a collector. Declares UnreadLabel as a typealias in the state package (state/messages/list/UnreadLabel.kt) pointing at MessageListController's nested data class, so MessageListState references the type from its own package without reaching into feature/messages/list. Both names resolve to the same JVM class — existing consumers of MessageListController.UnreadLabel keep compiling. * Expose disableUnreadLabelButton on Compose MessageListViewModel Lets the UI dismiss the floating unread-label button (e.g. from a close affordance on the scroll-to-first-unread pill) without affecting the inline unread separator. * Add ScrollToFirstUnreadButton ChatComponentFactory slot Introduces the floating pill primitive used to jump to the first unread message when the unread boundary sits outside the viewport. The pill exposes two distinct interactions: tapping the label area scrolls to the boundary, while tapping the trailing close icon dismisses the pill without scrolling. Adds the ScrollToFirstUnreadButtonParams holder, the ChatComponentFactory slot, the default composable, and the supporting string resources. The slot is unwired in this commit; the wiring lands in the follow-up. * Wire scroll-to-first-unread pill into the message view Renders the floating pill inside DefaultMessagesHelperContent using the sticky unread label exposed on MessageListState. Visibility derives from unreadLabel.buttonVisibility plus whether the inline unread separator is in the visible viewport, so the pill stays correct even after the SDK auto-marks the latest visible message as read on chat open. Tap on the pill body invokes MessageListViewModel.scrollToFirstUnreadMessage (loading the boundary if needed); tap on the close affordance invokes MessageListViewModel.disableUnreadLabelButton. Both actions are exposed as trailing defaulted callbacks on the public MessageList overloads so that state-only consumers can opt in. The visibility derivedState observes only lazyListState.layoutInfo (a State) and re-keys on unreadSeparatorIndex; buttonVisibility is read on each recomposition from the parameter so it never relies on a stale capture. * Make unread-label button dismissal sticky against read-state changes disableUnreadLabelButton() flipped buttonVisibility on the current label, but observeUnreadLabelState recomputes the label whenever lastReadMessageId changes and the calculator restored buttonVisibility=true. After scrollToFirstUnreadMessage, the auto-mark-read on the now-visible boundary triggered exactly that recomputation and the pill returned. Also tryEmit(false) on showUnreadButtonState so the suppression flows through the calculator on subsequent recomputes. The suppression is per-controller, so it resets when the user leaves and re-enters the channel — matching the Figma spec. A regression test in MessageListControllerTests locks the new contract: after disableUnreadLabelButton, pushing a new lastReadMessageId on channelState.read must not flip buttonVisibility back to true. * Tidy ScrollToFirstUnreadButton: tokenise stroke, simplify modifiers Cleanup-only follow-up to the pill UI: - Replace the hardcoded 1.dp stroke with StreamTokens.borderStrokeSubtle so the border respects the design-system token. - Pass role=Role.Button directly to clickable instead of layering a separate semantics modifier; the role lands on the same semantics node either way. - Split each four-edge padding into a vertical+horizontal pair for symmetry with the rest of the codebase's padding patterns. No behaviour or API change. * Document unreadLabelState contract and Compose-friendly alternative Expands the KDoc on MessageListController.unreadLabelState to describe its stickiness, the dismissal contract, and to point Compose-style consumers at MessageListState.unreadLabel (the aggregated mirror) so granular subscribers and UI consumers each pick the better entry point. * Add role to internal Modifier.clickable; reuse in pill The internal Modifier.clickable helper centralises the SDK's clickable surface (explicit Material 3 ripple, optional bounded clipping). The pill was side-stepping it by calling foundation's clickable directly, drifting from the codebase convention. Add a defaulted role parameter to the helper so the pill can ride the shared ripple while still announcing Role.Button. Two pre-existing trailing-lambda call sites (MediaGalleryPage, MediaGalleryPhotosMenu) import both the foundation and internal clickables; the new role parameter makes the simplified ".clickable { … }" form ambiguous between the two. Disambiguate by passing bounded = true (foundation has no bounded), which preserves the existing ripple-bearing behaviour. * Add vertical separator between label and close icon in pill Mirrors the Figma "Message View — Opened With Unread Messages" mock, which shows a thin vertical rule between the unread count and the dismiss affordance. Reuses the same border token already applied to the pill outline so the inner rule and the outline read as a single design. * Test: ScrollToFirstUnreadButton snapshot Three Paparazzi snapshots covering the unread-count surface area: 1, 9, and 999. Each renders both light and dark variants via snapshotWithDarkMode so the divider, border, and ripple-bearing label area are all visible against the themed background. * Fix pill preview height and re-target the click testTag Two related fixes on the pill composable: - Bound the inner Row to Modifier.height(IntrinsicSize.Min). VerticalDivider uses fillMaxHeight() internally, which was unbounded inside the Surface preview and stretched the pill across the rendered surface. With IntrinsicSize.Min, the divider's height resolves to the tallest non-flexible child (the label row or the close icon). - Move the Stream_ScrollToFirstUnreadButton testTag from the Surface to the inner clickable Row. The Surface is not interactive, so a UI test that finds the node by tag and performs a click would land on a non-clickable node. With the tag on the click target, finding by tag and clicking now invokes the scroll handler, mirroring the dismiss tag on the X icon. * Address PR review: visibility key, null-label guard, test strictness - Messages.kt: switch the pill's separator-visibility check to compare LazyListItemInfo.key against the separator item's id, instead of comparing the message-list index against the LazyList index. The two diverge when non-message items (footerContent, the load-more indicator) precede itemsIndexed in the column, which would mis-judge pill visibility. - MessageListController.disableUnreadLabelButton: early-return when there is no active unread label. The previous code emitted false on showUnreadButtonState even on a no-op call (e.g. scrollToFirstUnreadMessage with a null unreadLabelState, or the XML SDK's HideUnreadLabel event with no active label), permanently latching the suppression for the controller's lifetime and hiding any future unread pill. - MessageListControllerTests: strengthen the post-read assertion to fail when unreadLabelState becomes null. The previous safe-call chain silently passed when the chain returned null, masking the regression the test is meant to guard. * Test: cover scroll-to-first-unread VM action and wired pill snapshot Two coverage additions for the new unread-pill surface: - MessageListViewModelTest gains a case for disableUnreadLabelButton on a fixture with no active unread label, asserting state stays untouched. This exercises the VM's delegating method and the controller's early-return guard end-to-end. - MessageListTest gains a snapshot variant rendering MessageList with an active UnreadLabel and an inline UnreadSeparatorItemState. The snapshot exercises the wired pill through the public state-only MessageList, Messages.DefaultMessagesHelperContent, and the ChatComponentFactory.ScrollToFirstUnreadButton slot in inspection mode. * Move unread separator off-screen in pill snapshot fixture The fixture put the separator at index 0 of messageItems, which with reverseLayout = true sits at the bottom of the viewport. The pill hides itself while the separator is visible, so the snapshot did not exercise the pill. Place the separator at the end of the list so it stays above the visible area.
1 parent a7f2297 commit aaaf0df

21 files changed

Lines changed: 518 additions & 15 deletions

File tree

stream-chat-android-compose/api/stream-chat-android-compose.api

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,12 @@ public final class io/getstream/chat/android/compose/ui/components/messages/Comp
15161516
public final fun getLambda$-388063089$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
15171517
}
15181518

1519+
public final class io/getstream/chat/android/compose/ui/components/messages/ComposableSingletons$ScrollToFirstUnreadButtonKt {
1520+
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/messages/ComposableSingletons$ScrollToFirstUnreadButtonKt;
1521+
public fun <init> ()V
1522+
public final fun getLambda$-1405339857$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
1523+
}
1524+
15191525
public final class io/getstream/chat/android/compose/ui/components/messages/ComposableSingletons$SwipeToReplyIconKt {
15201526
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/messages/ComposableSingletons$SwipeToReplyIconKt;
15211527
public fun <init> ()V
@@ -2091,7 +2097,7 @@ public final class io/getstream/chat/android/compose/ui/messages/list/Composable
20912097
public final class io/getstream/chat/android/compose/ui/messages/list/ComposableSingletons$MessagesKt {
20922098
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/messages/list/ComposableSingletons$MessagesKt;
20932099
public fun <init> ()V
2094-
public final fun getLambda$1954099387$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
2100+
public final fun getLambda$203042131$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
20952101
}
20962102

20972103
public final class io/getstream/chat/android/compose/ui/messages/list/MessageContainerKt {
@@ -2107,8 +2113,8 @@ public final class io/getstream/chat/android/compose/ui/messages/list/MessageIte
21072113
}
21082114

21092115
public final class io/getstream/chat/android/compose/ui/messages/list/MessageListKt {
2110-
public static final fun MessageList (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Vertical;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;III)V
2111-
public static final fun MessageList (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;III)V
2116+
public static final fun MessageList (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Vertical;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;III)V
2117+
public static final fun MessageList (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/foundation/layout/Arrangement$Vertical;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;III)V
21122118
}
21132119

21142120
public final class io/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState {
@@ -3456,6 +3462,7 @@ public abstract interface class io/getstream/chat/android/compose/ui/theme/ChatC
34563462
public fun ReactionsMenu (Lio/getstream/chat/android/compose/ui/theme/ReactionsMenuParams;Landroidx/compose/runtime/Composer;I)V
34573463
public fun ReactionsMenuContent (Lio/getstream/chat/android/compose/ui/theme/ReactionsMenuContentParams;Landroidx/compose/runtime/Composer;I)V
34583464
public fun ScrollToBottomButton (Lio/getstream/chat/android/compose/ui/theme/ScrollToBottomButtonParams;Landroidx/compose/runtime/Composer;I)V
3465+
public fun ScrollToFirstUnreadButton (Lio/getstream/chat/android/compose/ui/theme/ScrollToFirstUnreadButtonParams;Landroidx/compose/runtime/Composer;I)V
34593466
public fun SearchInputClearButton (Lio/getstream/chat/android/compose/ui/theme/SearchInputClearButtonParams;Landroidx/compose/runtime/Composer;I)V
34603467
public fun SearchInputLabel (Lio/getstream/chat/android/compose/ui/theme/SearchInputLabelParams;Landroidx/compose/runtime/Composer;I)V
34613468
public fun SearchInputLeadingIcon (Landroidx/compose/foundation/layout/RowScope;Lio/getstream/chat/android/compose/ui/theme/SearchInputLeadingIconParams;Landroidx/compose/runtime/Composer;I)V
@@ -3645,6 +3652,7 @@ public final class io/getstream/chat/android/compose/ui/theme/ChatComponentFacto
36453652
public static fun ReactionsMenu (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ReactionsMenuParams;Landroidx/compose/runtime/Composer;I)V
36463653
public static fun ReactionsMenuContent (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ReactionsMenuContentParams;Landroidx/compose/runtime/Composer;I)V
36473654
public static fun ScrollToBottomButton (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ScrollToBottomButtonParams;Landroidx/compose/runtime/Composer;I)V
3655+
public static fun ScrollToFirstUnreadButton (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/ScrollToFirstUnreadButtonParams;Landroidx/compose/runtime/Composer;I)V
36483656
public static fun SearchInputClearButton (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/SearchInputClearButtonParams;Landroidx/compose/runtime/Composer;I)V
36493657
public static fun SearchInputLabel (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Lio/getstream/chat/android/compose/ui/theme/SearchInputLabelParams;Landroidx/compose/runtime/Composer;I)V
36503658
public static fun SearchInputLeadingIcon (Lio/getstream/chat/android/compose/ui/theme/ChatComponentFactory;Landroidx/compose/foundation/layout/RowScope;Lio/getstream/chat/android/compose/ui/theme/SearchInputLeadingIconParams;Landroidx/compose/runtime/Composer;I)V
@@ -5155,18 +5163,23 @@ public final class io/getstream/chat/android/compose/ui/theme/MessageListEmptyTh
51555163

51565164
public final class io/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams {
51575165
public static final field $stable I
5158-
public fun <init> (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;)V
5166+
public fun <init> (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)V
5167+
public synthetic fun <init> (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
51595168
public final fun component1 ()Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;
51605169
public final fun component2 ()Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;
51615170
public final fun component3 ()Landroidx/compose/foundation/layout/PaddingValues;
51625171
public final fun component4 ()Lkotlin/jvm/functions/Function1;
5163-
public final fun copy (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;)Lio/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams;
5164-
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams;Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams;
5172+
public final fun component5 ()Lkotlin/jvm/functions/Function0;
5173+
public final fun component6 ()Lkotlin/jvm/functions/Function0;
5174+
public final fun copy (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Lio/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams;
5175+
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams;Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Landroidx/compose/foundation/layout/PaddingValues;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/MessageListHelperContentParams;
51655176
public fun equals (Ljava/lang/Object;)Z
51665177
public final fun getContentPadding ()Landroidx/compose/foundation/layout/PaddingValues;
51675178
public final fun getMessageListState ()Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;
51685179
public final fun getMessagesLazyListState ()Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;
5180+
public final fun getOnDismissUnreadLabel ()Lkotlin/jvm/functions/Function0;
51695181
public final fun getOnScrollToBottomClick ()Lkotlin/jvm/functions/Function1;
5182+
public final fun getOnScrollToFirstUnreadClick ()Lkotlin/jvm/functions/Function0;
51705183
public fun hashCode ()I
51715184
public fun toString ()Ljava/lang/String;
51725185
}
@@ -5683,6 +5696,27 @@ public final class io/getstream/chat/android/compose/ui/theme/ScrollToBottomButt
56835696
public fun toString ()Ljava/lang/String;
56845697
}
56855698

5699+
public final class io/getstream/chat/android/compose/ui/theme/ScrollToFirstUnreadButtonParams {
5700+
public static final field $stable I
5701+
public fun <init> (ZILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;)V
5702+
public synthetic fun <init> (ZILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
5703+
public final fun component1 ()Z
5704+
public final fun component2 ()I
5705+
public final fun component3 ()Lkotlin/jvm/functions/Function0;
5706+
public final fun component4 ()Lkotlin/jvm/functions/Function0;
5707+
public final fun component5 ()Landroidx/compose/ui/Modifier;
5708+
public final fun copy (ZILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;)Lio/getstream/chat/android/compose/ui/theme/ScrollToFirstUnreadButtonParams;
5709+
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/theme/ScrollToFirstUnreadButtonParams;ZILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/theme/ScrollToFirstUnreadButtonParams;
5710+
public fun equals (Ljava/lang/Object;)Z
5711+
public final fun getModifier ()Landroidx/compose/ui/Modifier;
5712+
public final fun getOnClick ()Lkotlin/jvm/functions/Function0;
5713+
public final fun getOnDismiss ()Lkotlin/jvm/functions/Function0;
5714+
public final fun getUnreadCount ()I
5715+
public final fun getVisible ()Z
5716+
public fun hashCode ()I
5717+
public fun toString ()Ljava/lang/String;
5718+
}
5719+
56865720
public final class io/getstream/chat/android/compose/ui/theme/SearchInputClearButtonParams {
56875721
public static final field $stable I
56885722
public fun <init> (Lkotlin/jvm/functions/Function0;)V
@@ -6776,6 +6810,7 @@ public final class io/getstream/chat/android/compose/viewmodel/messages/MessageL
67766810
public final fun deleteMessage (Lio/getstream/chat/android/models/Message;)V
67776811
public final fun deleteMessage (Lio/getstream/chat/android/models/Message;Z)V
67786812
public static synthetic fun deleteMessage$default (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Lio/getstream/chat/android/models/Message;ZILjava/lang/Object;)V
6813+
public final fun disableUnreadLabelButton ()V
67796814
public final fun dismissAllMessageActions ()V
67806815
public final fun dismissMessageAction (Lio/getstream/chat/android/ui/common/state/messages/MessageAction;)V
67816816
public final fun displayPollMoreOptions (Lio/getstream/chat/android/ui/common/state/messages/poll/SelectedPoll;)V

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/preview/internal/MediaGalleryPage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ internal fun MediaGalleryVideoPage(
340340
MediaThumbnail(
341341
modifier = Modifier
342342
.matchParentSize()
343-
.clickable {
343+
.clickable(bounded = true) {
344344
showThumbnail = false
345345
player.play()
346346
},

stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/attachments/preview/internal/MediaGalleryPhotosMenu.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private fun MediaGalleryPhotosMenuItem(
188188
modifier = Modifier
189189
.fillMaxWidth()
190190
.aspectRatio(1f)
191-
.clickable { onClick() },
191+
.clickable(bounded = true) { onClick() },
192192
contentAlignment = Alignment.Center,
193193
) {
194194
val data = attachment.imagePreviewData

0 commit comments

Comments
 (0)