mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-27 05:46:34 +02:00
tui: drop redundant leading blanks in live tool overlay
renderToolCall used to prepend a blank line at the top of each of its three branches (streaming-with-body, finished-no-result, finished-with-result) so the live box wouldn't sit flush against the prose / previous tool block above it. That made sense before each tool result owned its own complete box \u2014 back then the assistant message also injected a blank before its embedded top edge, and the two paths matched. After the box-ownership refactor the transcript path no longer emits a leading blank (Build()'s natural inter-message separator provides one), but renderToolCall still did, so a streaming tool sat two blank rows below the previous content while the same call, once finalised, sat only one. The visible "snap tighter" when streaming ended was the doubled gap collapsing. Drop the three leading blanks. Build()'s inter-message blank is the single source of vertical spacing now, so streaming and finalised forms have identical gaps.
This commit is contained in:
parent
48d22c4815
commit
37eb752cb2
1 changed files with 6 additions and 6 deletions
|
|
@ -598,9 +598,12 @@ func (v *View) renderToolCall(tc ToolCallView, width int) []string {
|
|||
}
|
||||
label := tc.Name + " " + arg
|
||||
|
||||
// Every box is preceded by a blank line so it doesn't sit
|
||||
// flush against the prose / previous tool block above it.
|
||||
// Matches the transcript-side framing in renderMessage.
|
||||
// No leading blank: Build()'s inter-message separator already
|
||||
// places one blank row between the previous transcript content
|
||||
// and the live overlay, matching the spacing the same call has
|
||||
// once it finalises into a transcript box. Adding another blank
|
||||
// here would double the gap during streaming and visibly tighten
|
||||
// when the overlay disappears.
|
||||
|
||||
// Streaming body (write/edit): top edge with the label, body
|
||||
// rows wrapped with vertical edges, bottom edge to close the
|
||||
|
|
@ -608,7 +611,6 @@ func (v *View) renderToolCall(tc ToolCallView, width int) []string {
|
|||
// the same frame the transcript renders the closed box, so
|
||||
// there's no visible hop.
|
||||
if tc.Streaming && tc.Result == "" {
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, toolBoxTop(v.Theme, label, width))
|
||||
lines = append(lines, toolBoxSide(v.Theme, "", width))
|
||||
if body := v.renderLiveToolBody(tc, width); len(body) > 0 {
|
||||
|
|
@ -623,7 +625,6 @@ func (v *View) renderToolCall(tc ToolCallView, width int) []string {
|
|||
// directly closed by the bottom. Avoids a blank interior row
|
||||
// for no-output tools.
|
||||
if tc.Result == "" {
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, toolBoxTop(v.Theme, label, width))
|
||||
lines = append(lines, toolBoxBottom(v.Theme, width))
|
||||
return lines
|
||||
|
|
@ -634,7 +635,6 @@ func (v *View) renderToolCall(tc ToolCallView, width int) []string {
|
|||
// vertical edges; bottom edge closes the box. Blank interior
|
||||
// rows after the top and before the bottom give the body a bit
|
||||
// of breathing room from the corners.
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, toolBoxTop(v.Theme, label, width))
|
||||
lines = append(lines, toolBoxSide(v.Theme, "", width))
|
||||
color := v.Theme.ToolOut
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue