Tighten session list hierarchy

This commit is contained in:
OpenClaw committed 2026-03-07 21:34:23 +08:00
1 parent 3b01b1c240
commit c0d395eed2
2 files changed
+24 -24

No files matched your search

@@ -110,7 +110,7 @@ fun SessionListScreen(
Card(
modifier = Modifier.fillMaxWidth(),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.tertiaryContainer.copy(alpha = 0.45f),
containerColor = MaterialTheme.colorScheme.surfaceContainerLow,
),
) {
Row(
@@ -121,8 +121,8 @@ fun SessionListScreen(
verticalAlignment = Alignment.CenterVertically,
) {
Column(modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(4.dp)) {
Text("最近访问", style = MaterialTheme.typography.labelLarge)
Text(recentSession.title, style = MaterialTheme.typography.titleMedium, maxLines = 1)
Text("最近访问", style = MaterialTheme.typography.labelMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Text(recentSession.title, style = MaterialTheme.typography.titleSmall, maxLines = 1)
recentSession.lastMessage.takeIf { it.isNotBlank() }?.let { summary ->
Text(
summary,
@@ -134,7 +134,7 @@ fun SessionListScreen(
}
}
TextButton(onClick = { onOpenSession(recentSession.id) }) {
Text("继续")
Text("打开")
}
}
}
@@ -206,18 +206,11 @@ private fun SessionRow(
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
if (session.isPinned) {
StatusPill(text = "置顶", tone = StatusPillTone.Neutral)
}
if (session.unreadCount > 0) {
StatusPill(text = "${session.unreadCount} 未读", tone = StatusPillTone.Info)
}
session.streamStatus?.let { streamStatus ->
val (label, tone) = streamStatusLabelAndTone(streamStatus)
if (label != null) {
StatusPill(text = label, tone = tone)
}
}
Text(
text = session.updatedAt,
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
session.lastMessage.takeIf { it.isNotBlank() }?.let { summary ->
@@ -232,17 +225,23 @@ private fun SessionRow(
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(12.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = session.updatedAt,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.weight(1f),
)
if (session.isPinned) {
StatusPill(text = "置顶", tone = StatusPillTone.Neutral)
}
if (session.unreadCount > 0) {
StatusPill(text = "${session.unreadCount}", tone = StatusPillTone.Info)
}
session.streamStatus?.let { streamStatus ->
val (label, tone) = streamStatusLabelAndTone(streamStatus)
if (label != null) {
StatusPill(text = label, tone = tone)
}
}
TextButton(onClick = onTogglePin) {
Text(if (session.isPinned) "取消置顶" else "置顶")
Text(if (session.isPinned) "★" else "☆")
}
}
}