Style tool results as readable output blocks

This commit is contained in:
OpenClaw committed 2026-03-07 08:50:16 +08:00
1 parent b89eceef43
commit 7c3815f39a
1 file changed
+15
@@ -333,6 +333,20 @@ private fun MessageBubble(
},
style = MaterialTheme.typography.titleSmall,
)
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,
@@ -345,6 +359,7 @@ private fun MessageBubble(
}
}
}
}
else -> {
Text(text = displayText, style = MaterialTheme.typography.bodyLarge)
}