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
2026-07-19 17:05:47 +07:00
parent 6680795ce7
commit 5aaedbf787
255 changed files with 5666 additions and 743 deletions
+13
View File
@@ -20,6 +20,7 @@ use ratatui::style::{Color, Modifier, Style};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, BorderType, Borders, Paragraph};
use ratatui::Frame;
use tracing;
/// Column width reserved for the `{role} {time} ` header prefix; wrapped
/// continuation lines and Tool sub-lines indent to this width so content
@@ -101,7 +102,19 @@ fn needs_speaker_separator(_prev_role: Option<&Role>, _role: &Role) -> bool {
}
/// Render the scrollable chat transcript panel in tight inline-log style.
///
/// Flow: iterate transcript messages → render each into styled `Line`s
/// with a compact `{role} {time}` header prefix → append streaming
/// spinner if a turn is in flight → slice to the visible scroll window
/// → wrap in a bordered Paragraph widget.
pub fn draw_chat(frame: &mut Frame, area: Rect, state: &crate::app::state::rest::AppStateRest) {
let msg_count = state.transcript_cache.messages.len();
tracing::debug!(
msg_count,
area = %format!("{}x{}", area.width, area.height),
scroll_offset = state.scroll.offset,
"draw_chat rendering transcript"
);
let messages = &state.transcript_cache.messages;
let scroll_offset = state.scroll.offset;
let max_visible = (area.height as usize).saturating_sub(3);