Commit 80bccc8
fix(tui): remove spurious blank line from assistant messages
Commit 574a466 introduced the copy-on-hover button for assistant
messages using the same "topRow+\n" pattern as user messages. However,
UserMessageStyle has PaddingTop=1 (inherited from BaseMessageStyle) so
PaddingTop(0)+topRow+"\n" is net-zero. AssistantMessageStyle overrides
to Padding(0,1), meaning PaddingTop=0 already; PaddingTop(0) is a
no-op and the unconditional "\n" prefix adds a spurious blank line to
every assistant message in its normal (non-hovered) state.
Fix: only use the topRow+"\n" rendering path when the copy icon is
actually visible (hovered or selected). Fall back to the original
messageStyle.Render(rendered) for the common case. This accepts a
1-line layout shift on hover rather than a permanent blank-line
artifact on every message.
Fixes: #2368
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 131e93d commit 80bccc8
1 file changed
+11
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | 158 | | |
156 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
157 | 162 | | |
158 | | - | |
159 | | - | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
0 commit comments