diff options
Diffstat (limited to 'packages/tui/internal/components/chat')
| -rw-r--r-- | packages/tui/internal/components/chat/message.go | 10 | ||||
| -rw-r--r-- | packages/tui/internal/components/chat/messages.go | 19 |
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 { |
