diff --git a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/App.kt b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/App.kt index 15de964..5763414 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/App.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/App.kt @@ -188,7 +188,6 @@ private fun OpenClawRoot(appState: OpenClawAppState) { when { activeSession != null -> ChatScreen( modifier = Modifier.fillMaxSize(), - sessionTitle = activeSession.title, messages = appState.repository.messagesFor(activeSession.id), isSending = appState.sendingSessionId == activeSession.id, isLoading = appState.isSyncing, 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 e38e7f8..bfd0ba8 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 @@ -46,7 +46,6 @@ import kotlinx.coroutines.delay @Composable fun ChatScreen( modifier: Modifier = Modifier, - sessionTitle: String, messages: List, isSending: Boolean, isLoading: Boolean, @@ -89,7 +88,6 @@ fun ChatScreen( verticalArrangement = Arrangement.spacedBy(12.dp), ) { ChatHeader( - sessionTitle = sessionTitle, topStatus = topStatus, onBack = onBack, onRetry = onRetry, @@ -267,7 +265,6 @@ private fun buildChatTopStatus( @Composable private fun ChatHeader( - sessionTitle: String, topStatus: ChatTopStatus, onBack: () -> Unit, onRetry: () -> Unit, @@ -279,17 +276,10 @@ private fun ChatHeader( ) { Row( modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.spacedBy(12.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically, ) { - Button(onClick = onBack) { Text("返回") } - Text( - text = sessionTitle, - modifier = Modifier.weight(1f), - style = MaterialTheme.typography.titleMedium, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) + TextButton(onClick = onBack) { Text("返回") } TextButton(onClick = onRetry) { Text(topStatus.actionLabel) } @@ -380,7 +370,12 @@ private fun MessageBubble( val bubbleColor = when { isSystemNotice -> MaterialTheme.colorScheme.surfaceContainerHigh message.role == MessageRole.User -> MaterialTheme.colorScheme.primaryContainer - else -> MaterialTheme.colorScheme.surfaceContainerLow + isToolResult && message.status == "tool-error" -> MaterialTheme.colorScheme.errorContainer.copy(alpha = 0.36f) + isToolResult -> MaterialTheme.colorScheme.surfaceContainer + isTool -> MaterialTheme.colorScheme.surfaceContainerLow + isAttachment && message.status == "upload-failed" -> MaterialTheme.colorScheme.errorContainer.copy(alpha = 0.24f) + isAttachment -> MaterialTheme.colorScheme.surfaceContainerLow + else -> MaterialTheme.colorScheme.surface } var visibleChars by remember(message.id) { mutableIntStateOf(if (animateText) 0 else message.text.length) } var expanded by remember(message.id) { mutableStateOf(false) } @@ -431,7 +426,7 @@ private fun MessageBubble( verticalArrangement = Arrangement.spacedBy(6.dp), horizontalAlignment = if (isSystemNotice) Alignment.CenterHorizontally else if (message.role == MessageRole.User) Alignment.End else Alignment.Start, ) { - if (!isSystemNotice) { + if (!isSystemNotice && message.role != MessageRole.User) { Text( text = label, style = MaterialTheme.typography.labelMedium, @@ -463,6 +458,7 @@ private fun MessageBubble( ) { when { isThinking -> { + StatusPill(text = "思考中", tone = StatusPillTone.Warning) Row( horizontalArrangement = Arrangement.spacedBy(10.dp), verticalAlignment = Alignment.CenterVertically, @@ -595,6 +591,13 @@ 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("重试") diff --git a/docs/MVP_PROGRESS.md b/docs/MVP_PROGRESS.md index c464570..aee3c36 100644 --- a/docs/MVP_PROGRESS.md +++ b/docs/MVP_PROGRESS.md @@ -433,3 +433,5 @@ Android/iOS App - 2026-03-07:会话列表做了一轮信息减法:去掉重复摘要,默认不再在主列表暴露 session id,更新时间从高亮 pill 降为普通辅助文本;最近访问卡和置顶操作也改轻,优先突出“标题 + 摘要 + 关键状态”。 - 2026-03-07:开始统一状态视觉语义:`StatusPill` 新增 neutral/info/success/warning/error tone,列表流状态、聊天顶部状态、消息气泡状态都开始按“在线 / 处理中 / 失败 / 普通标签”区分,减少此前一套高亮样式混用时间、状态、标签造成的噪音。 - 2026-03-07:聊天页消息前台状态文案先收敛到用户视角:把 queue-draining / retrying-auto / uploading / send-failed 等内部细状态,前台统一归并到“处理中 / 需重试 / 已完成”这一层,细分恢复机制不再在时间线里处处抢注意力。 +- 2026-03-07:继续收聊天时间线的“聊天产品感”:聊天页内部去掉重复会话标题,顶部动作区进一步压轻;消息气泡开始按“用户主色 / 助手中性 / 工具与附件中性容器 + 标签”分层,减少此前不同类型整块上色过多导致的彩虹感。 +- 2026-03-07:继续统一消息卡片层级:用户消息不再重复显示角色标签,普通已发用户消息会补轻量“已发送”提示;thinking / tool / tool result / attachment 开始统一走标签 + 内容区的结构,而不是每种类型都靠大面积底色来强调。