refactor: Improve comfy_table usage and consistency

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:19:10 -03:00
parent fb19499383
commit bf257b5ff3
4 changed files with 56 additions and 49 deletions

View File

@@ -53,12 +53,13 @@ use crate::common::status::{MetaPluginInfo, CompressionInfo};
fn build_meta_plugin_table(meta_plugin_info: &std::collections::HashMap<String, MetaPluginInfo>) -> Table {
let mut meta_plugin_table = Table::new();
if std::io::stdout().is_terminal() {
meta_plugin_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else {
meta_plugin_table.set_content_arrangement(ContentArrangement::Dynamic);
meta_plugin_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS)
.set_content_arrangement(ContentArrangement::Dynamic);
if !std::io::stdout().is_terminal() {
meta_plugin_table.force_no_tty();
}
meta_plugin_table.set_header(vec![
@@ -121,12 +122,13 @@ fn build_meta_plugin_table(meta_plugin_info: &std::collections::HashMap<String,
fn build_compression_table(compression_info: &Vec<CompressionInfo>) -> Table {
let mut compression_table = Table::new();
if std::io::stdout().is_terminal() {
compression_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else {
compression_table.set_content_arrangement(ContentArrangement::Dynamic);
compression_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS)
.set_content_arrangement(ContentArrangement::Dynamic);
if !std::io::stdout().is_terminal() {
compression_table.force_no_tty();
}
compression_table.set_header(vec![
@@ -160,12 +162,13 @@ fn build_compression_table(compression_info: &Vec<CompressionInfo>) -> Table {
fn build_filter_plugin_table(filter_plugins: &Vec<crate::common::status::FilterPluginInfo>) -> Table {
let mut filter_plugin_table = Table::new();
if std::io::stdout().is_terminal() {
filter_plugin_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else {
filter_plugin_table.set_content_arrangement(ContentArrangement::Dynamic);
filter_plugin_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS)
.set_content_arrangement(ContentArrangement::Dynamic);
if !std::io::stdout().is_terminal() {
filter_plugin_table.force_no_tty();
}
filter_plugin_table.set_header(vec![