Reduce chat status noise
This commit is contained in:
1 parent
02196c0f6e
commit
c6b982b2b7
2 files changed
+15
-17
No files matched your search
+14
-17
@@ -92,7 +92,9 @@ fun ChatScreen(
|
|||||||
modifier = modifier.padding(16.dp),
|
modifier = modifier.padding(16.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
) {
|
) {
|
||||||
|
if (topStatus.visible) {
|
||||||
ChatStatusBanner(topStatus = topStatus)
|
ChatStatusBanner(topStatus = topStatus)
|
||||||
|
}
|
||||||
|
|
||||||
if (visibleMessages.isEmpty() && !isLoading) {
|
if (visibleMessages.isEmpty() && !isLoading) {
|
||||||
EmptyStateCard(
|
EmptyStateCard(
|
||||||
@@ -180,6 +182,7 @@ fun ChatScreen(
|
|||||||
private data class ChatTopStatus(
|
private data class ChatTopStatus(
|
||||||
val text: String,
|
val text: String,
|
||||||
val tone: StatusPillTone,
|
val tone: StatusPillTone,
|
||||||
|
val visible: Boolean = true,
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun buildChatTopStatus(
|
private fun buildChatTopStatus(
|
||||||
@@ -197,48 +200,49 @@ private fun buildChatTopStatus(
|
|||||||
)
|
)
|
||||||
|
|
||||||
pendingQueueStatus != null -> ChatTopStatus(
|
pendingQueueStatus != null -> ChatTopStatus(
|
||||||
text = pendingQueueStatus,
|
text = "正在处理待发消息",
|
||||||
tone = StatusPillTone.Warning,
|
tone = StatusPillTone.Warning,
|
||||||
)
|
)
|
||||||
|
|
||||||
cacheNotice != null -> ChatTopStatus(
|
cacheNotice != null -> ChatTopStatus(
|
||||||
text = cacheNotice,
|
text = "当前显示本地缓存",
|
||||||
tone = StatusPillTone.Warning,
|
tone = StatusPillTone.Warning,
|
||||||
)
|
)
|
||||||
|
|
||||||
isSending -> ChatTopStatus(
|
isSending -> ChatTopStatus(
|
||||||
text = "正在等待实时回复…",
|
text = "正在等待回复",
|
||||||
tone = StatusPillTone.Info,
|
tone = StatusPillTone.Info,
|
||||||
)
|
)
|
||||||
|
|
||||||
isLoading -> ChatTopStatus(
|
isLoading -> ChatTopStatus(
|
||||||
text = "正在同步消息…",
|
text = "正在同步消息",
|
||||||
tone = StatusPillTone.Info,
|
tone = StatusPillTone.Info,
|
||||||
)
|
)
|
||||||
|
|
||||||
streamStatus == "recovering" -> ChatTopStatus(
|
streamStatus == "recovering" -> ChatTopStatus(
|
||||||
text = "上游恢复中,消息会继续同步。",
|
text = "连接恢复中",
|
||||||
tone = StatusPillTone.Warning,
|
tone = StatusPillTone.Warning,
|
||||||
)
|
)
|
||||||
|
|
||||||
streamStatus == "reconnecting" -> ChatTopStatus(
|
streamStatus == "reconnecting" -> ChatTopStatus(
|
||||||
text = "正在重连实时流。",
|
text = "正在重连",
|
||||||
tone = StatusPillTone.Warning,
|
tone = StatusPillTone.Warning,
|
||||||
)
|
)
|
||||||
|
|
||||||
streamStatus == "failed" -> ChatTopStatus(
|
streamStatus == "failed" -> ChatTopStatus(
|
||||||
text = "实时流已断开,请重试连接。",
|
text = "实时流已断开",
|
||||||
tone = StatusPillTone.Error,
|
tone = StatusPillTone.Error,
|
||||||
)
|
)
|
||||||
|
|
||||||
streamStatus == "connecting" -> ChatTopStatus(
|
streamStatus == "connecting" -> ChatTopStatus(
|
||||||
text = "正在连接实时流。",
|
text = "正在连接",
|
||||||
tone = StatusPillTone.Info,
|
tone = StatusPillTone.Info,
|
||||||
)
|
)
|
||||||
|
|
||||||
else -> ChatTopStatus(
|
else -> ChatTopStatus(
|
||||||
text = "在线,可继续浏览和发送消息。",
|
text = "在线",
|
||||||
tone = StatusPillTone.Success,
|
tone = StatusPillTone.Success,
|
||||||
|
visible = false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -546,13 +550,6 @@ private fun MessageBubble(
|
|||||||
style = if (isSystemNotice) MaterialTheme.typography.bodyMedium else MaterialTheme.typography.bodyLarge,
|
style = if (isSystemNotice) MaterialTheme.typography.bodyMedium else MaterialTheme.typography.bodyLarge,
|
||||||
color = if (isSystemNotice) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onSurface,
|
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") {
|
if (message.retryable && localPhase == LocalMessagePhase.Failed && message.status == "send-failed") {
|
||||||
TextButton(onClick = { onRetryMessage(message.id) }) {
|
TextButton(onClick = { onRetryMessage(message.id) }) {
|
||||||
Text("重试")
|
Text("重试")
|
||||||
@@ -571,7 +568,7 @@ private fun MessageBubble(
|
|||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
)
|
)
|
||||||
if (displayStatus != null && !isSystemNotice) {
|
if (displayStatus != null && !isSystemNotice && displayStatus != "已完成") {
|
||||||
StatusPill(text = displayStatus, tone = statusTone)
|
StatusPill(text = displayStatus, tone = statusTone)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -450,3 +450,4 @@ Android/iOS App
|
|||||||
- 2026-03-07:补一轮列表摘要降级策略:远端 session 列表不再回查摘要后,客户端刷新会优先沿用本地已有摘要;如果当前确实拿不到摘要,UI 直接留白而不是整屏显示“暂无摘要”,避免性能优化后的列表观感像异常状态。
|
- 2026-03-07:补一轮列表摘要降级策略:远端 session 列表不再回查摘要后,客户端刷新会优先沿用本地已有摘要;如果当前确实拿不到摘要,UI 直接留白而不是整屏显示“暂无摘要”,避免性能优化后的列表观感像异常状态。
|
||||||
- 2026-03-07:按最新交互反馈继续收聊天页壳层:非会话页移除 TopAppBar,只在会话详情保留顶部导航;会话页顶栏返回/附件/刷新改成更明确的按钮,标题字号再收小;输入栏去掉“继续当前会话”说明并压缩整体高度,减少底部控件占屏。
|
- 2026-03-07:按最新交互反馈继续收聊天页壳层:非会话页移除 TopAppBar,只在会话详情保留顶部导航;会话页顶栏返回/附件/刷新改成更明确的按钮,标题字号再收小;输入栏去掉“继续当前会话”说明并压缩整体高度,减少底部控件占屏。
|
||||||
- 2026-03-07:信息架构继续做减法:底部导航先从三栏收成两栏(会话 / 设置),把原状态页的核心诊断信息并进设置页的“诊断信息”分组,避免低频诊断页长期占一个一级入口。
|
- 2026-03-07:信息架构继续做减法:底部导航先从三栏收成两栏(会话 / 设置),把原状态页的核心诊断信息并进设置页的“诊断信息”分组,避免低频诊断页长期占一个一级入口。
|
||||||
|
- 2026-03-07:继续给聊天页降噪:正常在线时顶部状态条不再常驻,只在同步 / 发送 / 恢复 / 断流等需要用户感知时才显示;状态文案改成更短的移动端提示,同时去掉用户消息“已发送”和附件“已完成”这类长期占位但信息价值不高的状态露出。
|
||||||
Reference in new issue
Block a user