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

@@ -19,13 +19,13 @@ use crate::meta_plugin::get_meta_plugin;
fn build_path_table(path_info: &PathInfo) -> Table {
let mut path_table = Table::new();
if std::io::stdout().is_terminal() {
path_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else {
path_table.set_content_arrangement(ContentArrangement::Dynamic);
path_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS)
.set_content_arrangement(ContentArrangement::Dynamic);
if !std::io::stdout().is_terminal() {
path_table.force_no_tty();
}
path_table.set_header(vec![
@@ -42,12 +42,13 @@ fn build_path_table(path_info: &PathInfo) -> Table {
fn build_config_table(settings: &config::Settings) -> Table {
let mut config_table = Table::new();
if std::io::stdout().is_terminal() {
config_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else {
config_table.set_content_arrangement(ContentArrangement::Dynamic);
config_table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS)
.set_content_arrangement(ContentArrangement::Dynamic);
if !std::io::stdout().is_terminal() {
config_table.force_no_tty();
}
config_table.set_header(vec![
@@ -82,12 +83,13 @@ fn build_meta_plugins_configured_table(status_info: &StatusInfo) -> Option<Table
sorted_meta_plugins.sort_by(|a, b| a.name.cmp(&b.name));
let mut table = Table::new();
if std::io::stdout().is_terminal() {
table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
} else {
table.set_content_arrangement(ContentArrangement::Dynamic);
table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS)
.set_content_arrangement(ContentArrangement::Dynamic);
if !std::io::stdout().is_terminal() {
table.force_no_tty();
}
table.set_header(vec![