From dfdc21c3cf1fb73a7f6803647af7dd9ceef04f52 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Thu, 22 Jan 2026 21:03:46 +0530 Subject: [PATCH] Use G3Status formatting for /project loading message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed from 'Project loaded: ✓ file1 ✓ file2' to 'g3: loading .. ✓ 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 --- crates/g3-cli/src/commands.rs | 10 +++------- crates/g3-cli/src/g3_status.rs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/crates/g3-cli/src/commands.rs b/crates/g3-cli/src/commands.rs index bbc95e9..ae5ce25 100644 --- a/crates/g3-cli/src/commands.rs +++ b/crates/g3-cli/src/commands.rs @@ -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( 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); diff --git a/crates/g3-cli/src/g3_status.rs b/crates/g3-cli/src/g3_status.rs index 0be9b3a..18cb6a0 100644 --- a/crates/g3-cli/src/g3_status.rs +++ b/crates/g3-cli/src/g3_status.rs @@ -269,6 +269,21 @@ impl G3Status { ); Self::status(&status); } + + /// Print project loading status: "g3: loading .. ✓ 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)]