summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/components
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui/components')
-rw-r--r--internal/tui/components/chat/chat.go12
-rw-r--r--internal/tui/components/chat/list.go9
-rw-r--r--internal/tui/components/chat/message.go6
-rw-r--r--internal/tui/components/core/status.go17
4 files changed, 33 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,
diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go
index 01c535869..5a2114e83 100644
--- a/internal/tui/components/core/status.go
+++ b/internal/tui/components/core/status.go
@@ -138,6 +138,23 @@ func (m statusCmp) View() string {
}
func (m *statusCmp) projectDiagnostics() string {
+ // Check if any LSP server is still initializing
+ initializing := false
+ for _, client := range m.lspClients {
+ if client.GetServerState() == lsp.StateStarting {
+ initializing = true
+ break
+ }
+ }
+
+ // If any server is initializing, show that status
+ if initializing {
+ return lipgloss.NewStyle().
+ Background(styles.BackgroundDarker).
+ Foreground(styles.Peach).
+ Render(fmt.Sprintf("%s Initializing LSP...", styles.SpinnerIcon))
+ }
+
errorDiagnostics := []protocol.Diagnostic{}
warnDiagnostics := []protocol.Diagnostic{}
hintDiagnostics := []protocol.Diagnostic{}