use modifier dim instead of gray and .dim (#2273)
gray color doesn't work very well with white terminals. `.dim` doesn't have an effect for some reason. after: <img width="1080" height="149" alt="image" src="https://github.com/user-attachments/assets/26c0f8bb-550d-4d71-bd06-11b3189bc1d7" /> Before <img width="1077" height="186" alt="image" src="https://github.com/user-attachments/assets/b1fba0c7-bc4d-4da1-9754-6c0a105e8cd1" />
This commit is contained in:
@@ -731,15 +731,15 @@ impl WidgetRef for &ChatComposer {
|
||||
.render_ref(bottom_line_rect, buf);
|
||||
}
|
||||
}
|
||||
let border_style = if self.has_focus {
|
||||
Style::default().fg(Color::Cyan)
|
||||
} else {
|
||||
Style::default().add_modifier(Modifier::DIM)
|
||||
};
|
||||
Block::default()
|
||||
.border_style(Style::default().dim())
|
||||
.borders(Borders::LEFT)
|
||||
.border_type(BorderType::QuadrantOutside)
|
||||
.border_style(Style::default().fg(if self.has_focus {
|
||||
Color::Cyan
|
||||
} else {
|
||||
Color::Gray
|
||||
}))
|
||||
.border_style(border_style)
|
||||
.render_ref(
|
||||
Rect::new(textarea_rect.x, textarea_rect.y, 1, textarea_rect.height),
|
||||
buf,
|
||||
|
||||
@@ -93,9 +93,7 @@ pub(crate) fn render_rows(
|
||||
spans.push(Span::raw(" "));
|
||||
spans.push(Span::styled(
|
||||
desc.clone(),
|
||||
Style::default()
|
||||
.fg(Color::DarkGray)
|
||||
.add_modifier(Modifier::DIM),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -118,7 +116,7 @@ pub(crate) fn render_rows(
|
||||
Block::default()
|
||||
.borders(Borders::LEFT)
|
||||
.border_type(BorderType::QuadrantOutside)
|
||||
.border_style(Style::default().fg(Color::DarkGray)),
|
||||
.border_style(Style::default().add_modifier(Modifier::DIM)),
|
||||
)
|
||||
.widths([Constraint::Percentage(100)]);
|
||||
|
||||
|
||||
@@ -483,7 +483,7 @@ impl HistoryCell {
|
||||
} else {
|
||||
status_str.red()
|
||||
},
|
||||
format!(", duration: {duration}").gray(),
|
||||
format!(", duration: {duration}").dim(),
|
||||
]);
|
||||
|
||||
let mut lines: Vec<Line<'static>> = Vec::new();
|
||||
@@ -526,7 +526,10 @@ impl HistoryCell {
|
||||
format!("link: {uri}")
|
||||
}
|
||||
};
|
||||
lines.push(Line::styled(line_text, Style::default().fg(Color::Gray)));
|
||||
lines.push(Line::styled(
|
||||
line_text,
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,7 +758,7 @@ impl HistoryCell {
|
||||
if empty > 0 {
|
||||
header.push(Span::styled(
|
||||
"░".repeat(empty),
|
||||
Style::default().fg(Color::Gray),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
}
|
||||
header.push(Span::raw("] "));
|
||||
@@ -767,15 +770,15 @@ impl HistoryCell {
|
||||
let t = s.trim().to_string();
|
||||
if t.is_empty() { None } else { Some(t) }
|
||||
}) {
|
||||
lines.push(Line::from("note".gray().italic()));
|
||||
lines.push(Line::from("note".dim().italic()));
|
||||
for l in expl.lines() {
|
||||
lines.push(Line::from(l.to_string()).gray());
|
||||
lines.push(Line::from(l.to_string()).dim());
|
||||
}
|
||||
}
|
||||
|
||||
// Steps styled as checkbox items
|
||||
if plan.is_empty() {
|
||||
lines.push(Line::from("(no steps provided)".gray().italic()));
|
||||
lines.push(Line::from("(no steps provided)".dim().italic()));
|
||||
} else {
|
||||
for (idx, PlanItemArg { step, status }) in plan.into_iter().enumerate() {
|
||||
let (box_span, text_span) = match status {
|
||||
@@ -783,9 +786,7 @@ impl HistoryCell {
|
||||
Span::styled("✔", Style::default().fg(Color::Green)),
|
||||
Span::styled(
|
||||
step,
|
||||
Style::default()
|
||||
.fg(Color::Gray)
|
||||
.add_modifier(Modifier::CROSSED_OUT | Modifier::DIM),
|
||||
Style::default().add_modifier(Modifier::CROSSED_OUT | Modifier::DIM),
|
||||
),
|
||||
),
|
||||
StepStatus::InProgress => (
|
||||
@@ -799,10 +800,7 @@ impl HistoryCell {
|
||||
),
|
||||
StepStatus::Pending => (
|
||||
Span::raw("□"),
|
||||
Span::styled(
|
||||
step,
|
||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
||||
),
|
||||
Span::styled(step, Style::default().add_modifier(Modifier::DIM)),
|
||||
),
|
||||
};
|
||||
let prefix = if idx == 0 {
|
||||
@@ -997,7 +995,7 @@ fn format_mcp_invocation<'a>(invocation: McpInvocation) -> Line<'a> {
|
||||
Span::raw("."),
|
||||
Span::styled(invocation.tool.clone(), Style::default().fg(Color::Blue)),
|
||||
Span::raw("("),
|
||||
Span::styled(args_str, Style::default().fg(Color::Gray)),
|
||||
Span::styled(args_str, Style::default().add_modifier(Modifier::DIM)),
|
||||
Span::raw(")"),
|
||||
];
|
||||
Line::from(invocation_spans)
|
||||
|
||||
@@ -66,19 +66,19 @@ pub(crate) fn shimmer_spans(text: &str, frame_idx: usize) -> Vec<Span<'static>>
|
||||
.fg(Color::Rgb(level, level, level))
|
||||
.add_modifier(Modifier::BOLD)
|
||||
} else {
|
||||
Style::default().fg(color_for_level(level))
|
||||
color_for_level(level)
|
||||
};
|
||||
spans.push(Span::styled(ch.to_string(), style));
|
||||
}
|
||||
spans
|
||||
}
|
||||
|
||||
fn color_for_level(level: u8) -> Color {
|
||||
if level < 128 {
|
||||
Color::DarkGray
|
||||
} else if level < 192 {
|
||||
Color::Gray
|
||||
fn color_for_level(level: u8) -> Style {
|
||||
if level < 144 {
|
||||
Style::default().add_modifier(Modifier::DIM)
|
||||
} else if level < 208 {
|
||||
Style::default()
|
||||
} else {
|
||||
Color::White
|
||||
Style::default().add_modifier(Modifier::BOLD)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ impl WidgetRef for StatusIndicatorWidget {
|
||||
.fg(Color::Rgb(level, level, level))
|
||||
.add_modifier(Modifier::BOLD)
|
||||
} else {
|
||||
Style::default().fg(color_for_level(level))
|
||||
color_for_level(level)
|
||||
};
|
||||
|
||||
animated_spans.push(Span::styled(ch.to_string(), style));
|
||||
@@ -223,7 +223,7 @@ impl WidgetRef for StatusIndicatorWidget {
|
||||
let spinner_ch = spinner_frames[(idx / SPINNER_SLOWDOWN) % spinner_frames.len()];
|
||||
spans.push(Span::styled(
|
||||
spinner_ch.to_string(),
|
||||
Style::default().fg(Color::DarkGray),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
spans.push(Span::raw(" "));
|
||||
|
||||
@@ -236,27 +236,25 @@ impl WidgetRef for StatusIndicatorWidget {
|
||||
let bracket_prefix = format!("({elapsed}s • ");
|
||||
spans.push(Span::styled(
|
||||
bracket_prefix,
|
||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
spans.push(Span::styled(
|
||||
"Esc",
|
||||
Style::default()
|
||||
.fg(Color::Gray)
|
||||
.add_modifier(Modifier::DIM | Modifier::BOLD),
|
||||
Style::default().add_modifier(Modifier::DIM | Modifier::BOLD),
|
||||
));
|
||||
spans.push(Span::styled(
|
||||
" to interrupt)",
|
||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
// Add a space and then the log text (not animated by the gradient)
|
||||
if !status_prefix.is_empty() {
|
||||
spans.push(Span::styled(
|
||||
" ",
|
||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
spans.push(Span::styled(
|
||||
status_prefix,
|
||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
||||
Style::default().add_modifier(Modifier::DIM),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -281,13 +279,13 @@ impl WidgetRef for StatusIndicatorWidget {
|
||||
}
|
||||
}
|
||||
|
||||
fn color_for_level(level: u8) -> Color {
|
||||
if level < 128 {
|
||||
Color::DarkGray
|
||||
} else if level < 192 {
|
||||
Color::Gray
|
||||
fn color_for_level(level: u8) -> Style {
|
||||
if level < 144 {
|
||||
Style::default().add_modifier(Modifier::DIM)
|
||||
} else if level < 208 {
|
||||
Style::default()
|
||||
} else {
|
||||
Color::White
|
||||
Style::default().add_modifier(Modifier::BOLD)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ impl WidgetRef for &UserApprovalWidget<'_> {
|
||||
let style = if idx == self.selected_option {
|
||||
Style::new().bg(Color::Cyan).fg(Color::Black)
|
||||
} else {
|
||||
Style::new().bg(Color::DarkGray)
|
||||
Style::new().add_modifier(Modifier::DIM)
|
||||
};
|
||||
opt.label.clone().alignment(Alignment::Center).style(style)
|
||||
})
|
||||
@@ -372,7 +372,7 @@ impl WidgetRef for &UserApprovalWidget<'_> {
|
||||
}
|
||||
|
||||
Line::from(self.select_options[self.selected_option].description)
|
||||
.style(Style::new().italic().fg(Color::DarkGray))
|
||||
.style(Style::new().italic().add_modifier(Modifier::DIM))
|
||||
.render(description_area.inner(Margin::new(1, 0)), buf);
|
||||
|
||||
Block::bordered()
|
||||
|
||||
Reference in New Issue
Block a user