aboutsummaryrefslogtreecommitdiff
path: root/src/ui.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-03-28 15:44:31 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-03-28 15:44:31 +0300
commitebd800755832784e1e48e250bf1db11a8b286209 (patch)
treec15022e702ae242b744d182a3c94e71007f275a9 /src/ui.rs
parent7380e0ed16470c570984485930048a80034ba381 (diff)
add config diagnostics and split configuration docs
Diffstat (limited to 'src/ui.rs')
-rw-r--r--src/ui.rs28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/ui.rs b/src/ui.rs
index 5b089335..c52794fc 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -71,12 +71,15 @@ pub fn render(app: &AppState, frame: &mut Frame) {
Mode::Terminal => {}
}
- // Update notification (rendered on top of everything)
+ // Notifications (rendered on top of everything)
if let Some(version) = &app.update_available {
if !app.update_dismissed {
render_update_notification(frame, terminal_area, version, app.accent);
}
}
+ if let Some(message) = &app.config_diagnostic {
+ render_config_diagnostic(frame, terminal_area, message);
+ }
}
/// Compute pane layout info and resize pane runtimes to match.
@@ -768,6 +771,29 @@ fn render_update_notification(frame: &mut Frame, area: Rect, version: &str, acce
///
/// Filled dot = needs attention (working, or finished unseen).
/// Hollow dot = nothing to do here.
+fn render_config_diagnostic(frame: &mut Frame, area: Rect, message: &str) {
+ let text = format!(" config warning: {message} ");
+ let width = text.len() as u16 + 2;
+ let notif_area = Rect::new(
+ area.x + area.width.saturating_sub(width.min(area.width)),
+ area.y,
+ width.min(area.width),
+ 1,
+ );
+
+ frame.render_widget(Clear, notif_area);
+ frame.render_widget(
+ Paragraph::new(Span::styled(
+ text,
+ Style::default()
+ .fg(Color::Black)
+ .bg(Color::Yellow)
+ .add_modifier(Modifier::BOLD),
+ )),
+ notif_area,
+ );
+}
+
fn state_icon_style(state: AgentState, seen: bool) -> (&'static str, Style) {
match (state, seen) {
(AgentState::Waiting, _) => ("●", Style::default().fg(Color::Red)),