From c6b982b2b75de0dc38a52a4da1f5cf449bc2ba6e Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sat, 7 Mar 2026 21:16:28 +0800 Subject: [PATCH] Reduce chat status noise --- .../openclawapp/feature/chat/ChatScreen.kt | 33 +++++++++---------- docs/MVP_PROGRESS.md | 1 + 2 files changed, 16 insertions(+), 18 deletions(-) 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 518c7f5..659eeaf 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 @@ -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) } } diff --git a/docs/MVP_PROGRESS.md b/docs/MVP_PROGRESS.md index 7502b3a..6d8054d 100644 --- a/docs/MVP_PROGRESS.md +++ b/docs/MVP_PROGRESS.md @@ -450,3 +450,4 @@ Android/iOS App - 2026-03-07:补一轮列表摘要降级策略:远端 session 列表不再回查摘要后,客户端刷新会优先沿用本地已有摘要;如果当前确实拿不到摘要,UI 直接留白而不是整屏显示“暂无摘要”,避免性能优化后的列表观感像异常状态。 - 2026-03-07:按最新交互反馈继续收聊天页壳层:非会话页移除 TopAppBar,只在会话详情保留顶部导航;会话页顶栏返回/附件/刷新改成更明确的按钮,标题字号再收小;输入栏去掉“继续当前会话”说明并压缩整体高度,减少底部控件占屏。 - 2026-03-07:信息架构继续做减法:底部导航先从三栏收成两栏(会话 / 设置),把原状态页的核心诊断信息并进设置页的“诊断信息”分组,避免低频诊断页长期占一个一级入口。 +- 2026-03-07:继续给聊天页降噪:正常在线时顶部状态条不再常驻,只在同步 / 发送 / 恢复 / 断流等需要用户感知时才显示;状态文案改成更短的移动端提示,同时去掉用户消息“已发送”和附件“已完成”这类长期占位但信息价值不高的状态露出。