feat: update compression status to show enabled state

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-15 17:10:08 -03:00
parent 005937236b
commit 0a5bf38359
2 changed files with 13 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ pub fn generate_status_info(
data_path: PathBuf, data_path: PathBuf,
db_path: PathBuf, db_path: PathBuf,
enabled_meta_plugins: &Vec<MetaPluginType>, enabled_meta_plugins: &Vec<MetaPluginType>,
enabled_compression_type: Option<CompressionType>,
) -> StatusInfo { ) -> StatusInfo {
let path_info = PathInfo { let path_info = PathInfo {
data: data_path.into_os_string().into_string().expect("Unable to convert data path to string"), data: data_path.into_os_string().into_string().expect("Unable to convert data path to string"),
@@ -72,6 +73,7 @@ pub fn generate_status_info(
}; };
let is_default = compression_type == default_type; let is_default = compression_type == default_type;
let is_enabled = enabled_compression_type.as_ref().map_or(false, |ct| *ct == compression_type);
let binary = if compression_program.program.is_empty() { let binary = if compression_program.program.is_empty() {
"<INTERNAL>".to_string() "<INTERNAL>".to_string()
} else { } else {
@@ -81,7 +83,7 @@ pub fn generate_status_info(
compression_info.push(CompressionInfo { compression_info.push(CompressionInfo {
compression_type: compression_type.to_string(), compression_type: compression_type.to_string(),
found: compression_program.supported, found: compression_program.supported,
default: is_default, default: is_enabled, // Changed from is_default to is_enabled
binary, binary,
compress: compression_program.compress.join(" "), compress: compression_program.compress.join(" "),
decompress: compression_program.decompress.join(" "), decompress: compression_program.decompress.join(" "),

View File

@@ -13,6 +13,7 @@ use prettytable::format::consts::FORMAT_NO_BORDER_LINE_SEPARATOR;
use crate::meta_plugin::MetaPluginType; use crate::meta_plugin::MetaPluginType;
use crate::common::status::{generate_status_info, PathInfo, CompressionInfo, MetaPluginInfo}; use crate::common::status::{generate_status_info, PathInfo, CompressionInfo, MetaPluginInfo};
use crate::compression_engine::CompressionType;
fn build_path_table(path_info: &PathInfo) -> Table { fn build_path_table(path_info: &PathInfo) -> Table {
let mut path_table = Table::new(); let mut path_table = Table::new();
@@ -52,7 +53,7 @@ fn build_compression_table(compression_info: &Vec<CompressionInfo>) -> Table {
compression_table.set_titles(row!( compression_table.set_titles(row!(
b->"Type", b->"Type",
b->"Found", b->"Found",
b->"Default", b->"Enabled",
b->"Binary", b->"Binary",
b->"Compress", b->"Compress",
b->"Decompress")); b->"Decompress"));
@@ -142,8 +143,15 @@ pub fn mode_status(
} }
} }
// Determine which compression type would be enabled for a save operation
let enabled_compression_type = if let Some(compression_name) = &settings.compression {
CompressionType::from_str(compression_name).ok()
} else {
Some(crate::compression_engine::default_compression_type())
};
let output_format = crate::modes::common::settings_output_format(settings); let output_format = crate::modes::common::settings_output_format(settings);
let status_info = generate_status_info(data_path, db_path, &meta_plugin_types); let status_info = generate_status_info(data_path, db_path, &meta_plugin_types, enabled_compression_type);
match output_format { match output_format {
OutputFormat::Table => { OutputFormat::Table => {