The open source coding agent.
TypeScript
fix: messages layout instability
adamdotdevin66d99ba52744
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.goindex 2d762dfa9fa..c80c0877081 100644--- a/packages/tui/internal/components/chat/message.go+++ b/packages/tui/internal/components/chat/message.go@@ -183,6 +183,8 @@ func renderContentBlock(if renderer.borderRight {style = style.BorderRightForeground(borderColor)}+ } else {+ style = style.PaddingLeft(renderer.paddingLeft + 1).PaddingRight(renderer.paddingRight + 1)}content = style.Render(content)diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.goindex d965ed7046e..22a15bfc419 100644--- a/packages/tui/internal/components/chat/messages.go+++ b/packages/tui/internal/components/chat/messages.go@@ -386,12 +386,6 @@ func (m *messagesComponent) renderView() tea.Cmd {fileParts,agentParts,)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )m.cache.Set(key, content)}if content != "" {@@ -468,12 +462,6 @@ func (m *messagesComponent) renderView() tea.Cmd {[]opencode.AgentPart{},toolCallParts...,)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )m.cache.Set(key, content)}} else {@@ -490,12 +478,6 @@ func (m *messagesComponent) renderView() tea.Cmd {[]opencode.AgentPart{},toolCallParts...,)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )}if content != "" {partCount++@@ -536,12 +518,6 @@ func (m *messagesComponent) renderView() tea.Cmd {permission,width,)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )m.cache.Set(key, content)}} else {@@ -552,12 +528,6 @@ func (m *messagesComponent) renderView() tea.Cmd {permission,width,)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )}if content != "" {partCount++@@ -586,12 +556,6 @@ func (m *messagesComponent) renderView() tea.Cmd {[]opencode.FilePart{},[]opencode.AgentPart{},)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )partCount++lineCount += lipgloss.Height(content) + 1blocks = append(blocks, content)@@ -625,12 +589,6 @@ func (m *messagesComponent) renderView() tea.Cmd {[]opencode.FilePart{},[]opencode.AgentPart{},)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )partCount++lineCount += lipgloss.Height(content) + 1blocks = append(blocks, content)@@ -645,12 +603,6 @@ func (m *messagesComponent) renderView() tea.Cmd {width,WithBorderColor(t.Error()),)- error = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- error,- styles.WhitespaceStyle(t.Background()),- )blocks = append(blocks, error)lineCount += lipgloss.Height(error) + 1}@@ -742,12 +694,6 @@ func (m *messagesComponent) renderView() tea.Cmd {m.app.CurrentPermission,width,)- content = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- content,- styles.WhitespaceStyle(t.Background()),- )if content != "" {partCount++lineCount += lipgloss.Height(content) + 1@@ -916,12 +862,6 @@ func (m *messagesComponent) renderHeader() string {BorderForeground(t.BackgroundElement()).BorderStyle(lipgloss.ThickBorder()).Render(header)- header = lipgloss.PlaceHorizontal(- m.width,- lipgloss.Center,- header,- styles.WhitespaceStyle(t.Background()),- )return "\n" + header + "\n"}