use crate::error::{HindsightError, Result};
use crate::parser::parse_session;
use crate::storage::SessionIndex;
use crate::tui::{run as run_tui, App};
pub fn run(session_id: String, dashboard: bool, _port: u16) -> Result<()> {
if dashboard {
println!(" Web dashboard not yet implemented");
println!(" Use without --dashboard flag to view in terminal\n");
return Ok(());
}
let index = SessionIndex::new()?;
let session_file = index
.find_by_id(&session_id)?
.ok_or_else(|| HindsightError::SessionNotFound(session_id.clone()))?;
let session = parse_session(&session_file.path)?;
let mut app = App::new(session);
run_tui(&mut app)?;
Ok(())
}