From 710b60bc6e30a7ff51cced3874a323a37af7ed68 Mon Sep 17 00:00:00 2001 From: M57 <41645758+Hy4ri@users.noreply.github.com> Date: Wed, 1 Jul 2026 23:56:20 +0300 Subject: [PATCH] feat: show copy button on tap instead of long-hold (#449) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes message bubbles (user + assistant) so the copy button appears on a single tap rather than requiring a long-hold gesture. - UserBubble: combinedClickable → clickable with showCopyButton - AssistantBubble: combinedClickable → clickable with showCopyButton - Removed unused combinedClickable import + ExperimentalFoundationApi opt-in Co-authored-by: M57 --- .../com/m57/hermescontrol/ui/chat/ChatBubble.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatBubble.kt b/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatBubble.kt index 014a1030..7f4766ff 100644 --- a/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatBubble.kt +++ b/app/src/main/java/com/m57/hermescontrol/ui/chat/ChatBubble.kt @@ -12,10 +12,8 @@ import androidx.compose.animation.fadeOut import androidx.compose.animation.scaleIn import androidx.compose.animation.scaleOut import androidx.compose.foundation.BorderStroke -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.clickable -import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -149,7 +147,6 @@ fun ChatBubble( } } -@OptIn(ExperimentalFoundationApi::class) @Composable private fun UserBubble( message: ChatMessage, @@ -224,10 +221,9 @@ private fun UserBubble( ), ).background(brush = gradientBrush) .testTag("chat_bubble_user") - .combinedClickable( + .clickable( role = Role.Button, - onClick = {}, - onLongClick = { + onClick = { showCopyButton = true }, ), @@ -304,7 +300,6 @@ private fun UserBubble( } } -@OptIn(ExperimentalFoundationApi::class) @Composable private fun AssistantBubble( message: ChatMessage, @@ -362,10 +357,9 @@ private fun AssistantBubble( bottomEnd = 16.dp, ), ).testTag("chat_bubble_assistant") - .combinedClickable( + .clickable( role = Role.Button, - onClick = {}, - onLongClick = { + onClick = { showCopyButton = true }, ),