One-line tool cards in truncated mode
When tool verbosity is 'truncated' (the default) and the card is collapsed, fold the preview into the title row so a tool call takes a single line of vertical space: 'Terminal | ls -lah' with the preview in monospace. Tapping still expands to the full args + output.
This commit is contained in:
1 parent
4e9f1d028a
commit
487fd1c83c
1 file changed
+26
-2
@@ -2868,6 +2868,9 @@ private fun ToolCard(
|
||||
else -> IrisColors.statusRed
|
||||
}
|
||||
val preview = tool.preview ?: tool.note
|
||||
// Truncated + collapsed: fold the preview into the title row so the card
|
||||
// takes a single line of vertical space ("Terminal | ls -lah").
|
||||
val inlinePreview = detail == ToolDetail.TRUNCATED && !expanded && preview != null
|
||||
Column(
|
||||
modifier =
|
||||
Modifier
|
||||
@@ -2892,11 +2895,31 @@ private fun ToolCard(
|
||||
fontSize = 13.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = IrisColors.textBright,
|
||||
modifier = Modifier.clickable { expanded = !expanded },
|
||||
)
|
||||
if (inlinePreview) {
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
Text(
|
||||
"|",
|
||||
fontSize = 12.sp,
|
||||
color = IrisColors.textDim,
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
Text(
|
||||
preview,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontSize = 12.sp,
|
||||
color = IrisColors.textMuted,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier =
|
||||
Modifier
|
||||
.weight(1f)
|
||||
.clickable { expanded = !expanded },
|
||||
)
|
||||
} else {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
}
|
||||
if (tool.duration != null) {
|
||||
Text(
|
||||
"${String.format("%.1f", tool.duration)}s",
|
||||
@@ -2905,8 +2928,9 @@ private fun ToolCard(
|
||||
)
|
||||
}
|
||||
}
|
||||
// One-liner preview (Truncated default / Everything).
|
||||
if (preview != null && detail != ToolDetail.NOTHING) {
|
||||
// One-liner preview (Truncated default / Everything); hidden when it
|
||||
// is already inlined into the title row above.
|
||||
if (preview != null && detail != ToolDetail.NOTHING && !inlinePreview) {
|
||||
Text(
|
||||
preview,
|
||||
fontSize = 12.sp,
|
||||
|
||||
Reference in new issue
Block a user