fix(tui): remove hardcoded dark-terminal assumptions — theme-agnostic styles
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).
This commit is contained in:
parent
db841a92f7
commit
22c16b811c
1 changed files with 6 additions and 12 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue