refactor: Enhance table generation and clean up dependencies

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:29:50 -03:00
parent b4046e0b18
commit 26a8712d82
5 changed files with 31 additions and 79 deletions

View File

@@ -2,7 +2,7 @@ use crate::config;
use crate::services::item_service::ItemService;
use crate::services::types::ItemWithMeta;
use crate::modes::common::ColumnType;
use crate::modes::common::{size_column, string_column, OutputFormat};
use crate::modes::common::{format_size, OutputFormat};
use anyhow::{Result};
use log::debug;
use comfy_table::{Table, ContentArrangement, Cell, Row, Color, Attribute};
@@ -55,11 +55,8 @@ pub fn mode_list(
let mut table = Table::new();
table
.load_preset(NOTHING)
.set_content_arrangement(ContentArrangement::Dynamic);
if !stdout().is_terminal() {
table.force_no_tty();
}
.set_content_arrangement(ContentArrangement::Dynamic)
.force_no_tty_if(!stdout().is_terminal());
// Create header row
let mut header_cells = Vec::new();