2026-07-19 17:05:27 +07:00
|
|
|
//! Overlay: keyboard shortcut reference — renders the static `HELP_TEXT`
|
|
|
|
|
//! constant from `crate::prompts`.
|
|
|
|
|
//!
|
|
|
|
|
//! Flow: wraps the pre-defined help string in an info-coloured overlay block
|
|
|
|
|
//! with word-wrap enabled.
|
|
|
|
|
|
2026-07-18 01:59:42 +07:00
|
|
|
use ratatui::style::Style;
|
2026-07-17 09:03:37 +07:00
|
|
|
use ratatui::widgets::{Block, Paragraph, Wrap};
|
|
|
|
|
use ratatui::Frame;
|
|
|
|
|
use crate::view::theme::Theme;
|
2026-07-19 17:05:27 +07:00
|
|
|
use tracing;
|
2026-07-17 09:03:37 +07:00
|
|
|
|
2026-07-19 17:05:27 +07:00
|
|
|
/// Render the Help overlay — displays the full keyboard shortcut reference.
|
2026-07-17 09:03:37 +07:00
|
|
|
pub fn render(
|
|
|
|
|
frame: &mut Frame,
|
|
|
|
|
area: ratatui::layout::Rect,
|
|
|
|
|
block: Block<'static>,
|
|
|
|
|
_state: &crate::app::state::rest::AppStateRest,
|
|
|
|
|
) {
|
2026-07-19 17:05:27 +07:00
|
|
|
tracing::debug!("overlay: Help");
|
2026-07-18 01:59:42 +07:00
|
|
|
let block = super::overlay_block(block, "Help", Theme::INFO);
|
2026-07-17 09:03:37 +07:00
|
|
|
let content = crate::prompts::HELP_TEXT;
|
|
|
|
|
let paragraph = Paragraph::new(content)
|
|
|
|
|
.block(block)
|
|
|
|
|
.style(Style::default().bg(Theme::BG))
|
|
|
|
|
.wrap(Wrap { trim: false });
|
|
|
|
|
frame.render_widget(paragraph, area);
|
|
|
|
|
}
|