feat: placeholder on pending assistant message
This commit is contained in:
parent
fa7cae59c0
commit
a760e8364f
1 changed files with 28 additions and 0 deletions
|
|
@ -400,6 +400,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
|
||||||
revertedToolCount = 0
|
revertedToolCount = 0
|
||||||
}
|
}
|
||||||
hasTextPart := false
|
hasTextPart := false
|
||||||
|
hasContent := false
|
||||||
for partIndex, p := range message.Parts {
|
for partIndex, p := range message.Parts {
|
||||||
switch part := p.(type) {
|
switch part := p.(type) {
|
||||||
case opencode.TextPart:
|
case opencode.TextPart:
|
||||||
|
|
@ -491,6 +492,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
|
||||||
partCount++
|
partCount++
|
||||||
lineCount += lipgloss.Height(content) + 1
|
lineCount += lipgloss.Height(content) + 1
|
||||||
blocks = append(blocks, content)
|
blocks = append(blocks, content)
|
||||||
|
hasContent = true
|
||||||
}
|
}
|
||||||
case opencode.ToolPart:
|
case opencode.ToolPart:
|
||||||
if reverted {
|
if reverted {
|
||||||
|
|
@ -552,6 +554,7 @@ func (m *messagesComponent) renderView() tea.Cmd {
|
||||||
partCount++
|
partCount++
|
||||||
lineCount += lipgloss.Height(content) + 1
|
lineCount += lipgloss.Height(content) + 1
|
||||||
blocks = append(blocks, content)
|
blocks = append(blocks, content)
|
||||||
|
hasContent = true
|
||||||
}
|
}
|
||||||
case opencode.ReasoningPart:
|
case opencode.ReasoningPart:
|
||||||
if reverted {
|
if reverted {
|
||||||
|
|
@ -582,8 +585,33 @@ func (m *messagesComponent) renderView() tea.Cmd {
|
||||||
partCount++
|
partCount++
|
||||||
lineCount += lipgloss.Height(content) + 1
|
lineCount += lipgloss.Height(content) + 1
|
||||||
blocks = append(blocks, content)
|
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 := ""
|
error := ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue