Reduce chat status noise

This commit is contained in:
OpenClaw committed 2026-03-07 21:16:28 +08:00
1 parent 02196c0f6e
commit c6b982b2b7
2 files changed
+16 -18

No files matched your search

@@ -92,7 +92,9 @@ fun ChatScreen(
modifier = modifier.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
) {
ChatStatusBanner(topStatus = topStatus)
if (topStatus.visible) {
ChatStatusBanner(topStatus = topStatus)
}
if (visibleMessages.isEmpty() && !isLoading) {
EmptyStateCard(
@@ -180,6 +182,7 @@ fun ChatScreen(
private data class ChatTopStatus(
val text: String,
val tone: StatusPillTone,
val visible: Boolean = true,
)
private fun buildChatTopStatus(
@@ -197,48 +200,49 @@ private fun buildChatTopStatus(
)
pendingQueueStatus != null -> ChatTopStatus(
text = pendingQueueStatus,
text = "正在处理待发消息",
tone = StatusPillTone.Warning,
)
cacheNotice != null -> ChatTopStatus(
text = cacheNotice,
text = "当前显示本地缓存",
tone = StatusPillTone.Warning,
)
isSending -> ChatTopStatus(
text = "正在等待实时回复…",
text = "正在等待回复",
tone = StatusPillTone.Info,
)
isLoading -> ChatTopStatus(
text = "正在同步消息…",
text = "正在同步消息",
tone = StatusPillTone.Info,
)
streamStatus == "recovering" -> ChatTopStatus(
text = "上游恢复中,消息会继续同步。",
text = "连接恢复中",
tone = StatusPillTone.Warning,
)
streamStatus == "reconnecting" -> ChatTopStatus(
text = "正在重连实时流。",
text = "正在重连",
tone = StatusPillTone.Warning,
)
streamStatus == "failed" -> ChatTopStatus(
text = "实时流已断开,请重试连接。",
text = "实时流已断开",
tone = StatusPillTone.Error,
)
streamStatus == "connecting" -> ChatTopStatus(
text = "正在连接实时流。",
text = "正在连接",
tone = StatusPillTone.Info,
)
else -> ChatTopStatus(
text = "在线,可继续浏览和发送消息。",
text = "在线",
tone = StatusPillTone.Success,
visible = false,
)
}
}
@@ -546,13 +550,6 @@ private fun MessageBubble(
style = if (isSystemNotice) MaterialTheme.typography.bodyMedium else MaterialTheme.typography.bodyLarge,
color = if (isSystemNotice) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onSurface,
)
if (message.role == MessageRole.User && displayStatus == null) {
Text(
text = "已发送",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
if (message.retryable && localPhase == LocalMessagePhase.Failed && message.status == "send-failed") {
TextButton(onClick = { onRetryMessage(message.id) }) {
Text("重试")
@@ -571,7 +568,7 @@ private fun MessageBubble(
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.weight(1f),
)
if (displayStatus != null && !isSystemNotice) {
if (displayStatus != null && !isSystemNotice && displayStatus != "已完成") {
StatusPill(text = displayStatus, tone = statusTone)
}
}