docs: tambah doc comment, logging, dan inline comments di semua 255 file

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
This commit is contained in:
asepharyana committed 2026-07-19 17:05:47 +07:00
1 parent 6680795ce7
commit 5aaedbf787
255 files changed
+5666 -743

No files matched your search

@@ -1,15 +1,24 @@
//! Overlay: list of active / completed bash background jobs.
//!
//! Flow: reads `session_runtime.bash_jobs` and renders each job as a line
//! with ID, command, and running/done status.
use ratatui::style::Style;
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Paragraph};
use ratatui::Frame;
use crate::view::theme::Theme;
use tracing;
/// Render the Bash Jobs overlay — lists every background shell job with
/// its ID, command text, and current status.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Bash Jobs");
let block = super::overlay_block(block, "Bash Jobs", Theme::ACCENT_ORANGE);
let lines: Vec<Line> = state
.session_runtime
@@ -1,15 +1,27 @@
//! 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 ",
@@ -1,15 +1,24 @@
//! Overlay: inline editor mode — shows the current input buffer with cursor
//! position and save/dismiss key hints.
//!
//! Flow: reads `state.input.buffer` and `state.input.cursor` every frame to
//! display a live preview of what the user is editing.
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 Editor overlay — buffer preview with cursor position.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Editor (buffer_len={}, cursor={})", state.input.buffer.len(), state.input.cursor);
let block = block
.title(Span::styled(
" Editor ",
@@ -1,15 +1,24 @@
//! Overlay: effort-level selector — lets the user pick a reasoning/quality
//! tier (from `EFFORT_LEVELS`) with ↑/↓ navigation.
//!
//! Flow: reads the current effort index from `mode::effort::current_effort`,
//! highlights the active entry, and renders the full list.
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 Effort Level overlay — list of tiers with the current one highlighted.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Effort Level");
let block = block
.title(Span::styled(
" Effort Level ",
@@ -1,14 +1,23 @@
//! 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)
@@ -1,15 +1,24 @@
//! Overlay: API key input dialog — prompts the user for a provider API key
//! with masked display (shows first 4 chars only).
//!
//! Flow: reads `state.input.buffer`, masks it for display, and renders a
//! warning-coloured prompt with the masked key.
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 API Key input overlay — masked key display with instructions.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Key Input");
let block = block
.title(Span::styled(
" API Key ",
@@ -1,16 +1,27 @@
//! Overlay: Learning / lesson management — two-panel view with a scrollable
//! lesson list (left) and detail pane (right).
//!
//! Flow: renders lessons from `mode::learning::get_learning_items` in a
//! left panel with selection highlight; the right panel shows the selected
//! lesson's full details (name, status, scope, confidence, content) and
//! action hints (Accept/Reject for pending, Delete for stored).
use ratatui::layout::{Constraint, Direction, Layout};
use ratatui::style::{Modifier, Style};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Borders, Paragraph, Wrap};
use ratatui::Frame;
use crate::view::theme::Theme;
use tracing;
/// Render the Learning overlay — split-pane lesson browser with detail view.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Learning (items={})", crate::app::mode::learning::get_learning_items(state).len());
// block is unused — Learning uses its own child blocks for left/right panels
drop(block);
@@ -1,15 +1,24 @@
//! Overlay: loading / processing spinner — shown during blocking operations
//! (e.g., streaming response, tool execution).
//!
//! Flow: renders an animated spinner frame from `state.misc.tick_count` with
//! a "Processing, please wait..." message.
use ratatui::style::{Modifier, Style};
use ratatui::text::Span;
use ratatui::widgets::{Block, Paragraph};
use ratatui::Frame;
use crate::view::theme::Theme;
use tracing;
/// Render the Loading overlay — spinner animation + processing message.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Loading");
let block = block
.title(Span::styled(
" Loading ",
@@ -1,15 +1,24 @@
//! Overlay: MCP (Model Context Protocol) server management — lists configured
//! MCP servers and their connection status.
//!
//! Flow: reads session directory info and renders a placeholder list. Currently
//! serves as a reference to the Ctrl+P provider-settings shortcut.
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 MCP Servers overlay — server list and management UI.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: MCP Servers");
let block = block
.title(Span::styled(
" MCP Servers ",
@@ -24,6 +24,7 @@ use ratatui::text::Span;
use ratatui::widgets::{Block, Borders, Clear};
use ratatui::Frame;
use super::theme::Theme;
use tracing;
/// Decorate an overlay block with a styled title and matching border color.
///
@@ -68,6 +69,7 @@ pub fn render_overlay(
overlay: crate::app::state::types::Overlay,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("render_overlay: {:?}", overlay);
let overlay_area = centered_rect(area, 75, 70);
// Clear the area behind the overlay (semi-transparent effect)
@@ -1,15 +1,25 @@
//! Overlay: model/provider selector — lists available providers from config
//! and lets the user pick one with ↑/↓/Enter.
//!
//! Flow: reads `state.app_config.providers` and renders them as a selectable
//! list; the current selection is highlighted and the current active provider
//! is marked.
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 Model Selector overlay — provider list with selection highlight.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Model Selector (providers={})", state.app_config.providers.len());
let block = block
.title(Span::styled(
" Model Selector ",
@@ -1,15 +1,24 @@
//! Overlay: quit confirmation dialog — prompts the user with an error-coloured
//! confirmation panel before the application shuts down.
//!
//! Flow: renders a static "Are you sure?" prompt with Enter/Esc instructions;
//! the input controller handles the actual quit-or-cancel decision.
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 Quit confirmation overlay — Enter to confirm, Esc to cancel.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
_state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Quit Confirm");
let block = block
.title(Span::styled(
" Quit ",
@@ -1,15 +1,26 @@
//! Overlay: Rewind / session history — shows recent messages and lets the user
//! pick a point to rewind the transcript back to.
//!
//! Flow: reads the last 8 messages from `state.transcript_cache.messages`,
//! renders each with a role tag and content preview; an overflow note is
//! appended when there are more than 8 messages. The input controller handles
//! ↑/↓ navigation and Enter to confirm the rewind point.
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 Rewind overlay — message list with role tags and previews.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Rewind (messages={})", state.transcript_cache.messages.len());
let block = block
.title(Span::styled(
" Rewind ",
@@ -1,15 +1,24 @@
//! Overlay: settings overview — displays the current provider, model,
//! max tokens, temperature, internet mode, and review toggle.
//!
//! Flow: reads `state.settings` and renders each setting on its own line
//! inside a primary-coloured overlay block.
use ratatui::style::Style;
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Paragraph};
use ratatui::Frame;
use crate::view::theme::Theme;
use tracing;
/// Render the Settings overlay — current configuration summary.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Settings");
let block = super::overlay_block(block, "Settings", Theme::PRIMARY);
let lines = vec![
Line::from(Span::styled(
@@ -1,15 +1,24 @@
//! Overlay: Tasks (todo) view — shows the full todo list content in a
//! scrollable, wrapped panel as an "expand" view over the compact sidebar widget.
//!
//! Flow: reads `state.misc.todo_content` and renders it with word-wrap in
//! a purple-accented overlay.
use ratatui::style::{Modifier, Style};
use ratatui::text::Span;
use ratatui::widgets::{Block, Paragraph, Wrap};
use ratatui::Frame;
use crate::view::theme::Theme;
use tracing;
/// Render the Tasks / Todo overlay — full todo content with word-wrap.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Tasks (todo_content_len={})", state.misc.todo_content.len());
let block = block
.title(Span::styled(
" Tasks ",
@@ -1,15 +1,26 @@
//! Overlay: usage statistics — detailed token usage, API call count, edit/
//! review/lesson activity counters, and session elapsed time.
//!
//! Flow: reads `state.session_runtime` and passes raw counters through
//! `sidebar::compute_usage_summary` to get display-ready numbers, then
//! renders them in an info-coloured overlay with two labelled sections:
//! "Token Usage" and "Activity".
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 Usage overlay — token stats, activity counters, session time.
pub fn render(
frame: &mut Frame,
area: ratatui::layout::Rect,
block: Block<'static>,
state: &crate::app::state::rest::AppStateRest,
) {
tracing::debug!("overlay: Usage");
let block = block
.title(Span::styled(
" Usage ",