summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/components/chat
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-15 05:57:15 -0500
committeradamdottv <[email protected]>2025-06-15 05:57:15 -0500
commitb8a89dab0f303311b1ee76a43f35be52e90072f2 (patch)
treed516429970ad269a178557470f44c354c2dd0df0 /packages/tui/internal/components/chat
parent7351e1288660e0140dea832fc4c91d786b02d23e (diff)
downloadopencode-b8a89dab0f303311b1ee76a43f35be52e90072f2.tar.gz
opencode-b8a89dab0f303311b1ee76a43f35be52e90072f2.zip
fix: background color rendering issues
Diffstat (limited to 'packages/tui/internal/components/chat')
-rw-r--r--packages/tui/internal/components/chat/message.go10
-rw-r--r--packages/tui/internal/components/chat/messages.go19
2 files changed, 25 insertions, 4 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go
index 3315d4ba3..0a8bc0496 100644
--- a/packages/tui/internal/components/chat/message.go
+++ b/packages/tui/internal/components/chat/message.go
@@ -180,11 +180,13 @@ func renderContentBlock(content string, options ...renderingOption) string {
layout.Current.Container.Width,
align,
content,
+ lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),
)
content = lipgloss.PlaceHorizontal(
layout.Current.Viewport.Width,
lipgloss.Center,
content,
+ lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),
)
return content
}
@@ -373,6 +375,7 @@ func renderToolInvocation(
lipgloss.Center,
lipgloss.Top,
body,
+ lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),
)
}
}
@@ -440,7 +443,12 @@ func renderToolInvocation(
}
content := style.Render(title)
- content = lipgloss.PlaceHorizontal(layout.Current.Viewport.Width, lipgloss.Center, content)
+ content = lipgloss.PlaceHorizontal(
+ layout.Current.Viewport.Width,
+ lipgloss.Center,
+ content,
+ lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),
+ )
if showResult && body != "" && error == "" {
content += "\n" + body
}
diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.go
index e93b25b1d..17397d267 100644
--- a/packages/tui/internal/components/chat/messages.go
+++ b/packages/tui/internal/components/chat/messages.go
@@ -275,9 +275,15 @@ func (m *messagesComponent) View() string {
if m.rendering {
return m.viewport.View()
}
+ t := theme.CurrentTheme()
return lipgloss.JoinVertical(
lipgloss.Left,
- lipgloss.PlaceHorizontal(m.width, lipgloss.Center, m.header()),
+ lipgloss.PlaceHorizontal(
+ m.width,
+ lipgloss.Center,
+ m.header(),
+ lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),
+ ),
m.viewport.View(),
)
}
@@ -346,13 +352,20 @@ func (m *messagesComponent) home() string {
lines = append(lines, "")
}
- return lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center,
+ t := theme.CurrentTheme()
+ return lipgloss.Place(
+ m.width,
+ m.height,
+ lipgloss.Center,
+ lipgloss.Center,
baseStyle.Width(lipgloss.Width(logoAndVersion)).Render(
lipgloss.JoinVertical(
lipgloss.Top,
lines...,
),
- ))
+ ),
+ lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),
+ )
}
func (m *messagesComponent) SetSize(width, height int) tea.Cmd {