From bc572cc2ea740281b23a2c22a9109cf0fdebbccf Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 2 Aug 2026 20:28:04 +0200 Subject: [PATCH] fix(ui): make media bubble shell long-clickable Self and grouped voice-note bubbles had no long-press target: the sender label is hidden and VoiceNotePlayer controls consume touches, so the message action sheet was unreachable. combinedClickable on the shell restores long-press for every media bubble. --- .../bitchat/android/ui/media/MediaBubbleShell.kt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/bitchat/android/ui/media/MediaBubbleShell.kt b/app/src/main/java/com/bitchat/android/ui/media/MediaBubbleShell.kt index b18c97a4..bc69dec3 100644 --- a/app/src/main/java/com/bitchat/android/ui/media/MediaBubbleShell.kt +++ b/app/src/main/java/com/bitchat/android/ui/media/MediaBubbleShell.kt @@ -1,7 +1,9 @@ package com.bitchat.android.ui.media +import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.border +import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -39,8 +41,11 @@ import java.text.SimpleDateFormat * mirroring the text-bubble treatment: the author's identity colour washes the fill and * hairline, the speaker-side corner tightens into a tail, the sender's name heads the first * bubble of a run, and the timestamp (plus delivery ticks for own private messages) rides - * flush-right beneath the media. + * flush-right beneath the media. The shell itself is long-clickable so media bubbles always + * open the message action sheet even when no sender label is shown and the media consumes + * touches (voice-note player controls). */ +@OptIn(ExperimentalFoundationApi::class) @Composable fun MediaBubbleShell( message: BitchatMessage, @@ -84,6 +89,14 @@ fun MediaBubbleShell( color = authorColor.copy(alpha = ChatVisualTokens.BubbleBackgroundAlpha), shape = bubbleShape ) + .combinedClickable( + enabled = onLongPress != null, + onClick = {}, + onLongClick = { + haptic.performHapticFeedback(HapticFeedbackType.LongPress) + onLongPress?.invoke() + }, + ) .padding( horizontal = ChatVisualTokens.BubblePaddingHorizontal, vertical = ChatVisualTokens.BubblePaddingVertical,