diff --git a/src/cli/commands/timeline.rs b/src/cli/commands/timeline.rs index 470f274..be46953 100644 --- a/src/cli/commands/timeline.rs +++ b/src/cli/commands/timeline.rs @@ -2,6 +2,7 @@ use console::{Alignment, pad_str, style}; use serde::Serialize; use crate::Config; +use crate::cli::progress::stage_spinner; use crate::core::db::create_connection; use crate::core::error::{LoreError, Result}; use crate::core::paths::get_db_path; @@ -26,6 +27,7 @@ pub struct TimelineParams { pub max_seeds: usize, pub max_entities: usize, pub max_evidence: usize, + pub robot_mode: bool, } /// Run the full timeline pipeline: SEED -> EXPAND -> COLLECT. @@ -60,6 +62,7 @@ pub async fn run_timeline(config: &Config, params: &TimelineParams) -> Result Result Result Result Vec { } fn wrap_snippet(text: &str, width: usize) -> Vec { - let mut lines = Vec::new(); - let mut current = String::new(); - - for word in text.split_whitespace() { - if current.is_empty() { - current = word.to_string(); - } else if current.len() + 1 + word.len() <= width { - current.push(' '); - current.push_str(word); - } else { - lines.push(current); - current = word.to_string(); - } - } - if !current.is_empty() { - lines.push(current); - } - - // Cap at 4 lines + let mut lines = wrap_text(text, width); lines.truncate(4); lines } diff --git a/src/main.rs b/src/main.rs index 51a5783..2c26990 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1784,6 +1784,7 @@ async fn handle_timeline( max_seeds: args.max_seeds, max_entities: args.max_entities, max_evidence: args.max_evidence, + robot_mode, }; let result = run_timeline(&config, ¶ms).await?; @@ -1828,6 +1829,12 @@ async fn handle_search( limit: args.limit, }; + let spinner = lore::cli::progress::stage_spinner( + 1, + 1, + &format!("Searching ({})...", args.mode), + robot_mode, + ); let start = std::time::Instant::now(); let response = run_search( &config, @@ -1839,6 +1846,7 @@ async fn handle_search( ) .await?; let elapsed_ms = start.elapsed().as_millis() as u64; + spinner.finish_and_clear(); if robot_mode { print_search_results_json(&response, elapsed_ms, args.fields.as_deref());