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:
committed by
teernisse
parent
d0744039ef
commit
8572f6cc04
@@ -1,4 +1,4 @@
|
||||
use crate::cli::render::Theme;
|
||||
use crate::cli::render::{Icons, Theme};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::core::config::Config;
|
||||
@@ -530,7 +530,7 @@ fn check_logging(config: Option<&Config>) -> LoggingCheck {
|
||||
}
|
||||
|
||||
pub fn print_doctor_results(result: &DoctorResult) {
|
||||
println!("\nlore doctor\n");
|
||||
println!();
|
||||
|
||||
print_check("Config", &result.checks.config.result);
|
||||
print_check("Database", &result.checks.database.result);
|
||||
@@ -539,31 +539,53 @@ pub fn print_doctor_results(result: &DoctorResult) {
|
||||
print_check("Ollama", &result.checks.ollama.result);
|
||||
print_check("Logging", &result.checks.logging.result);
|
||||
|
||||
// Count statuses
|
||||
let checks = [
|
||||
&result.checks.config.result,
|
||||
&result.checks.database.result,
|
||||
&result.checks.gitlab.result,
|
||||
&result.checks.projects.result,
|
||||
&result.checks.ollama.result,
|
||||
&result.checks.logging.result,
|
||||
];
|
||||
let passed = checks
|
||||
.iter()
|
||||
.filter(|c| c.status == CheckStatus::Ok)
|
||||
.count();
|
||||
let warnings = checks
|
||||
.iter()
|
||||
.filter(|c| c.status == CheckStatus::Warning)
|
||||
.count();
|
||||
let failed = checks
|
||||
.iter()
|
||||
.filter(|c| c.status == CheckStatus::Error)
|
||||
.count();
|
||||
|
||||
println!();
|
||||
|
||||
let mut summary_parts = Vec::new();
|
||||
if result.success {
|
||||
let ollama_ok = result.checks.ollama.result.status == CheckStatus::Ok;
|
||||
if ollama_ok {
|
||||
println!("{}", Theme::success().render("Status: Ready"));
|
||||
} else {
|
||||
println!(
|
||||
"{} {}",
|
||||
Theme::success().render("Status: Ready"),
|
||||
Theme::warning()
|
||||
.render("(lexical search available, semantic search requires Ollama)")
|
||||
);
|
||||
}
|
||||
summary_parts.push(Theme::success().render("Ready"));
|
||||
} else {
|
||||
println!("{}", Theme::error().render("Status: Not ready"));
|
||||
summary_parts.push(Theme::error().render("Not ready"));
|
||||
}
|
||||
summary_parts.push(format!("{passed} passed"));
|
||||
if warnings > 0 {
|
||||
summary_parts.push(Theme::warning().render(&format!("{warnings} warning")));
|
||||
}
|
||||
if failed > 0 {
|
||||
summary_parts.push(Theme::error().render(&format!("{failed} failed")));
|
||||
}
|
||||
println!(" {}", summary_parts.join(" \u{b7} "));
|
||||
|
||||
println!();
|
||||
}
|
||||
|
||||
fn print_check(name: &str, result: &CheckResult) {
|
||||
let symbol = match result.status {
|
||||
CheckStatus::Ok => Theme::success().render("\u{2713}"),
|
||||
CheckStatus::Warning => Theme::warning().render("\u{26a0}"),
|
||||
CheckStatus::Error => Theme::error().render("\u{2717}"),
|
||||
let icon = match result.status {
|
||||
CheckStatus::Ok => Theme::success().render(Icons::success()),
|
||||
CheckStatus::Warning => Theme::warning().render(Icons::warning()),
|
||||
CheckStatus::Error => Theme::error().render(Icons::error()),
|
||||
};
|
||||
|
||||
let message = result.message.as_deref().unwrap_or("");
|
||||
@@ -573,5 +595,5 @@ fn print_check(name: &str, result: &CheckResult) {
|
||||
CheckStatus::Error => Theme::error().render(message),
|
||||
};
|
||||
|
||||
println!(" {symbol} {:<10} {message_styled}", name);
|
||||
println!(" {icon} {:<10} {message_styled}", name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user