Meliputi: - File-level //! doc comment: tujuan file, alur kerja, komponen utama - Function-level /// doc comment: apa, parameter, return, flow, edge cases - Struct/enum/trait /// doc comment: peran, field docs - Tracing logging (tracing::info!/debug!/trace!/warn!/error!) di setiap fungsi - Inline comments untuk variable dan branching logic penting - Seluruh 8 crates di workspace: zesdex-backend, zesdex-cms, zesdex-entities, zesdex-iam, zesdex-infra, zesdex-ipc, zesdex-middleware, zesdex-utils - Build: 0 errors, 242/242 tests passed
29 lines
939 B
Rust
29 lines
939 B
Rust
//! 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.
|
|
|
|
use ratatui::style::Style;
|
|
use ratatui::widgets::{Block, Paragraph, Wrap};
|
|
use ratatui::Frame;
|
|
use crate::view::theme::Theme;
|
|
use tracing;
|
|
|
|
/// Render the Help overlay — displays the full keyboard shortcut reference.
|
|
pub fn render(
|
|
frame: &mut Frame,
|
|
area: ratatui::layout::Rect,
|
|
block: Block<'static>,
|
|
_state: &crate::app::state::rest::AppStateRest,
|
|
) {
|
|
tracing::debug!("overlay: Help");
|
|
let block = super::overlay_block(block, "Help", Theme::INFO);
|
|
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);
|
|
}
|