xonecas.io
60255
Zn

Zoea-Nova / commit 73ed61b

fix(tui): remove conflicting background colors for cleaner UI

- Remove background from logStyle (conversation panel)
- Remove background from mysisListStyle (dashboard swarm list)
- Remove background from mysisItemStyle (mysis list items)
- Remove background from individual log entry lines
- Remove background from reasoning content styling
- Update test to check foreground instead of background
- Fixes visual artifacts from layered backgrounds

xonecas2026-02-05 73ed61b7ae3e9646176f2b29a9f77bdd833f7fca parent 1d35d7f

3 files changed

internal/tui/focus.go+7−15
@@ -244,19 +244,14 @@ func RenderFocusViewWithViewport(mysis MysisInfo, vp viewport.Model, width int,
244244 return lipgloss.JoinVertical(lipgloss.Left, sections...)
245245 }
246246
247-// logBgColor is the background color for log entries (same as colorBgPanel)
248-var logBgColor = colorBgPanel
249-
250247 func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool) []string {
251- // Get the role's foreground color and create a style with background
248+ // Get the role's foreground color
252249 roleColor := RoleColor(entry.Role)
253250 prefixStyle := lipgloss.NewStyle().
254- Foreground(roleColor).
255- Background(logBgColor)
251+ Foreground(roleColor)
256252
257- // Content style - just background, no foreground override
258- contentStyle := lipgloss.NewStyle().
259- Background(logBgColor)
253+ // Content style - no styling (transparent background)
254+ contentStyle := lipgloss.NewStyle()
260255
261256 var prefix string
262257 switch entry.Role {
@@ -352,16 +347,13 @@ func renderLogEntryImpl(entry LogEntry, maxWidth int, verbose bool) []string {
352347
353348 // Reasoning header in dimmed purple/magenta
354349 reasoningHeaderStyle := lipgloss.NewStyle().
355- Foreground(lipgloss.Color("170")). // Dimmed purple
356- Background(logBgColor)
350+ Foreground(lipgloss.Color("170")) // Dimmed purple
357351
358352 reasoningStyle := lipgloss.NewStyle().
359- Foreground(lipgloss.Color("213")). // Lighter purple for reasoning text
360- Background(logBgColor)
353+ Foreground(lipgloss.Color("213")) // Lighter purple for reasoning text
361354
362355 dimmedStyle := lipgloss.NewStyle().
363- Foreground(lipgloss.Color("240")). // Dim gray for truncation indicator
364- Background(logBgColor)
356+ Foreground(lipgloss.Color("240")) // Dim gray for truncation indicator
365357
366358 reasoningHeader := "REASONING:"
367359 reasoningHeaderWidth := len(reasoningHeader) + 1 // +1 for space after
internal/tui/styles.go+2−5
@@ -66,12 +66,10 @@ var (
6666 // Mysis list - double border for that 80s terminal aesthetic
6767 mysisListStyle = lipgloss.NewStyle().
6868 Border(lipgloss.DoubleBorder()).
69- BorderForeground(colorBorder).
70- Background(colorBgPanel)
69+ BorderForeground(colorBorder)
7170
7271 mysisItemStyle = lipgloss.NewStyle().
7372 Foreground(colorTeal).
74- Background(colorBgPanel).
7573 Padding(0, 1)
7674
7775 mysisItemSelectedStyle = lipgloss.NewStyle().
@@ -99,8 +97,7 @@ var (
9997 // No padding here - padding is added to content lines directly
10098 logStyle = lipgloss.NewStyle().
10199 Border(lipgloss.RoundedBorder()).
102- BorderForeground(colorBorder).
103- Background(colorBgPanel)
100+ BorderForeground(colorBorder)
104101
105102 // Role colors per design doc: user=green, assistant=magenta, system=cyan, tool=yellow
106103 logUserStyle = lipgloss.NewStyle().
internal/tui/tui_test.go+26−15
@@ -522,35 +522,46 @@ func TestRenderLogEntryLineWidthConsistent(t *testing.T) {
522522 }
523523 }
524524
525-func TestRenderLogEntryBackgroundApplied(t *testing.T) {
525+func TestRenderLogEntryForegroundApplied(t *testing.T) {
526526 // Force color output in tests (lipgloss strips colors without TTY)
527527 lipgloss.SetColorProfile(termenv.TrueColor)
528528 defer lipgloss.SetColorProfile(termenv.Ascii) // Reset after test
529529
530- // Test that background styling is applied to ALL lines, not just the first
531- // Background color is applied via ANSI escape codes containing "48;" (background)
530+ // Test that foreground styling is applied to prefix (backgrounds removed for cleaner UI)
531+ // Foreground color is applied via ANSI escape codes containing "38;" (foreground)
532532 entry := LogEntry{
533533 Role: "assistant",
534- Content: "First line\nSecond line\nThird line",
534+ Content: "Test message",
535535 }
536536 maxWidth := 60
537537 lines := renderLogEntryImpl(entry, maxWidth, false)
538538
539- if len(lines) < 3 {
540- t.Fatalf("expected at least 3 lines, got %d", len(lines))
539+ if len(lines) < 2 {
540+ t.Fatalf("expected at least 2 lines (padding + content), got %d", len(lines))
541541 }
542542
543- // Every line must contain ANSI background escape code
544- // ANSI background codes use "48;" prefix (e.g., "\x1b[48;2;..." for RGB)
545- for i, line := range lines {
546- if !strings.Contains(line, "\x1b[") {
547- t.Errorf("line %d missing ANSI escape codes (no styling applied)\nline bytes: %v", i, []byte(line))
548- }
549- // Check for background specifically - "48;" indicates background color
550- if !strings.Contains(line, "48;") {
551- t.Errorf("line %d missing background color escape code (48;)\nline: %q", i, line)
543+ // Find the first non-empty line (skip padding line)
544+ var contentLine string
545+ for _, line := range lines {
546+ stripped := strings.TrimSpace(stripANSI(line))
547+ if stripped != "" {
548+ contentLine = line
549+ break
552550 }
553551 }
552+
553+ if contentLine == "" {
554+ t.Fatal("no content line found")
555+ }
556+
557+ // Content line should have ANSI foreground color for the prefix
558+ // ANSI foreground codes use "38;" prefix (e.g., "\x1b[38;2;..." for RGB)
559+ if !strings.Contains(contentLine, "\x1b[") {
560+ t.Error("content line missing ANSI escape codes (no styling applied)")
561+ }
562+ if !strings.Contains(contentLine, "38;") {
563+ t.Error("content line missing foreground color escape code (38;)")
564+ }
554565 }
555566
556567 func TestRenderLogEntryPaddingAllRoles(t *testing.T) {