From 22c16b811c74709c6bdf9a9f1de9c09d4579487b Mon Sep 17 00:00:00 2001 From: 123kupola Date: Thu, 25 Jun 2026 17:55:10 +0200 Subject: [PATCH] =?UTF-8?q?fix(tui):=20remove=20hardcoded=20dark-terminal?= =?UTF-8?q?=20assumptions=20=E2=80=94=20theme-agnostic=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Structural colors that assumed a dark terminal background replaced with terminal-relative alternatives: - Footer key labels: bg(DarkGray)+fg(White) → REVERSED modifier (terminal's own reverse-video color, adapts to any theme) - Row selection (normal): bg(DarkGray) → REVERSED modifier - Row selection (attention): bg(DarkGray)+fg(LightRed) → REVERSED|BOLD+fg(Red) - Status messages: fg(Cyan) → ITALIC|BOLD (cyan is invisible on light backgrounds) - Footer auto-refresh text: fg(Gray) → terminal default Semantic colors preserved: Red/Green/Yellow/Blue/Magenta for state indicators work in both dark and light terminals. The attention row bg(Red)+fg(White) is kept — red=danger is universal. 14 tests, workspace green (0 failures). --- crates/colibri-glasspane-tui/src/main.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/colibri-glasspane-tui/src/main.rs b/crates/colibri-glasspane-tui/src/main.rs index c3bd9dd..1038fe6 100644 --- a/crates/colibri-glasspane-tui/src/main.rs +++ b/crates/colibri-glasspane-tui/src/main.rs @@ -381,9 +381,7 @@ impl App { if let Some((msg, _)) = &self.status_msg { lines.push(Line::from(Span::styled( msg, - Style::default() - .fg(Color::Cyan) - .add_modifier(Modifier::ITALIC), + Style::default().add_modifier(Modifier::ITALIC | Modifier::BOLD), ))); } @@ -475,14 +473,13 @@ impl App { let row_style = if needs_attention(p) { if Some(i) == selected { Style::default() - .bg(Color::DarkGray) - .fg(Color::LightRed) - .add_modifier(Modifier::BOLD) + .add_modifier(Modifier::REVERSED | Modifier::BOLD) + .fg(Color::Red) } else { Style::default().bg(Color::Red).fg(Color::White) } } else if Some(i) == selected { - Style::default().bg(Color::DarkGray) + Style::default().add_modifier(Modifier::REVERSED) } else { Style::default() }; @@ -579,10 +576,7 @@ impl App { let key = |label: &str| -> Span { Span::styled( format!(" {label}"), - Style::default() - .add_modifier(Modifier::BOLD) - .fg(Color::White) - .bg(Color::DarkGray), + Style::default().add_modifier(Modifier::BOLD | Modifier::REVERSED), ) }; let text = Line::from(vec![ @@ -604,7 +598,7 @@ impl App { Span::raw(" filter "), key("r"), Span::raw(" refresh "), - Span::styled(" auto 2s", Style::default().fg(Color::Gray)), + Span::styled(" auto 2s", Style::default()), ]); f.render_widget(Paragraph::new(text), area); }