refactor: Unify table styling with comfy-table in status and list modes

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:07:58 -03:00
parent cba4566cdd
commit d7f4724f26
3 changed files with 36 additions and 32 deletions

View File

@@ -9,10 +9,9 @@ use crate::config;
use crate::common::status::StatusInfo;
use serde_json;
use serde_yaml;
use comfy_table::{Table, ContentArrangement, Cell, Color};
use comfy_table::{Table, ContentArrangement, Cell, Color, Attribute};
use comfy_table::presets::UTF8_FULL;
use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::TableComponent;
use crate::common::status::PathInfo;
use crate::meta_plugin::MetaPluginType;
@@ -30,8 +29,8 @@ fn build_path_table(path_info: &PathInfo) -> Table {
}
path_table.set_header(vec![
Cell::new("Type").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Path").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Type").add_attribute(Attribute::Bold),
Cell::new("Path").add_attribute(Attribute::Bold),
]);
path_table.add_row(vec!["Data", &path_info.data]);
@@ -52,8 +51,8 @@ fn build_config_table(settings: &config::Settings) -> Table {
}
config_table.set_header(vec![
Cell::new("Setting").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Value").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Setting").add_attribute(Attribute::Bold),
Cell::new("Value").add_attribute(Attribute::Bold),
]);
// Add relevant configuration settings
@@ -92,9 +91,9 @@ fn build_meta_plugins_configured_table(status_info: &StatusInfo) -> Option<Table
}
table.set_header(vec![
Cell::new("Plugin Name").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Options").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Outputs").add_attribute(comfy_table::Attribute::Bold),
Cell::new("Plugin Name").add_attribute(Attribute::Bold),
Cell::new("Options").add_attribute(Attribute::Bold),
Cell::new("Outputs").add_attribute(Attribute::Bold),
]);
for plugin_config in sorted_meta_plugins {