diff --git a/android/app/src/main/java/rs/rhema/phone/ui/ChatScreen.kt b/android/app/src/main/java/rs/rhema/phone/ui/ChatScreen.kt index f476584..50ab185 100644 --- a/android/app/src/main/java/rs/rhema/phone/ui/ChatScreen.kt +++ b/android/app/src/main/java/rs/rhema/phone/ui/ChatScreen.kt @@ -65,6 +65,8 @@ import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.drawBehind +import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.asImageBitmap import androidx.compose.ui.layout.ContentScale @@ -497,6 +499,7 @@ private fun TurnGroupRow( stringResource(R.string.chat_user_dispatch) } val avatar = if (you) userFace.image else null + val accent = TogetherAccent when (group) { is TurnGroup.User -> Row( @@ -557,7 +560,6 @@ private fun TurnGroupRow( is TurnGroup.Agent -> Row( modifier = Modifier .fillMaxWidth() - .height(IntrinsicSize.Min) .background( TogetherSurface, RoundedCornerShape( @@ -566,12 +568,19 @@ private fun TurnGroupRow( bottomEnd = 10.dp, bottomStart = 0.dp, ), - ), + ) + // The accent bar is drawn, not a child measured against + // the row's intrinsic height: a markdown table renders + // through a SubcomposeLayout (its wide variant scrolls), + // and asking that for intrinsics throws on the main + // thread. The bar spans whatever height the content takes. + .drawBehind { + drawRect(accent, size = Size(2.dp.toPx(), size.height)) + }, ) { - AccentBar(TogetherAccent, width = 2.dp) Column( modifier = Modifier - .padding(12.dp) + .padding(start = 14.dp, top = 12.dp, end = 12.dp, bottom = 12.dp) .weight(1f), verticalArrangement = Arrangement.spacedBy(8.dp), ) {