Use G3Status formatting for /project loading message
Changed from 'Project loaded: ✓ file1 ✓ file2' to 'g3: loading <project-name> .. ✓ file1 ✓ file2 .. [done]' - Add G3Status::loading_project() for consistent status formatting - Update /project command to use new formatting - Remove unused crossterm imports from commands.rs
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
use anyhow::Result;
|
||||
use rustyline::Editor;
|
||||
use std::path::PathBuf;
|
||||
use crossterm::style::{Color, SetForegroundColor, ResetColor};
|
||||
|
||||
use g3_core::ui_writer::UiWriter;
|
||||
use g3_core::Agent;
|
||||
@@ -369,12 +368,9 @@ pub async fn handle_command<W: UiWriter>(
|
||||
agent.ui_writer().set_project_path(project.path.clone(), project_name);
|
||||
|
||||
// Print loaded status
|
||||
print!(
|
||||
"{}Project loaded:{} {}\n",
|
||||
SetForegroundColor(Color::Green),
|
||||
ResetColor,
|
||||
project.format_loaded_status()
|
||||
);
|
||||
let project_name = project.path.file_name()
|
||||
.and_then(|n| n.to_str()).unwrap_or("project");
|
||||
G3Status::loading_project(project_name, &project.format_loaded_status());
|
||||
|
||||
// Store active project
|
||||
*active_project = Some(project);
|
||||
|
||||
@@ -269,6 +269,21 @@ impl G3Status {
|
||||
);
|
||||
Self::status(&status);
|
||||
}
|
||||
|
||||
/// Print project loading status: "g3: loading <project-name> .. ✓ file1 ✓ file2 .. [done]"
|
||||
///
|
||||
/// Used by the /project command to show what project files were loaded.
|
||||
pub fn loading_project(project_name: &str, loaded_files_status: &str) {
|
||||
print!(
|
||||
"{} loading {}{}{} .. {} ..",
|
||||
Self::format_prefix(),
|
||||
SetForegroundColor(Color::Cyan),
|
||||
project_name,
|
||||
ResetColor,
|
||||
loaded_files_status
|
||||
);
|
||||
Self::done();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user