Files
zesdex/crates/zesdex-backend/src/view/overlays/clear_confirm.rs
T

47 lines
1.5 KiB
Rust
Raw Normal View History

//! Overlay: confirm-before-clear dialog for the chat transcript.
//!
//! Flow: shows a warning-coloured confirmation prompt; user presses Enter to
//! confirm or Esc to cancel (handled by the input controller, not this renderer).
use ratatui::style::{Modifier, Style};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Paragraph};
use ratatui::Frame;
use crate::view::theme::Theme;
use tracing;
/// Render the Clear Transcript confirmation dialog.
///
/// This overlay has no interactive state of its own — it just renders the
/// prompt and instructions; the caller (`controller/input.rs`) interprets
/// Enter/Esc and applies the action.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
_state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Clear Confirm");
let block = block
.title(Span::styled(
" Clear Transcript ",
Style::default()
.fg(Theme::WARNING)
.add_modifier(Modifier::BOLD),
))
.border_style(Style::default().fg(Theme::WARNING));
let lines = vec![
Line::from(Span::styled(
" Clear all messages from the transcript?",
Style::default().fg(Theme::TEXT),
)),
Line::from(Span::raw("")),
Line::from(Span::styled(
" Enter to confirm · Esc to cancel",
Style::default().fg(Theme::TEXT_DIM),
)),
];
let paragraph = Paragraph::new(lines).block(block);
frame.render_widget(paragraph, area);
}