diff --git a/src/view/sidebar.rs b/src/view/sidebar.rs index 1a50267..07c994a 100644 --- a/src/view/sidebar.rs +++ b/src/view/sidebar.rs @@ -58,11 +58,18 @@ fn draw_tasks_widget(frame: &mut Frame, area: Rect, state: &crate::app::state::r frame.render_widget(paragraph, area); } -/// Compact Usage widget: main/self-learning token split, API call count, -/// and session clock. Always fits (the summary is a fixed handful of -/// lines), so there is no overflow hint — the `Overlay::Usage` "expand" -/// view adds edit/review/lesson activity counters on top of this same -/// summary rather than showing more of a truncated list. +/// Compact Usage widget: total tokens, main/self-learning token split, +/// API call count, and session clock. Always fits (the summary is a +/// fixed handful of lines), so there is no overflow hint — the +/// `Overlay::Usage` "expand" view adds edit/review/lesson activity +/// counters on top of this same summary rather than showing more of a +/// truncated list. +/// +/// Each number gets its own short line rather than being crammed onto +/// one — the sidebar column is only ~28 usable characters wide after +/// borders, and a single `"{total} tok ({main} main / {learn} learn)"` +/// line silently clips (no `.wrap()` on this `Paragraph`) once token +/// counts reach 5-6 digits, which is routine for an agent session. fn draw_usage_widget(frame: &mut Frame, area: Rect, state: &crate::app::state::rest::AppStateRest) { let block = Block::default() .title(Span::styled(" Usage ", Style::default().fg(Theme::INFO).add_modifier(Modifier::BOLD))) @@ -74,9 +81,17 @@ fn draw_usage_widget(frame: &mut Frame, area: Rect, state: &crate::app::state::r let summary = compute_usage_summary(&rt.usage, rt.session_start, now_ms); vec![ Line::from(Span::styled( - format!(" {} tok ({} main / {} learn)", summary.total_tokens, summary.main_tokens, summary.self_learning_tokens), + format!(" {} tok total", summary.total_tokens), Style::default().fg(Theme::TEXT).add_modifier(Modifier::BOLD), )), + Line::from(Span::styled( + format!(" main: {} tok", summary.main_tokens), + Style::default().fg(Theme::TEXT_DIM), + )), + Line::from(Span::styled( + format!(" learn: {} tok", summary.self_learning_tokens), + Style::default().fg(Theme::TEXT_DIM), + )), Line::from(Span::styled( format!(" {} API calls", summary.api_calls), Style::default().fg(Theme::TEXT_DIM),