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 0e309f7..87c2257 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 @@ -250,6 +250,7 @@ private fun MessageBubble( } val displayText = message.text.take(visibleChars) + val isStructuredOutput = isToolResult && looksStructuredOutput(displayText) val shouldCollapseToolResult = isToolResult && displayText.length > 240 val toolResultText = if (shouldCollapseToolResult && !expanded) displayText.take(240).trimEnd() + "…" else displayText val displayStatus = when { @@ -349,7 +350,11 @@ private fun MessageBubble( ) { Text( text = toolResultText, - style = MaterialTheme.typography.bodyMedium, + style = if (isStructuredOutput) { + MaterialTheme.typography.bodySmall + } else { + MaterialTheme.typography.bodyMedium + }, maxLines = if (expanded) Int.MAX_VALUE else 12, overflow = TextOverflow.Ellipsis, )