From d18b7c8a249e453af4bbc830a6433e1bdf0a675e Mon Sep 17 00:00:00 2001 From: Kohei Date: Wed, 18 Feb 2026 21:58:01 +0900 Subject: [PATCH] fix: prevent tall images from being clipped in chat bubbles Use ContentScale.Fit instead of FillWidth and add heightIn(max=360.dp) constraint so the entire image is always visible. For very tall images (ratio < 0.75), prioritize height constraints to avoid oversized bubbles. Co-Authored-By: Claude Opus 4.6 --- .../android/feature/chat/component/MessageBubble.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/feature/chat/src/main/java/io/picoclaw/android/feature/chat/component/MessageBubble.kt b/android/feature/chat/src/main/java/io/picoclaw/android/feature/chat/component/MessageBubble.kt index c3c02c533..815766349 100644 --- a/android/feature/chat/src/main/java/io/picoclaw/android/feature/chat/component/MessageBubble.kt +++ b/android/feature/chat/src/main/java/io/picoclaw/android/feature/chat/component/MessageBubble.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.shape.RoundedCornerShape @@ -61,8 +62,9 @@ fun MessageBubble( modifier = Modifier .fillMaxWidth() .padding(bottom = 8.dp) - .aspectRatio(ratio), - contentScale = ContentScale.FillWidth + .heightIn(max = 360.dp) + .aspectRatio(ratio, matchHeightConstraintsFirst = ratio < 0.75f), + contentScale = ContentScale.Fit ) } if (message.content.isNotEmpty()) {