refactor: Update comfy-table to 7.2.0 and adapt API changes

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-08 18:02:23 -03:00
parent 15417eb1d3
commit c4a3c54ff3
3 changed files with 18 additions and 14 deletions

View File

@@ -38,7 +38,7 @@ lz4_flex = "0.11.1"
magic = "0.13.0" magic = "0.13.0"
nix = "0.30.1" nix = "0.30.1"
once_cell = "1.19.0" once_cell = "1.19.0"
comfy-table = "0.3.1" comfy-table = "7.2.0"
pwhash = "1.0.0" pwhash = "1.0.0"
regex = "1.9.5" regex = "1.9.5"
ringbuf = "0.3" ringbuf = "0.3"

View File

@@ -12,6 +12,7 @@ use serde_yaml;
use comfy_table::{Table, ContentArrangement, Cell, Color}; use comfy_table::{Table, ContentArrangement, Cell, Color};
use comfy_table::presets::UTF8_FULL; use comfy_table::presets::UTF8_FULL;
use comfy_table::modifiers::UTF8_ROUND_CORNERS; use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::TableComponent;
use crate::common::status::PathInfo; use crate::common::status::PathInfo;
use crate::meta_plugin::MetaPluginType; use crate::meta_plugin::MetaPluginType;
@@ -83,16 +84,18 @@ fn build_meta_plugins_configured_table(status_info: &StatusInfo) -> Option<Table
let mut table = Table::new(); let mut table = Table::new();
if std::io::stdout().is_terminal() { if std::io::stdout().is_terminal() {
table.set_format(*FORMAT_BOX_CHARS); table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else { } else {
table.set_format(*FORMAT_NO_BORDER_LINE_SEPARATOR); table.set_content_arrangement(ContentArrangement::Dynamic);
} }
table.set_titles(Row::new(vec![ table.set_header(vec![
Cell::new("Plugin Name").with_style(Attr::Bold), Cell::new("Plugin Name").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Options").with_style(Attr::Bold), Cell::new("Options").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Outputs").with_style(Attr::Bold), Cell::new("Outputs").add_attribute(comfy_table::Attribute::Bold),
])); ]);
for plugin_config in sorted_meta_plugins { for plugin_config in sorted_meta_plugins {
// Create the plugin to get its default options // Create the plugin to get its default options
@@ -204,11 +207,11 @@ fn build_meta_plugins_configured_table(status_info: &StatusInfo) -> Option<Table
.join("\n") .join("\n")
}; };
table.add_row(Row::new(vec![ table.add_row(vec![
Cell::new(&plugin_config.name), plugin_config.name.clone(),
Cell::new(&options_str), options_str,
Cell::new(&outputs_str), outputs_str,
])); ]);
} }
Some(table) Some(table)

View File

@@ -43,9 +43,10 @@ use crate::modes::common::OutputFormat;
use crate::config; use crate::config;
use serde_json; use serde_json;
use serde_yaml; use serde_yaml;
use comfy_table::{Table, ContentArrangement, Row, Cell, Color}; use comfy_table::{Table, ContentArrangement, Cell, Color};
use comfy_table::presets::UTF8_FULL; use comfy_table::presets::UTF8_FULL;
use comfy_table::modifiers::UTF8_ROUND_CORNERS; use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::TableComponent;
use crate::meta_plugin::{MetaPluginType, get_meta_plugin}; use crate::meta_plugin::{MetaPluginType, get_meta_plugin};
use crate::common::status::{MetaPluginInfo, CompressionInfo}; use crate::common::status::{MetaPluginInfo, CompressionInfo};