refactor(cli): polish secondary commands with icons, number formatting, and section dividers

Phase 6 of the UX overhaul. Applies consistent visual treatment across
the remaining command outputs: stats, doctor, timeline, who, count,
and drift.

Stats (stats.rs):
- Apply render::format_number() to all numeric values (documents,
  FTS indexed, embedding counts, chunks) for thousand-separator
  formatting in large databases

Doctor (doctor.rs):
- Replace Unicode check/warning/cross symbols with Icons::success(),
  Icons::warning(), Icons::error() for glyph-mode awareness
- Add summary line after checks showing "Ready/Not ready" with counts
  of passed, warnings, and failed checks separated by middle dots
- Remove "lore doctor" title header for cleaner output

Count (count.rs):
- Right-align numeric values with {:>10} format for columnar output
  in count and state breakdown displays

Timeline (timeline.rs):
- Add entity icons (issue/MR) before entity references in event rows
- Refactor format_event_tag to pad plain text before applying style,
  preventing ANSI codes from breaking column alignment
- Extract style_padded() helper for width-then-style pattern

Who (who.rs):
- Add Icons::user() before usernames in expert, workload, reviews,
  and overlap displays
- Replace manual bold section headers with render::section_divider()
  in workload view (Assigned Issues, Authored MRs, Reviewing MRs,
  Unresolved Discussions)

Drift (drift.rs):
- Add Icons::error()/success() before drift detection status line
- Replace '#' bar character with Unicode full block for similarity
  curve visualization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-14 10:03:20 -05:00
committed by teernisse
parent d0744039ef
commit 8572f6cc04
6 changed files with 145 additions and 75 deletions

View File

@@ -328,26 +328,44 @@ fn section(title: &str) {
pub fn print_stats(result: &StatsResult) {
section("Documents");
let mut parts = vec![format!("{} total", result.documents.total)];
let mut parts = vec![format!(
"{} total",
render::format_number(result.documents.total)
)];
if result.documents.issues > 0 {
parts.push(format!("{} issues", result.documents.issues));
parts.push(format!(
"{} issues",
render::format_number(result.documents.issues)
));
}
if result.documents.merge_requests > 0 {
parts.push(format!("{} MRs", result.documents.merge_requests));
parts.push(format!(
"{} MRs",
render::format_number(result.documents.merge_requests)
));
}
if result.documents.discussions > 0 {
parts.push(format!("{} discussions", result.documents.discussions));
parts.push(format!(
"{} discussions",
render::format_number(result.documents.discussions)
));
}
println!(" {}", parts.join(" \u{b7} "));
if result.documents.truncated > 0 {
println!(
" {}",
Theme::warning().render(&format!("{} truncated", result.documents.truncated))
Theme::warning().render(&format!(
"{} truncated",
render::format_number(result.documents.truncated)
))
);
}
section("Search Index");
println!(" {} FTS indexed", result.fts.indexed);
println!(
" {} FTS indexed",
render::format_number(result.fts.indexed)
);
let coverage_color = if result.embeddings.coverage_pct >= 95.0 {
Theme::success().render(&format!("{:.0}%", result.embeddings.coverage_pct))
} else if result.embeddings.coverage_pct >= 50.0 {
@@ -357,12 +375,17 @@ pub fn print_stats(result: &StatsResult) {
};
println!(
" {} embedding coverage ({}/{})",
coverage_color, result.embeddings.embedded_documents, result.documents.total,
coverage_color,
render::format_number(result.embeddings.embedded_documents),
render::format_number(result.documents.total),
);
if result.embeddings.total_chunks > 0 {
println!(
" {}",
Theme::dim().render(&format!("{} chunks", result.embeddings.total_chunks))
Theme::dim().render(&format!(
"{} chunks",
render::format_number(result.embeddings.total_chunks)
))
);
}