From 3a9d95d82ebebd7605c7f377e1376c7d34540ff5 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 5 Feb 2026 14:22:15 -0300 Subject: [PATCH] fix(ui): use plain letters for lsp status (#2121) * fix(ui): use plain letters for lsp status symbols might be wrongly interpreted by some terminals, so this might be a good idea Signed-off-by: Carlos Alexandro Becker * chore(ui): use consts for LSP symbols * fix: missing icon usage Signed-off-by: Carlos Alexandro Becker --------- Signed-off-by: Carlos Alexandro Becker Co-authored-by: Christian Rocha --- internal/ui/common/elements.go | 2 +- internal/ui/dialog/api_key_input.go | 2 +- internal/ui/model/header.go | 2 +- internal/ui/model/lsp.go | 8 ++++---- internal/ui/styles/styles.go | 9 +++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/internal/ui/common/elements.go b/internal/ui/common/elements.go index 16fe528f736c8b40a16d664b47d1ea1e1f1ecb93..a129d1861e483c5c2064dc70d70ebd5c09cbd1f8 100644 --- a/internal/ui/common/elements.go +++ b/internal/ui/common/elements.go @@ -99,7 +99,7 @@ func formatTokensAndCost(t *styles.Styles, tokens, contextWindow int64, cost flo formattedPercentage := t.Muted.Render(fmt.Sprintf("%d%%", int(percentage))) formattedTokens = fmt.Sprintf("%s %s", formattedPercentage, formattedTokens) if percentage > 80 { - formattedTokens = fmt.Sprintf("%s %s", styles.WarningIcon, formattedTokens) + formattedTokens = fmt.Sprintf("%s %s", styles.LSPWarningIcon, formattedTokens) } return fmt.Sprintf("%s %s", formattedTokens, formattedCost) diff --git a/internal/ui/dialog/api_key_input.go b/internal/ui/dialog/api_key_input.go index 6e9d26f0c5badc0d96bb6c6212ae3b69856b9e06..f06d9ff8f1af19d6dc04564bf82c8d523eee6525 100644 --- a/internal/ui/dialog/api_key_input.go +++ b/internal/ui/dialog/api_key_input.go @@ -256,7 +256,7 @@ func (m *APIKeyInput) inputView() string { ts := t.TextInput ts.Focused.Prompt = ts.Focused.Prompt.Foreground(charmtone.Cherry) - m.input.Prompt = styles.ErrorIcon + " " + m.input.Prompt = styles.LSPErrorIcon + " " m.input.SetStyles(ts) m.input.Focus() } diff --git a/internal/ui/model/header.go b/internal/ui/model/header.go index 5e704bf6ed8a5f69e224ceeca05d34ad59740789..3d576e85d022192bb8435909915b8d1d7c5a04ee 100644 --- a/internal/ui/model/header.go +++ b/internal/ui/model/header.go @@ -114,7 +114,7 @@ func renderHeaderDetails( } if errorCount > 0 { - parts = append(parts, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s%d", styles.ErrorIcon, errorCount))) + parts = append(parts, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPErrorIcon, errorCount))) } agentCfg := config.Get().Agents[config.AgentCoder] diff --git a/internal/ui/model/lsp.go b/internal/ui/model/lsp.go index c46beb10083b420ec1353c8a2536d45093a899b4..ef78ebfb2c4e069901e0b4433587e948f98643d1 100644 --- a/internal/ui/model/lsp.go +++ b/internal/ui/model/lsp.go @@ -62,16 +62,16 @@ func (m *UI) lspInfo(width, maxItems int, isSection bool) string { func lspDiagnostics(t *styles.Styles, diagnostics map[protocol.DiagnosticSeverity]int) string { errs := []string{} if diagnostics[protocol.SeverityError] > 0 { - errs = append(errs, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s %d", styles.ErrorIcon, diagnostics[protocol.SeverityError]))) + errs = append(errs, t.LSP.ErrorDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPErrorIcon, diagnostics[protocol.SeverityError]))) } if diagnostics[protocol.SeverityWarning] > 0 { - errs = append(errs, t.LSP.WarningDiagnostic.Render(fmt.Sprintf("%s %d", styles.WarningIcon, diagnostics[protocol.SeverityWarning]))) + errs = append(errs, t.LSP.WarningDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPWarningIcon, diagnostics[protocol.SeverityWarning]))) } if diagnostics[protocol.SeverityHint] > 0 { - errs = append(errs, t.LSP.HintDiagnostic.Render(fmt.Sprintf("%s %d", styles.HintIcon, diagnostics[protocol.SeverityHint]))) + errs = append(errs, t.LSP.HintDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPHintIcon, diagnostics[protocol.SeverityHint]))) } if diagnostics[protocol.SeverityInformation] > 0 { - errs = append(errs, t.LSP.InfoDiagnostic.Render(fmt.Sprintf("%s %d", styles.InfoIcon, diagnostics[protocol.SeverityInformation]))) + errs = append(errs, t.LSP.InfoDiagnostic.Render(fmt.Sprintf("%s%d", styles.LSPInfoIcon, diagnostics[protocol.SeverityInformation]))) } return strings.Join(errs, " ") } diff --git a/internal/ui/styles/styles.go b/internal/ui/styles/styles.go index c1d548ec25a2afb0645927a22fa5821ba8c3b968..d28dd1b462ffa6e7bc6bc2c1a34b4ef66d513ef7 100644 --- a/internal/ui/styles/styles.go +++ b/internal/ui/styles/styles.go @@ -18,10 +18,6 @@ import ( const ( CheckIcon string = "✓" - ErrorIcon string = "×" - WarningIcon string = "⚠" - InfoIcon string = "ⓘ" - HintIcon string = "∵" SpinnerIcon string = "⋯" LoadingIcon string = "⟳" ModelIcon string = "◇" @@ -49,6 +45,11 @@ const ( ScrollbarThumb string = "┃" ScrollbarTrack string = "│" + + LSPErrorIcon string = "E" + LSPWarningIcon string = "W" + LSPInfoIcon string = "I" + LSPHintIcon string = "H" ) const (