detached e52a560

fix(tui): compact empty tool call bodies

Tool calls with no result content now render just the header without a bottom rule, eliminating blank spacing for no-output or queued tool calls.
commit
e52a560c6a8b407a0990be800832fbdb25a14cc4
author
patriceckhart · · 2026-04-26 10:34 UTC
parent
0194ca6
signature
unsigned
refs
tag: v0.1.20
1 file · +12 -7
M internal/tui/view.go +12 -7
@@ -534,16 +534,21 @@ func (v *View) renderToolCall(tc ToolCallView, width int) []string {
534534 // Finished tool call: frame the whole block with opening +
535535 // closing rules so it stands apart from surrounding assistant
536536 // prose. Matches the transcript-side framing in renderMessage.
537+ // When the result is empty, show just the header without rules
538+ // to avoid blank spacing for no-output tool calls.
539+ if tc.Result == "" {
540+ lines = append(lines, toolBlockRule(v.Theme, width))
541+ lines = append(lines, head)
542+ return lines
543+ }
537544 lines = append(lines, toolBlockRule(v.Theme, width))
538545 lines = append(lines, head)
539- if tc.Result != "" {
540- color := v.Theme.ToolOut
541- if tc.Error {
542- color = v.Theme.Error
543- }
544- body := toolResultBlock(v.Theme, tc.Result, width, color)
545- lines = append(lines, v.collapseToolBody(body, false)...)
546+ color := v.Theme.ToolOut
547+ if tc.Error {
548+ color = v.Theme.Error
546549 }
550+ body := toolResultBlock(v.Theme, tc.Result, width, color)
551+ lines = append(lines, v.collapseToolBody(body, false)...)
547552 lines = append(lines, toolBlockRule(v.Theme, width))
548553 return lines
549554 }
@@ -534,16 +534,21 @@ func (v *View) renderToolCall(tc ToolCallView, width int) []string {
534 // Finished tool call: frame the whole block with opening +534 // Finished tool call: frame the whole block with opening +
535 // closing rules so it stands apart from surrounding assistant535 // closing rules so it stands apart from surrounding assistant
536 // prose. Matches the transcript-side framing in renderMessage.536 // prose. Matches the transcript-side framing in renderMessage.
537+ // When the result is empty, show just the header without rules
538+ // to avoid blank spacing for no-output tool calls.
539+ if tc.Result == "" {
540+ lines = append(lines, toolBlockRule(v.Theme, width))
541+ lines = append(lines, head)
542+ return lines
543+ }
537 lines = append(lines, toolBlockRule(v.Theme, width))544 lines = append(lines, toolBlockRule(v.Theme, width))
538 lines = append(lines, head)545 lines = append(lines, head)
539- if tc.Result != "" {546+ color := v.Theme.ToolOut
540- color := v.Theme.ToolOut547+ if tc.Error {
541- if tc.Error {548+ color = v.Theme.Error
542- color = v.Theme.Error
543- }
544- body := toolResultBlock(v.Theme, tc.Result, width, color)
545- lines = append(lines, v.collapseToolBody(body, false)...)
546 }549 }
550+ body := toolResultBlock(v.Theme, tc.Result, width, color)
551+ lines = append(lines, v.collapseToolBody(body, false)...)
547 lines = append(lines, toolBlockRule(v.Theme, width))552 lines = append(lines, toolBlockRule(v.Theme, width))
548 return lines553 return lines
549 }554 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close