diff options
Diffstat (limited to 'internal/tui/components/chat')
| -rw-r--r-- | internal/tui/components/chat/chat.go | 12 | ||||
| -rw-r--r-- | internal/tui/components/chat/list.go | 9 | ||||
| -rw-r--r-- | internal/tui/components/chat/message.go | 6 |
3 files changed, 16 insertions, 11 deletions
diff --git a/internal/tui/components/chat/chat.go b/internal/tui/components/chat/chat.go index 52ff4c8bf..b2b5a5c4a 100644 --- a/internal/tui/components/chat/chat.go +++ b/internal/tui/components/chat/chat.go @@ -2,6 +2,7 @@ package chat import ( "fmt" + "sort" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/x/ansi" @@ -28,8 +29,16 @@ func lspsConfigured(width int) string { lsps := styles.BaseStyle.Width(width).Foreground(styles.PrimaryColor).Bold(true).Render(title) + // Get LSP names and sort them for consistent ordering + var lspNames []string + for name := range cfg.LSP { + lspNames = append(lspNames, name) + } + sort.Strings(lspNames) + var lspViews []string - for name, lsp := range cfg.LSP { + for _, name := range lspNames { + lsp := cfg.LSP[name] lspName := styles.BaseStyle.Foreground(styles.Forground).Render( fmt.Sprintf("• %s", name), ) @@ -49,7 +58,6 @@ func lspsConfigured(width int) string { ), ), ) - } return styles.BaseStyle. Width(width). diff --git a/internal/tui/components/chat/list.go b/internal/tui/components/chat/list.go index b7703e2cc..994ddea03 100644 --- a/internal/tui/components/chat/list.go +++ b/internal/tui/components/chat/list.go @@ -376,14 +376,7 @@ func (m *messagesCmp) working() string { if hasToolsWithoutResponse(m.messages) { task = "Waiting for tool response..." } else if !lastMessage.IsFinished() { - lastUpdate := lastMessage.UpdatedAt - currentTime := time.Now().Unix() - if lastMessage.Content().String() != "" && lastUpdate != 0 && currentTime-lastUpdate > 5 { - task = "Building tool call..." - } else if lastMessage.Content().String() == "" { - task = "Generating..." - } - task = "" + task = "Generating..." } if task != "" { text += styles.BaseStyle.Width(m.width).Foreground(styles.PrimaryColor).Bold(true).Render( diff --git a/internal/tui/components/chat/message.go b/internal/tui/components/chat/message.go index 7a840b4ec..14b9e268e 100644 --- a/internal/tui/components/chat/message.go +++ b/internal/tui/components/chat/message.go @@ -151,7 +151,11 @@ func renderAssistantMessage( )) } } - if content != "" { + if content != "" || (finished && finishData.Reason == message.FinishReasonEndTurn) { + if content == "" { + content = "*Finished without output*" + } + content = renderMessage(content, false, msg.ID == focusedUIMessageId, width, info...) messages = append(messages, uiMessage{ ID: msg.ID, |
