Enhance logging and documentation across utility tools and TUI overlays

- Added tracing instrumentation and improved logging messages in the Pong, Todofinish, and Todowrite tools for better debugging and monitoring.
- Enhanced documentation comments for clarity on tool functionalities and workflows.
- Implemented tracing in WorkflowRun, NoteFinding, ReadFindings, and HiveMind tools to track execution phases and findings.
- Updated TUI overlays (e.g., Bash, Clear Confirm, Editor, Effort Level, Help, Key Input, Learning, Loading, MCP, Model Selector, Plan, Quit Confirm, Rewind, Settings, Todo, Usage) with debug logging to capture rendering details.
- Improved the status bar and workflow panel rendering with additional debug information.
- Added tracing to various utility functions to facilitate better performance monitoring and error tracking.
This commit is contained in:
asepharyana
2026-07-20 15:53:43 +07:00
parent f84dfb8476
commit 16494d4b1e
69 changed files with 637 additions and 30 deletions
+13 -1
View File
@@ -6,6 +6,7 @@ use ratatui::style::{Color, Modifier, Style};
use ratatui::text::{Line, Span};
use ratatui::widgets::{Block, Borders, Paragraph, Wrap};
use ratatui::Frame;
use tracing::{debug, instrument};
fn state_icon(state: AgentState) -> &'static str {
match state {
@@ -34,12 +35,18 @@ fn state_color(state: AgentState) -> Color {
}
}
/// Render the workflow status panel.
/// Render the workflow status panel showing agent cards and a header.
///
/// Flow: render titled block → split into header (command hint + status)
/// and body (agent cards with icon/name/label/duration, or session stats
/// when no workflow is running).
#[instrument(skip_all)]
pub fn draw_workflow_panel(
frame: &mut Frame,
area: Rect,
state: &crate::state::AppStateRest,
) {
debug!("draw_workflow_panel — rendering workflow panel");
use ratatui::layout::{Constraint, Direction, Layout};
let title = Span::styled(
@@ -157,6 +164,11 @@ pub fn draw_workflow_panel(
}
}
/// Build placeholder lines for the workflow panel body when no agents are running.
///
/// Shows session stats (message count, tool calls, pending queue, bash jobs)
/// or a "(no active session)" fallback.
#[instrument(skip(state))]
fn build_session_lines(state: &crate::state::AppStateRest) -> Vec<Line<'static>> {
let mut lines: Vec<Line<'static>> = Vec::new();
lines.push(Line::from(Span::styled(