summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdotdevin <[email protected]>2025-08-11 09:29:44 -0500
committeradamdotdevin <[email protected]>2025-08-11 09:29:44 -0500
commita760e8364ff70e0fdefcbd2ff17077a5b9b2a5ea (patch)
tree2c370d109a3070e5bc2fd9c5276aafbc6adb481f
parentfa7cae59c090a2151bccdd51ec4dbf637b07c918 (diff)
downloadopencode-a760e8364ff70e0fdefcbd2ff17077a5b9b2a5ea.tar.gz
opencode-a760e8364ff70e0fdefcbd2ff17077a5b9b2a5ea.zip
feat: placeholder on pending assistant message
-rw-r--r--packages/tui/internal/components/chat/messages.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.go
index 630f715eb..9d9c8011b 100644
--- a/packages/tui/internal/components/chat/messages.go
+++ b/packages/tui/internal/components/chat/messages.go
@@ -400,6 +400,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
revertedToolCount = 0
}
hasTextPart := false
+ hasContent := false
for partIndex, p := range message.Parts {
switch part := p.(type) {
case opencode.TextPart:
@@ -491,6 +492,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
partCount++
lineCount += lipgloss.Height(content) + 1
blocks = append(blocks, content)
+ hasContent = true
}
case opencode.ToolPart:
if reverted {
@@ -552,6 +554,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
partCount++
lineCount += lipgloss.Height(content) + 1
blocks = append(blocks, content)
+ hasContent = true
}
case opencode.ReasoningPart:
if reverted {
@@ -582,8 +585,33 @@ func (m *messagesComponent) renderView() tea.Cmd {
partCount++
lineCount += lipgloss.Height(content) + 1
blocks = append(blocks, content)
+ hasContent = true
}
}
+
+ if !hasContent {
+ content = renderText(
+ m.app,
+ message.Info,
+ "Generating...",
+ casted.ModelID,
+ m.showToolDetails,
+ width,
+ "",
+ false,
+ []opencode.FilePart{},
+ []opencode.AgentPart{},
+ )
+ content = lipgloss.PlaceHorizontal(
+ m.width,
+ lipgloss.Center,
+ content,
+ styles.WhitespaceStyle(t.Background()),
+ )
+ partCount++
+ lineCount += lipgloss.Height(content) + 1
+ blocks = append(blocks, content)
+ }
}
error := ""