on main help sign in
fix(ui): use plain letters for lsp status (#2121)
3a9d95dCarlos Alexandro Becker
internal/ui/common/elements.go+1−1
@@ -99,7 +99,7 @@ func formatTokensAndCost(t *styles.Styles, tokens, contextWindow int64, cost flo
99 formattedPercentage := t.Muted.Render(fmt.Sprintf("%d%%", int(percentage)))
99 formattedPercentage := t.Muted.Render(fmt.Sprintf("%d%%", int(percentage)))
100 formattedTokens = fmt.Sprintf("%s %s", formattedPercentage, formattedTokens)
100 formattedTokens = fmt.Sprintf("%s %s", formattedPercentage, formattedTokens)
101 if percentage > 80 {
101 if percentage > 80 {
102− formattedTokens = fmt.Sprintf("%s %s", styles.WarningIcon, formattedTokens)
102+ formattedTokens = fmt.Sprintf("%s %s", styles.LSPWarningIcon, formattedTokens)
103 }
103 }
104
104
105 return fmt.Sprintf("%s %s", formattedTokens, formattedCost)
105 return fmt.Sprintf("%s %s", formattedTokens, formattedCost)
internal/ui/dialog/api_key_input.go+1−1
@@ -256,7 +256,7 @@ func (m *APIKeyInput) inputView() string {
256 ts := t.TextInput
256 ts := t.TextInput
257 ts.Focused.Prompt = ts.Focused.Prompt.Foreground(charmtone.Cherry)
257 ts.Focused.Prompt = ts.Focused.Prompt.Foreground(charmtone.Cherry)
258
258
259− m.input.Prompt = styles.ErrorIcon + " "
259+ m.input.Prompt = styles.LSPErrorIcon + " "
260 m.input.SetStyles(ts)
260 m.input.SetStyles(ts)
261 m.input.Focus()
261 m.input.Focus()
262 }
262 }
internal/ui/model/header.go+1−1
@@ -114,7 +114,7 @@ func renderHeaderDetails(
114 }
114 }
115
115
116 if errorCount > 0 {
116 if errorCount > 0 {
117− parts = append(parts, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s%d", styles.ErrorIcon, errorCount)))
117+ parts = append(parts, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPErrorIcon, errorCount)))
118 }
118 }
119
119
120 agentCfg := config.Get().Agents[config.AgentCoder]
120 agentCfg := config.Get().Agents[config.AgentCoder]
internal/ui/model/lsp.go+4−4
@@ -62,16 +62,16 @@ func (m *UI) lspInfo(width, maxItems int, isSection bool) string {
62func lspDiagnostics(t *styles.Styles, diagnostics map[protocol.DiagnosticSeverity]int) string {
62func lspDiagnostics(t *styles.Styles, diagnostics map[protocol.DiagnosticSeverity]int) string {
63 errs := []string{}
63 errs := []string{}
64 if diagnostics[protocol.SeverityError] > 0 {
64 if diagnostics[protocol.SeverityError] > 0 {
65− errs = append(errs, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s %d", styles.ErrorIcon, diagnostics[protocol.SeverityError])))
65+ errs = append(errs, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPErrorIcon, diagnostics[protocol.SeverityError])))
66 }
66 }
67 if diagnostics[protocol.SeverityWarning] > 0 {
67 if diagnostics[protocol.SeverityWarning] > 0 {
68− errs = append(errs, t.LSP.WarningDiagnostic.Render(fmt.Sprintf("%s %d", styles.WarningIcon, diagnostics[protocol.SeverityWarning])))
68+ errs = append(errs, t.LSP.WarningDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPWarningIcon, diagnostics[protocol.SeverityWarning])))
69 }
69 }
70 if diagnostics[protocol.SeverityHint] > 0 {
70 if diagnostics[protocol.SeverityHint] > 0 {
71− errs = append(errs, t.LSP.HintDiagnostic.Render(fmt.Sprintf("%s %d", styles.HintIcon, diagnostics[protocol.SeverityHint])))
71+ errs = append(errs, t.LSP.HintDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPHintIcon, diagnostics[protocol.SeverityHint])))
72 }
72 }
73 if diagnostics[protocol.SeverityInformation] > 0 {
73 if diagnostics[protocol.SeverityInformation] > 0 {
74− errs = append(errs, t.LSP.InfoDiagnostic.Render(fmt.Sprintf("%s %d", styles.InfoIcon, diagnostics[protocol.SeverityInformation])))
74+ errs = append(errs, t.LSP.InfoDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPInfoIcon, diagnostics[protocol.SeverityInformation])))
75 }
75 }
76 return strings.Join(errs, " ")
76 return strings.Join(errs, " ")
77}
77}
internal/ui/styles/styles.go+5−4
@@ -18,10 +18,6 @@ import (
18
18
19const (
19const (
20 CheckIcon string = "✓"
20 CheckIcon string = "✓"
21− ErrorIcon string = "×"
22− WarningIcon string = "⚠"
23− InfoIcon string = "ⓘ"
24− HintIcon string = "∵"
25 SpinnerIcon string = "⋯"
21 SpinnerIcon string = "⋯"
26 LoadingIcon string = "⟳"
22 LoadingIcon string = "⟳"
27 ModelIcon string = "◇"
23 ModelIcon string = "◇"
@@ -49,6 +45,11 @@ const (
49
45
50 ScrollbarThumb string = "┃"
46 ScrollbarThumb string = "┃"
51 ScrollbarTrack string = "│"
47 ScrollbarTrack string = "│"
48+
49+ LSPErrorIcon string = "E"
50+ LSPWarningIcon string = "W"
51+ LSPInfoIcon string = "I"
52+ LSPHintIcon string = "H"
52)
53)
53
54
54const (
55const (