mirror of
https://github.com/sst/opencode.git
synced 2025-09-03 19:50:37 +00:00
fix(tui): pending tool call width
This commit is contained in:
parent
6a5a4247c6
commit
7c93bf5993
1 changed files with 8 additions and 3 deletions
|
@ -295,6 +295,7 @@ func renderToolDetails(
|
||||||
t := theme.CurrentTheme()
|
t := theme.CurrentTheme()
|
||||||
backgroundColor := t.BackgroundPanel()
|
backgroundColor := t.BackgroundPanel()
|
||||||
borderColor := t.BackgroundPanel()
|
borderColor := t.BackgroundPanel()
|
||||||
|
defaultStyle := styles.NewStyle().Background(backgroundColor).Width(width - 6).Render
|
||||||
|
|
||||||
if toolCall.State.Metadata != nil {
|
if toolCall.State.Metadata != nil {
|
||||||
metadata := toolCall.State.Metadata.(map[string]any)
|
metadata := toolCall.State.Metadata.(map[string]any)
|
||||||
|
@ -408,7 +409,7 @@ func renderToolDetails(
|
||||||
}
|
}
|
||||||
body = strings.Join(steps, "\n")
|
body = strings.Join(steps, "\n")
|
||||||
}
|
}
|
||||||
body = styles.NewStyle().Width(width - 6).Render(body)
|
body = defaultStyle(body)
|
||||||
default:
|
default:
|
||||||
if result == nil {
|
if result == nil {
|
||||||
empty := ""
|
empty := ""
|
||||||
|
@ -416,7 +417,7 @@ func renderToolDetails(
|
||||||
}
|
}
|
||||||
body = *result
|
body = *result
|
||||||
body = util.TruncateHeight(body, 10)
|
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 {
|
if body == "" && error == "" && result != nil {
|
||||||
body = *result
|
body = *result
|
||||||
body = util.TruncateHeight(body, 10)
|
body = util.TruncateHeight(body, 10)
|
||||||
body = styles.NewStyle().Width(width - 6).Render(body)
|
body = defaultStyle(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
if body == "" {
|
||||||
|
body = defaultStyle("")
|
||||||
}
|
}
|
||||||
|
|
||||||
title := renderToolTitle(toolCall, width)
|
title := renderToolTitle(toolCall, width)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue