summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdotdevin <[email protected]>2025-07-16 06:27:32 -0500
committeradamdotdevin <[email protected]>2025-07-16 06:27:32 -0500
commit7c93bf5993c0a76a17547c51c8d6c3ad9b0df33c (patch)
tree7920e35900e9cb222a135908965661f338eb591c
parent6a5a4247c6fa90309629b587a20bcdbcf88981e0 (diff)
downloadopencode-7c93bf5993c0a76a17547c51c8d6c3ad9b0df33c.tar.gz
opencode-7c93bf5993c0a76a17547c51c8d6c3ad9b0df33c.zip
fix(tui): pending tool call width
-rw-r--r--packages/tui/internal/components/chat/message.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go
index db8a43268..635979194 100644
--- a/packages/tui/internal/components/chat/message.go
+++ b/packages/tui/internal/components/chat/message.go
@@ -295,6 +295,7 @@ func renderToolDetails(
t := theme.CurrentTheme()
backgroundColor := t.BackgroundPanel()
borderColor := t.BackgroundPanel()
+ defaultStyle := styles.NewStyle().Background(backgroundColor).Width(width - 6).Render
if toolCall.State.Metadata != nil {
metadata := toolCall.State.Metadata.(map[string]any)
@@ -408,7 +409,7 @@ func renderToolDetails(
}
body = strings.Join(steps, "\n")
}
- body = styles.NewStyle().Width(width - 6).Render(body)
+ body = defaultStyle(body)
default:
if result == nil {
empty := ""
@@ -416,7 +417,7 @@ func renderToolDetails(
}
body = *result
body = util.TruncateHeight(body, 10)
- body = styles.NewStyle().Width(width - 6).Render(body)
+ body = defaultStyle(body)
}
}
@@ -436,7 +437,11 @@ func renderToolDetails(
if body == "" && error == "" && result != nil {
body = *result
body = util.TruncateHeight(body, 10)
- body = styles.NewStyle().Width(width - 6).Render(body)
+ body = defaultStyle(body)
+ }
+
+ if body == "" {
+ body = defaultStyle("")
}
title := renderToolTitle(toolCall, width)