diff --git a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt index 37844fc..0e309f7 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/feature/chat/ChatScreen.kt @@ -333,15 +333,30 @@ private fun MessageBubble( }, style = MaterialTheme.typography.titleSmall, ) - Text( - text = toolResultText, - style = MaterialTheme.typography.bodyMedium, - maxLines = if (expanded) Int.MAX_VALUE else 12, - overflow = TextOverflow.Ellipsis, - ) - if (shouldCollapseToolResult) { - TextButton(onClick = { expanded = !expanded }) { - Text(if (expanded) "收起" else "展开完整结果") + Column( + modifier = Modifier + .fillMaxWidth() + .clip(androidx.compose.foundation.shape.RoundedCornerShape(12.dp)) + .background( + if (message.status == "tool-error") { + MaterialTheme.colorScheme.error.copy(alpha = 0.08f) + } else { + MaterialTheme.colorScheme.surface.copy(alpha = 0.45f) + } + ) + .padding(12.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + Text( + text = toolResultText, + style = MaterialTheme.typography.bodyMedium, + maxLines = if (expanded) Int.MAX_VALUE else 12, + overflow = TextOverflow.Ellipsis, + ) + if (shouldCollapseToolResult) { + TextButton(onClick = { expanded = !expanded }) { + Text(if (expanded) "收起" else "展开完整结果") + } } } }