Skip to content

Commit 856ee1e

Browse files
committed
Followups: only short text is hoverable and clickable
1 parent d105495 commit 856ee1e

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

cli/src/components/tools/suggest-followups.tsx

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ const FollowupLine = ({
4242
const { terminalWidth } = useTerminalDimensions()
4343

4444
const handleClick = useCallback(() => {
45-
if (disabled) return
46-
onSendFollowup(followup.prompt, index)
45+
if (!disabled) {
46+
onSendFollowup(followup.prompt, index)
47+
}
4748
}, [followup.prompt, index, onSendFollowup, disabled])
4849

4950
const handleMouseOver = useCallback(() => onHover(index), [onHover, index])
@@ -83,24 +84,25 @@ const FollowupLine = ({
8384
? theme.primary
8485
: theme.foreground
8586

87+
// Calculate padding spaces needed to align descriptions (only when showing description)
88+
const labelLength = (displayText ?? '').length
89+
const paddingSpaces = showDescription
90+
? ' '.repeat(Math.max(0, labelColumnWidth - 2 - labelLength)) // -2 for "→ " prefix
91+
: ''
92+
8693
return (
87-
<Button
88-
onClick={handleClick}
89-
onMouseOver={handleMouseOver}
90-
onMouseOut={handleMouseOut}
91-
style={{
92-
flexDirection: 'column',
93-
backgroundColor: showHoverState ? theme.surface : undefined,
94-
}}
95-
>
96-
{/* Row layout: fixed-width label column + flexible description */}
94+
<box style={{ flexDirection: 'column' }}>
95+
{/* Row layout: clickable label + non-clickable description */}
9796
<box style={{ flexDirection: 'row', width: '100%' }}>
98-
{/* Fixed-width label column */}
99-
<box
97+
{/* Clickable label area - only the text itself is clickable */}
98+
<Button
99+
onClick={handleClick}
100+
onMouseOver={handleMouseOver}
101+
onMouseOut={handleMouseOut}
100102
style={{
101-
width: hasLabel ? labelColumnWidth : undefined,
102-
flexShrink: hasLabel ? 0 : 1,
103-
flexGrow: hasLabel ? 0 : 1,
103+
flexShrink: 0,
104+
flexGrow: 0,
105+
backgroundColor: showHoverState ? theme.surface : undefined,
104106
}}
105107
>
106108
<text style={{ wrapMode: hasLabel ? 'none' : 'word' }}>
@@ -113,19 +115,19 @@ const FollowupLine = ({
113115
{displayText}
114116
</span>
115117
</text>
116-
</box>
117-
{/* Flexible description column - truncated with ellipsis */}
118+
</Button>
119+
{/* Flexible description column - NOT clickable, with padding for alignment */}
118120
{showDescription && hasLabel && (
119121
<box style={{ flexGrow: 1 }}>
120122
<text style={{ wrapMode: 'none' }}>
121-
<span fg={theme.foreground} attributes={TextAttributes.ITALIC}>
122-
{truncatedPrompt}
123+
<span fg={theme.muted} attributes={TextAttributes.ITALIC}>
124+
{paddingSpaces}{truncatedPrompt}
123125
</span>
124126
</text>
125127
</box>
126128
)}
127129
</box>
128-
</Button>
130+
</box>
129131
)
130132
}
131133

0 commit comments

Comments
 (0)