Refine transient chat message styling

This commit is contained in:
OpenClaw committed 2026-03-07 21:42:48 +08:00
1 parent cb357d9692
commit f015717962
2 files changed
+7 -7

No files matched your search

@@ -326,9 +326,9 @@ private fun MessageBubble(
val isAttachment = message.kind == MessageKind.Attachment
val isSystemNotice = message.role == MessageRole.System && !isToolResult && !isTool && !isAttachment
val bubbleColor = when {
isSystemNotice -> MaterialTheme.colorScheme.surfaceContainerHigh
isSystemNotice -> MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.6f)
message.role == MessageRole.User -> MaterialTheme.colorScheme.primaryContainer
isToolResult && message.status == "tool-error" -> MaterialTheme.colorScheme.errorContainer.copy(alpha = 0.36f)
isToolResult && message.status == "tool-error" -> MaterialTheme.colorScheme.errorContainer.copy(alpha = 0.5f)
isToolResult -> MaterialTheme.colorScheme.surfaceContainer
isTool -> MaterialTheme.colorScheme.surfaceContainerLow
isAttachment && message.status == "upload-failed" -> MaterialTheme.colorScheme.errorContainer.copy(alpha = 0.24f)
@@ -393,7 +393,7 @@ private fun MessageBubble(
}
Column(
modifier = Modifier
.clip(androidx.compose.foundation.shape.RoundedCornerShape(if (isSystemNotice) 14.dp else 18.dp))
.clip(androidx.compose.foundation.shape.RoundedCornerShape(if (isSystemNotice) 12.dp else 18.dp))
.border(
width = when {
isSystemNotice -> 0.dp
@@ -411,12 +411,11 @@ private fun MessageBubble(
shape = androidx.compose.foundation.shape.RoundedCornerShape(if (isSystemNotice) 14.dp else 18.dp),
)
.background(bubbleColor)
.padding(if (isSystemNotice) 10.dp else 14.dp),
.padding(if (isSystemNotice) 8.dp else 14.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
when {
isThinking -> {
StatusPill(text = "思考中", tone = StatusPillTone.Warning)
Row(
horizontalArrangement = Arrangement.spacedBy(10.dp),
verticalAlignment = Alignment.CenterVertically,
@@ -428,7 +427,7 @@ private fun MessageBubble(
)
Text(
text = if (message.text.isBlank()) "正在思考…" else message.text,
style = MaterialTheme.typography.bodyMedium,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
@@ -511,7 +510,7 @@ private fun MessageBubble(
}
isToolResult -> {
StatusPill(
text = if (message.status == "tool-error") "工具错误" else "工具结果",
text = if (message.status == "tool-error") "执行失败" else "工具结果",
tone = if (message.status == "tool-error") StatusPillTone.Error else StatusPillTone.Neutral,
)
if (!linkedToolName.isNullOrBlank()) {
+1
View File
@@ -456,3 +456,4 @@ Android/iOS App
- 2026-03-07:继续优化附件卡片操作区:失败态仍保留前置主按钮“重新发送附件”,其余常用动作从一排横向按钮改成两行等宽次级操作(打开 / 下载 / 复制文件名 / 查看详情),避免窄屏下一排动作挤爆、主次不分。
- 2026-03-07:继续收会话列表层级:最近访问卡降级成更轻的普通卡片,入口文案从“继续”改成“打开”;列表项把更新时间提到标题行右侧,底部只保留必要状态,置顶操作从文字按钮降成星标符号按钮,减少每项底部操作重量。
- 2026-03-07:继续压缩会话页头部:SectionHeader 标题字号和行距再收一档,统计文案改成更短的辅助信息;列表整体纵向间距减小,搜索框去掉表单式 label,改成更轻的 placeholder 搜索,减少头部在首屏占用的垂直空间。
- 2026-03-07:继续细化聊天时间线层级:system notice 改成更轻的窄条样式,thinking 去掉大 pill 改为更轻的 loading 行,tool error 文案收成“执行失败”并统一到更明显的错误容器语义,让过渡态 / 系统态 / 错误态和正式聊天消息的层级更清楚。