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);
|
.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()
|
Block::default()
|
||||||
.border_style(Style::default().dim())
|
|
||||||
.borders(Borders::LEFT)
|
.borders(Borders::LEFT)
|
||||||
.border_type(BorderType::QuadrantOutside)
|
.border_type(BorderType::QuadrantOutside)
|
||||||
.border_style(Style::default().fg(if self.has_focus {
|
.border_style(border_style)
|
||||||
Color::Cyan
|
|
||||||
} else {
|
|
||||||
Color::Gray
|
|
||||||
}))
|
|
||||||
.render_ref(
|
.render_ref(
|
||||||
Rect::new(textarea_rect.x, textarea_rect.y, 1, textarea_rect.height),
|
Rect::new(textarea_rect.x, textarea_rect.y, 1, textarea_rect.height),
|
||||||
buf,
|
buf,
|
||||||
|
|||||||
@@ -93,9 +93,7 @@ pub(crate) fn render_rows(
|
|||||||
spans.push(Span::raw(" "));
|
spans.push(Span::raw(" "));
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
desc.clone(),
|
desc.clone(),
|
||||||
Style::default()
|
Style::default().add_modifier(Modifier::DIM),
|
||||||
.fg(Color::DarkGray)
|
|
||||||
.add_modifier(Modifier::DIM),
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +116,7 @@ pub(crate) fn render_rows(
|
|||||||
Block::default()
|
Block::default()
|
||||||
.borders(Borders::LEFT)
|
.borders(Borders::LEFT)
|
||||||
.border_type(BorderType::QuadrantOutside)
|
.border_type(BorderType::QuadrantOutside)
|
||||||
.border_style(Style::default().fg(Color::DarkGray)),
|
.border_style(Style::default().add_modifier(Modifier::DIM)),
|
||||||
)
|
)
|
||||||
.widths([Constraint::Percentage(100)]);
|
.widths([Constraint::Percentage(100)]);
|
||||||
|
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ impl HistoryCell {
|
|||||||
} else {
|
} else {
|
||||||
status_str.red()
|
status_str.red()
|
||||||
},
|
},
|
||||||
format!(", duration: {duration}").gray(),
|
format!(", duration: {duration}").dim(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let mut lines: Vec<Line<'static>> = Vec::new();
|
let mut lines: Vec<Line<'static>> = Vec::new();
|
||||||
@@ -526,7 +526,10 @@ impl HistoryCell {
|
|||||||
format!("link: {uri}")
|
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 {
|
if empty > 0 {
|
||||||
header.push(Span::styled(
|
header.push(Span::styled(
|
||||||
"░".repeat(empty),
|
"░".repeat(empty),
|
||||||
Style::default().fg(Color::Gray),
|
Style::default().add_modifier(Modifier::DIM),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
header.push(Span::raw("] "));
|
header.push(Span::raw("] "));
|
||||||
@@ -767,15 +770,15 @@ impl HistoryCell {
|
|||||||
let t = s.trim().to_string();
|
let t = s.trim().to_string();
|
||||||
if t.is_empty() { None } else { Some(t) }
|
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() {
|
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
|
// Steps styled as checkbox items
|
||||||
if plan.is_empty() {
|
if plan.is_empty() {
|
||||||
lines.push(Line::from("(no steps provided)".gray().italic()));
|
lines.push(Line::from("(no steps provided)".dim().italic()));
|
||||||
} else {
|
} else {
|
||||||
for (idx, PlanItemArg { step, status }) in plan.into_iter().enumerate() {
|
for (idx, PlanItemArg { step, status }) in plan.into_iter().enumerate() {
|
||||||
let (box_span, text_span) = match status {
|
let (box_span, text_span) = match status {
|
||||||
@@ -783,9 +786,7 @@ impl HistoryCell {
|
|||||||
Span::styled("✔", Style::default().fg(Color::Green)),
|
Span::styled("✔", Style::default().fg(Color::Green)),
|
||||||
Span::styled(
|
Span::styled(
|
||||||
step,
|
step,
|
||||||
Style::default()
|
Style::default().add_modifier(Modifier::CROSSED_OUT | Modifier::DIM),
|
||||||
.fg(Color::Gray)
|
|
||||||
.add_modifier(Modifier::CROSSED_OUT | Modifier::DIM),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
StepStatus::InProgress => (
|
StepStatus::InProgress => (
|
||||||
@@ -799,10 +800,7 @@ impl HistoryCell {
|
|||||||
),
|
),
|
||||||
StepStatus::Pending => (
|
StepStatus::Pending => (
|
||||||
Span::raw("□"),
|
Span::raw("□"),
|
||||||
Span::styled(
|
Span::styled(step, Style::default().add_modifier(Modifier::DIM)),
|
||||||
step,
|
|
||||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
let prefix = if idx == 0 {
|
let prefix = if idx == 0 {
|
||||||
@@ -997,7 +995,7 @@ fn format_mcp_invocation<'a>(invocation: McpInvocation) -> Line<'a> {
|
|||||||
Span::raw("."),
|
Span::raw("."),
|
||||||
Span::styled(invocation.tool.clone(), Style::default().fg(Color::Blue)),
|
Span::styled(invocation.tool.clone(), Style::default().fg(Color::Blue)),
|
||||||
Span::raw("("),
|
Span::raw("("),
|
||||||
Span::styled(args_str, Style::default().fg(Color::Gray)),
|
Span::styled(args_str, Style::default().add_modifier(Modifier::DIM)),
|
||||||
Span::raw(")"),
|
Span::raw(")"),
|
||||||
];
|
];
|
||||||
Line::from(invocation_spans)
|
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))
|
.fg(Color::Rgb(level, level, level))
|
||||||
.add_modifier(Modifier::BOLD)
|
.add_modifier(Modifier::BOLD)
|
||||||
} else {
|
} else {
|
||||||
Style::default().fg(color_for_level(level))
|
color_for_level(level)
|
||||||
};
|
};
|
||||||
spans.push(Span::styled(ch.to_string(), style));
|
spans.push(Span::styled(ch.to_string(), style));
|
||||||
}
|
}
|
||||||
spans
|
spans
|
||||||
}
|
}
|
||||||
|
|
||||||
fn color_for_level(level: u8) -> Color {
|
fn color_for_level(level: u8) -> Style {
|
||||||
if level < 128 {
|
if level < 144 {
|
||||||
Color::DarkGray
|
Style::default().add_modifier(Modifier::DIM)
|
||||||
} else if level < 192 {
|
} else if level < 208 {
|
||||||
Color::Gray
|
Style::default()
|
||||||
} else {
|
} else {
|
||||||
Color::White
|
Style::default().add_modifier(Modifier::BOLD)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ impl WidgetRef for StatusIndicatorWidget {
|
|||||||
.fg(Color::Rgb(level, level, level))
|
.fg(Color::Rgb(level, level, level))
|
||||||
.add_modifier(Modifier::BOLD)
|
.add_modifier(Modifier::BOLD)
|
||||||
} else {
|
} else {
|
||||||
Style::default().fg(color_for_level(level))
|
color_for_level(level)
|
||||||
};
|
};
|
||||||
|
|
||||||
animated_spans.push(Span::styled(ch.to_string(), style));
|
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()];
|
let spinner_ch = spinner_frames[(idx / SPINNER_SLOWDOWN) % spinner_frames.len()];
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
spinner_ch.to_string(),
|
spinner_ch.to_string(),
|
||||||
Style::default().fg(Color::DarkGray),
|
Style::default().add_modifier(Modifier::DIM),
|
||||||
));
|
));
|
||||||
spans.push(Span::raw(" "));
|
spans.push(Span::raw(" "));
|
||||||
|
|
||||||
@@ -236,27 +236,25 @@ impl WidgetRef for StatusIndicatorWidget {
|
|||||||
let bracket_prefix = format!("({elapsed}s • ");
|
let bracket_prefix = format!("({elapsed}s • ");
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
bracket_prefix,
|
bracket_prefix,
|
||||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
Style::default().add_modifier(Modifier::DIM),
|
||||||
));
|
));
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
"Esc",
|
"Esc",
|
||||||
Style::default()
|
Style::default().add_modifier(Modifier::DIM | Modifier::BOLD),
|
||||||
.fg(Color::Gray)
|
|
||||||
.add_modifier(Modifier::DIM | Modifier::BOLD),
|
|
||||||
));
|
));
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
" to interrupt)",
|
" 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)
|
// Add a space and then the log text (not animated by the gradient)
|
||||||
if !status_prefix.is_empty() {
|
if !status_prefix.is_empty() {
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
" ",
|
" ",
|
||||||
Style::default().fg(Color::Gray).add_modifier(Modifier::DIM),
|
Style::default().add_modifier(Modifier::DIM),
|
||||||
));
|
));
|
||||||
spans.push(Span::styled(
|
spans.push(Span::styled(
|
||||||
status_prefix,
|
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 {
|
fn color_for_level(level: u8) -> Style {
|
||||||
if level < 128 {
|
if level < 144 {
|
||||||
Color::DarkGray
|
Style::default().add_modifier(Modifier::DIM)
|
||||||
} else if level < 192 {
|
} else if level < 208 {
|
||||||
Color::Gray
|
Style::default()
|
||||||
} else {
|
} else {
|
||||||
Color::White
|
Style::default().add_modifier(Modifier::BOLD)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ impl WidgetRef for &UserApprovalWidget<'_> {
|
|||||||
let style = if idx == self.selected_option {
|
let style = if idx == self.selected_option {
|
||||||
Style::new().bg(Color::Cyan).fg(Color::Black)
|
Style::new().bg(Color::Cyan).fg(Color::Black)
|
||||||
} else {
|
} else {
|
||||||
Style::new().bg(Color::DarkGray)
|
Style::new().add_modifier(Modifier::DIM)
|
||||||
};
|
};
|
||||||
opt.label.clone().alignment(Alignment::Center).style(style)
|
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)
|
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);
|
.render(description_area.inner(Margin::new(1, 0)), buf);
|
||||||
|
|
||||||
Block::bordered()
|
Block::bordered()
|
||||||
|
|||||||
Reference in New Issue
Block a user