diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-28 15:44:31 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-28 15:44:31 +0300 |
| commit | ebd800755832784e1e48e250bf1db11a8b286209 (patch) | |
| tree | c15022e702ae242b744d182a3c94e71007f275a9 /src/ui.rs | |
| parent | 7380e0ed16470c570984485930048a80034ba381 (diff) | |
add config diagnostics and split configuration docs
Diffstat (limited to 'src/ui.rs')
| -rw-r--r-- | src/ui.rs | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -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)), |
