Skip to content

Commit 84a1ccc

Browse files
FL4TLiN3claude
andauthored
fix: prevent delegation tree line wrapping with flex truncation (#694)
Use Box flexGrow/flexShrink layout so the activity portion (actionLabel + fileArg) truncates with ellipsis instead of wrapping to a second line when the terminal is too narrow. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ae715fe commit 84a1ccc

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@perstack/tui-components": patch
3+
---
4+
5+
fix: prevent delegation tree line wrapping by truncating long activity text

packages/tui-components/src/execution/components/delegation-tree.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Text } from "ink"
1+
import { Box, Text } from "ink"
22
import type React from "react"
33
import { colors } from "../../colors.js"
44
import { USAGE_INDICATORS } from "../../constants.js"
@@ -56,16 +56,22 @@ function TreeNodeLine({
5656
const showUsage = node.status !== "completed"
5757

5858
return (
59-
<Text>
60-
<Text dimColor>{prefix}</Text>
61-
{indicator}
62-
<Text> </Text>
63-
<Text bold>{node.expertName}</Text>
64-
<Text dimColor>: </Text>
65-
<Text>{node.actionLabel}</Text>
66-
{node.actionFileArg ? <Text color={colors.muted}> {node.actionFileArg}</Text> : null}
59+
<Box>
60+
<Text>
61+
<Text dimColor>{prefix}</Text>
62+
{indicator}
63+
<Text> </Text>
64+
<Text bold>{node.expertName}</Text>
65+
<Text dimColor>: </Text>
66+
</Text>
67+
<Box flexGrow={1} flexShrink={1}>
68+
<Text wrap="truncate">
69+
{node.actionLabel}
70+
{node.actionFileArg ? <Text color={colors.muted}> {node.actionFileArg}</Text> : null}
71+
</Text>
72+
</Box>
6773
{showUsage ? (
68-
<>
74+
<Text>
6975
{node.model ? (
7076
<>
7177
<Text dimColor> · </Text>
@@ -76,9 +82,9 @@ function TreeNodeLine({
7682
<Text>
7783
{usageIcon} {usagePercent}%
7884
</Text>
79-
</>
85+
</Text>
8086
) : null}
81-
</Text>
87+
</Box>
8288
)
8389
}
8490

0 commit comments

Comments
 (0)