Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Refactor: Simplify layout config and improve responsive table rendering

Maximilian Roosc0c4d48e39bd
diff --git a/src/commands/list/layout.rs b/src/commands/list/layout.rs
index 0bd893452..961453b37 100644
--- a/src/commands/list/layout.rs
+++ b/src/commands/list/layout.rs
@@ -37,7 +37,6 @@ pub struct ColumnWidths {
pub struct LayoutConfig {
pub widths: ColumnWidths,
- pub ideal_widths: ColumnWidths, // Maximum widths for padding sparse columns
pub common_prefix: PathBuf,
pub max_message_len: usize,
}
@@ -182,21 +181,29 @@ pub fn calculate_responsive_layout(items: &[ListItem]) -> LayoutConfig {
// Calculate ideal column widths
let ideal_widths = calculate_column_widths(items);
+ // Calculate actual maximum path width (after common prefix removal)
+ let max_path_width = items
+ .iter()
+ .filter_map(|item| item.worktree_info())
+ .map(|info| {
+ use crate::display::shorten_path;
+ use unicode_width::UnicodeWidthStr;
+ shorten_path(&info.worktree.path, &common_prefix).width()
+ })
+ .max()
+ .unwrap_or(20); // fallback to 20 if no paths
+
// Essential columns (always shown):
- // - current indicator: 2 chars
// - branch: variable
// - short HEAD: 8 chars
- // - path: at least 20 chars (we'll use shortened paths)
+ // - path: variable (calculated above)
// - spacing: 2 chars between columns
let spacing = 2;
- let current_indicator = 2;
let short_head = 8;
- let min_path = 20;
// Calculate base width needed
- let base_width =
- current_indicator + ideal_widths.branch + spacing + short_head + spacing + min_path;
+ let base_width = ideal_widths.branch + spacing + short_head + spacing + max_path_width;
// Available width for optional columns
let available = terminal_width.saturating_sub(base_width);
@@ -272,7 +279,6 @@ pub fn calculate_responsive_layout(items: &[ListItem]) -> LayoutConfig {
LayoutConfig {
widths,
- ideal_widths,
common_prefix,
max_message_len,
}
diff --git a/src/commands/list/render.rs b/src/commands/list/render.rs
index 8ae1498ea..9bcccbaef 100644
--- a/src/commands/list/render.rs
+++ b/src/commands/list/render.rs
@@ -58,41 +58,29 @@ pub fn format_header_line(layout: &LayoutConfig) {
}
// Ahead/behind (commits)
- if layout.ideal_widths.ahead_behind > 0 {
- let header = format!(
- "{:width$}",
- "Cmts",
- width = layout.ideal_widths.ahead_behind
- );
+ if widths.ahead_behind > 0 {
+ let header = format!("{:width$}", "Cmts", width = widths.ahead_behind);
line.push_styled(header, dim);
line.push_raw(" ");
}
// Branch diff (line diff in commits)
- if layout.ideal_widths.branch_diff > 0 {
- let header = format!(
- "{:width$}",
- "Cmt +/-",
- width = layout.ideal_widths.branch_diff
- );
+ if widths.branch_diff > 0 {
+ let header = format!("{:width$}", "Cmt +/-", width = widths.branch_diff);
line.push_styled(header, dim);
line.push_raw(" ");
}
// Working tree diff
- if layout.ideal_widths.working_diff > 0 {
- let header = format!(
- "{:width$}",
- "WT +/-",
- width = layout.ideal_widths.working_diff
- );
+ if widths.working_diff > 0 {
+ let header = format!("{:width$}", "WT +/-", width = widths.working_diff);
line.push_styled(header, dim);
line.push_raw(" ");
}
// Upstream
- if layout.ideal_widths.upstream > 0 {
- let header = format!("{:width$}", "Remote", width = layout.ideal_widths.upstream);
+ if widths.upstream > 0 {
+ let header = format!("{:width$}", "Remote", width = widths.upstream);
line.push_styled(header, dim);
line.push_raw(" ");
}
@@ -109,8 +97,8 @@ pub fn format_header_line(layout: &LayoutConfig) {
}
// States
- if layout.ideal_widths.states > 0 {
- let header = format!("{:width$}", "State", width = layout.ideal_widths.states);
+ if widths.states > 0 {
+ let header = format!("{:width$}", "State", width = widths.states);
line.push_styled(header, dim);
line.push_raw(" ");
}
@@ -181,22 +169,22 @@ fn format_item_line(
}
// Ahead/behind (commits difference)
- if layout.ideal_widths.ahead_behind > 0 {
+ if widths.ahead_behind > 0 {
if !item.is_primary() && (item.ahead() > 0 || item.behind() > 0) {
let ahead_behind_text = format!(
"{:width$}",
format!("↑{} ↓{}", item.ahead(), item.behind()),
- width = layout.ideal_widths.ahead_behind
+ width = widths.ahead_behind
);
line.push_styled(ahead_behind_text, yellow);
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.ahead_behind));
+ line.push_raw(" ".repeat(widths.ahead_behind));
}
line.push_raw(" ");
}
// Branch diff (line diff in commits)
- if layout.ideal_widths.branch_diff > 0 {
+ if widths.branch_diff > 0 {
if !item.is_primary() {
let (br_added, br_deleted) = item.branch_diff();
if br_added > 0 || br_deleted > 0 {
@@ -204,42 +192,42 @@ fn format_item_line(
diff_segment.push_styled(format!("+{}", br_added), green);
diff_segment.push_raw(" ");
diff_segment.push_styled(format!("-{}", br_deleted), red);
- diff_segment.pad_to(layout.ideal_widths.branch_diff);
+ diff_segment.pad_to(widths.branch_diff);
for segment in diff_segment.segments {
line.push(segment);
}
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.branch_diff));
+ line.push_raw(" ".repeat(widths.branch_diff));
}
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.branch_diff));
+ line.push_raw(" ".repeat(widths.branch_diff));
}
line.push_raw(" ");
}
// Working tree diff (worktrees only)
- if layout.ideal_widths.working_diff > 0 {
+ if widths.working_diff > 0 {
if let Some((wt_added, wt_deleted)) = item.working_tree_diff() {
if wt_added > 0 || wt_deleted > 0 {
let mut diff_segment = StyledLine::new();
diff_segment.push_styled(format!("+{}", wt_added), green);
diff_segment.push_raw(" ");
diff_segment.push_styled(format!("-{}", wt_deleted), red);
- diff_segment.pad_to(layout.ideal_widths.working_diff);
+ diff_segment.pad_to(widths.working_diff);
for segment in diff_segment.segments {
line.push(segment);
}
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.working_diff));
+ line.push_raw(" ".repeat(widths.working_diff));
}
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.working_diff));
+ line.push_raw(" ".repeat(widths.working_diff));
}
line.push_raw(" ");
}
// Upstream tracking
- if layout.ideal_widths.upstream > 0 {
+ if widths.upstream > 0 {
if let Some((remote_name, upstream_ahead, upstream_behind)) = item.upstream_info() {
let mut upstream_segment = StyledLine::new();
upstream_segment.push_styled(remote_name, dim);
@@ -247,12 +235,12 @@ fn format_item_line(
upstream_segment.push_styled(format!("↑{}", upstream_ahead), green);
upstream_segment.push_raw(" ");
upstream_segment.push_styled(format!("↓{}", upstream_behind), red);
- upstream_segment.pad_to(layout.ideal_widths.upstream);
+ upstream_segment.pad_to(widths.upstream);
for segment in upstream_segment.segments {
line.push(segment);
}
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.upstream));
+ line.push_raw(" ".repeat(widths.upstream));
}
line.push_raw(" ");
}
@@ -277,17 +265,17 @@ fn format_item_line(
}
// States (worktrees only)
- if layout.ideal_widths.states > 0 {
+ if widths.states > 0 {
if let Some(worktree_info) = item.worktree_info() {
let states = format_all_states(worktree_info);
if !states.is_empty() {
- let states_text = format!("{:width$}", states, width = layout.ideal_widths.states);
+ let states_text = format!("{:width$}", states, width = widths.states);
line.push_raw(states_text);
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.states));
+ line.push_raw(" ".repeat(widths.states));
}
} else {
- line.push_raw(" ".repeat(layout.ideal_widths.states));
+ line.push_raw(" ".repeat(widths.states));
}
line.push_raw(" ");
}
@@ -351,16 +339,6 @@ mod tests {
upstream: 12,
states: 18,
},
- ideal_widths: ColumnWidths {
- branch: 11,
- time: 13,
- message: 12,
- ahead_behind: 5,
- working_diff: 8,
- branch_diff: 8,
- upstream: 12,
- states: 18,
- },
common_prefix: PathBuf::from("/test"),
max_message_len: 12,
};
@@ -374,25 +352,25 @@ mod tests {
header.push_raw(format!(
"{:width$}",
"Cmts",
- width = layout.ideal_widths.ahead_behind
+ width = layout.widths.ahead_behind
));
header.push_raw(" ");
header.push_raw(format!(
"{:width$}",
"Cmt +/-",
- width = layout.ideal_widths.branch_diff
+ width = layout.widths.branch_diff
));
header.push_raw(" ");
header.push_raw(format!(
"{:width$}",
"WT +/-",
- width = layout.ideal_widths.working_diff
+ width = layout.widths.working_diff
));
header.push_raw(" ");
header.push_raw(format!(
"{:width$}",
"Remote",
- width = layout.ideal_widths.upstream
+ width = layout.widths.upstream
));
header.push_raw(" ");
header.push_raw("Commit ");
@@ -403,11 +381,7 @@ mod tests {
width = layout.widths.message
));
header.push_raw(" ");
- header.push_raw(format!(
- "{:width$}",
- "State",
- width = layout.ideal_widths.states
- ));
+ header.push_raw(format!("{:width$}", "State", width = layout.widths.states));
header.push_raw(" ");
header.push_raw("Path");
@@ -426,17 +400,13 @@ mod tests {
));
data.push_raw(" ");
// Ahead/behind
- let ahead_behind_text = format!(
- "{:width$}",
- "↑3 ↓2",
- width = layout.ideal_widths.ahead_behind
- );
+ let ahead_behind_text = format!("{:width$}", "↑3 ↓2", width = layout.widths.ahead_behind);
data.push_raw(ahead_behind_text);
data.push_raw(" ");
// Branch diff
let mut branch_diff_segment = StyledLine::new();
branch_diff_segment.push_raw("+200 -30");
- branch_diff_segment.pad_to(layout.ideal_widths.branch_diff);
+ branch_diff_segment.pad_to(layout.widths.branch_diff);
for seg in branch_diff_segment.segments {
data.push(seg);
}
@@ -444,7 +414,7 @@ mod tests {
// Working diff
let mut working_diff_segment = StyledLine::new();
working_diff_segment.push_raw("+100 -50");
- working_diff_segment.pad_to(layout.ideal_widths.working_diff);
+ working_diff_segment.pad_to(layout.widths.working_diff);
for seg in working_diff_segment.segments {
data.push(seg);
}
@@ -452,7 +422,7 @@ mod tests {
// Upstream
let mut upstream_segment = StyledLine::new();
upstream_segment.push_raw("origin ↑4 ↓0");
- upstream_segment.pad_to(layout.ideal_widths.upstream);
+ upstream_segment.pad_to(layout.widths.upstream);
for seg in upstream_segment.segments {
data.push(seg);
}
@@ -469,11 +439,7 @@ mod tests {
data.push_raw(" ");
// State
let states = format_all_states(&info);
- data.push_raw(format!(
- "{:width$}",
- states,
- width = layout.ideal_widths.states
- ));
+ data.push_raw(format!("{:width$}", states, width = layout.widths.states));
data.push_raw(" ");
// Path
data.push_raw(shorten_path(&info.worktree.path, &layout.common_prefix));
diff --git a/src/display.rs b/src/display.rs
index 1450f8eea..4040cc689 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -112,6 +112,14 @@ pub fn truncate_at_word_boundary(text: &str, max_width: usize) -> String {
/// Get terminal width, defaulting to 80 if detection fails
pub fn get_terminal_width() -> usize {
+ // Check COLUMNS environment variable first (for testing and scripts)
+ if let Ok(cols) = std::env::var("COLUMNS")
+ && let Ok(width) = cols.parse::<usize>()
+ {
+ return width;
+ }
+
+ // Fall back to actual terminal size
terminal_size::terminal_size()
.map(|(terminal_size::Width(w), _)| w as usize)
.unwrap_or(80)
diff --git a/tests/integration_tests/spacing_edge_cases.rs b/tests/integration_tests/spacing_edge_cases.rs
index d06ce9ea0..d37dca8a5 100644
--- a/tests/integration_tests/spacing_edge_cases.rs
+++ b/tests/integration_tests/spacing_edge_cases.rs
@@ -90,3 +90,64 @@ fn test_mixed_length_branch_names() {
snapshot_list("mixed_length_branch_names", &repo);
}
+
+/// Helper for testing with specific terminal width
+fn snapshot_list_with_width(test_name: &str, repo: &TestRepo, width: usize) {
+ let mut settings = Settings::clone_current();
+ settings.set_snapshot_path("../snapshots");
+
+ // Normalize paths
+ settings.add_filter(repo.root_path().to_str().unwrap(), "[REPO]");
+ for (name, path) in &repo.worktrees {
+ settings.add_filter(
+ path.to_str().unwrap(),
+ format!("[WORKTREE_{}]", name.to_uppercase().replace('-', "_")),
+ );
+ }
+
+ // Normalize git SHAs
+ settings.add_filter(r"\b[0-9a-f]{7,40}\b", "[SHA] ");
+ settings.add_filter(r"\\", "/");
+
+ settings.bind(|| {
+ let mut cmd = Command::new(get_cargo_bin("wt"));
+ repo.clean_cli_env(&mut cmd);
+ cmd.arg("list")
+ .current_dir(repo.root_path())
+ .env("COLUMNS", width.to_string());
+ assert_cmd_snapshot!(test_name, cmd);
+ });
+}
+
+#[test]
+fn test_terminal_width_80_drops_message() {
+ let mut repo = TestRepo::new();
+ repo.commit("Initial commit with a reasonably long message");
+
+ repo.add_worktree("feature-a", "feature-a");
+ repo.add_worktree("feature-b", "feature-b");
+
+ snapshot_list_with_width("terminal_width_80", &repo, 80);
+}
+
+#[test]
+fn test_terminal_width_120_shows_message() {
+ let mut repo = TestRepo::new();
+ repo.commit("Initial commit with a reasonably long message");
+
+ repo.add_worktree("feature-a", "feature-a");
+ repo.add_worktree("feature-b", "feature-b");
+
+ snapshot_list_with_width("terminal_width_120", &repo, 120);
+}
+
+#[test]
+fn test_terminal_width_150_shows_all_columns() {
+ let mut repo = TestRepo::new();
+ repo.commit("Initial commit with a reasonably long message");
+
+ repo.add_worktree("feature-a", "feature-a");
+ repo.add_worktree("feature-b", "feature-b");
+
+ snapshot_list_with_width("terminal_width_150", &repo, 150);
+}
diff --git a/tests/snapshots/integration__integration_tests__list__detached_head.snap b/tests/snapshots/integration__integration_tests__list__detached_head.snap
index 8de1fdc67..5fb4bcd17 100644
--- a/tests/snapshots/integration__integration_tests__list__detached_head.snap
+++ b/tests/snapshots/integration__integration_tests__list__detached_head.snap
@@ -18,7 +18,7 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-(detached) 9 months ago b834638e Initial commit .
+Branch  Age  Commit  Message  Path
+(detached) 9 months ago b834638e Initial commit .
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
index 3065e4f0e..ae611efc5 100644
--- a/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
+++ b/tests/snapshots/integration__integration_tests__list__locked_no_reason.snap
@@ -18,8 +18,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State  Path
-main  9 months ago b834638e ./main
-locked-no-reason 9 months ago b834638e (locked) ./locked-no-reason
+Branch  Age  Commit  Path
+main  9 months ago b834638e ./main
+locked-no-reason 9 months ago b834638e ./locked-no-reason
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
index 89cf95fa2..1b12f6261 100644
--- a/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__list__locked_worktree.snap
@@ -18,8 +18,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State  Path
-main  9 months ago b834638e ./main
-locked-feature 9 months ago b834638e (locked: Testing lock functionality) ./locked-feature
+Branch  Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit ./main
+locked-feature 9 months ago b834638e Initial commit ./locked-feature
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__long_branch_name.snap b/tests/snapshots/integration__integration_tests__list__long_branch_name.snap
index 46679da8c..15533a293 100644
--- a/tests/snapshots/integration__integration_tests__list__long_branch_name.snap
+++ b/tests/snapshots/integration__integration_tests__list__long_branch_name.snap
@@ -18,8 +18,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Cmts Cmt +/- WT +/- Remote Commit  State Path
-main  b834638e ./main
-feature-this-is-a-very-long-branch-name-that-should-test-column-alignment b834638e ./feature-this-is-a-very-long-branch-name-that-should-test-column-alignment
+Branch  Commit  Path
+main  b834638e ./main
+feature-this-is-a-very-long-branch-name-that-should-test-column-alignment b834638e ./feature-this-is-a-very-long-branch-name-that-should-test-column-alignment
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
index 847bc3096..e91898447 100644
--- a/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
+++ b/tests/snapshots/integration__integration_tests__list__long_commit_message.snap
@@ -18,8 +18,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts  Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago 1310bfb9 Short message  ./main
-feature-a 9 months ago ↑0 ↓1 f078644e This is a very...  ./feature-a
+Branch  Age  Commit  Message  Path
+main  9 months ago 1310bfb9 Short message  ./main
+feature-a 9 months ago f078644e This is a very long commit...  ./feature-a
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
index 0d1cd2e52..c8514c84b 100644
--- a/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
+++ b/tests/snapshots/integration__integration_tests__list__many_worktrees_varied.snap
@@ -18,11 +18,11 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State Path
-main  9 months ago b834638e ./main
-medium-name 9 months ago b834638e ./medium-name
-short 9 months ago b834638e ./short
-very-long-branch-name-here 9 months ago b834638e ./very-long-branch-name-here
-with-changes 9 months ago b834638e ./with-changes
+Branch  Age  Commit  Path
+main  9 months ago b834638e ./main
+medium-name 9 months ago b834638e ./medium-name
+short 9 months ago b834638e ./short
+very-long-branch-name-here 9 months ago b834638e ./very-long-branch-name-here
+with-changes 9 months ago b834638e ./with-changes
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
index 1044d5c27..649bde73f 100644
--- a/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
+++ b/tests/snapshots/integration__integration_tests__list__multiple_worktrees.snap
@@ -18,9 +18,9 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago b834638e Initial commit ./main
-feature-a 9 months ago b834638e Initial commit ./feature-a
-feature-b 9 months ago b834638e Initial commit ./feature-b
+Branch  Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit ./main
+feature-a 9 months ago b834638e Initial commit ./feature-a
+feature-b 9 months ago b834638e Initial commit ./feature-b
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__single_worktree.snap b/tests/snapshots/integration__integration_tests__list__single_worktree.snap
index 9a9a98d40..a53645f1c 100644
--- a/tests/snapshots/integration__integration_tests__list__single_worktree.snap
+++ b/tests/snapshots/integration__integration_tests__list__single_worktree.snap
@@ -18,7 +18,7 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago b834638e Initial commit .
+Branch Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit .
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__unicode_branch_name.snap b/tests/snapshots/integration__integration_tests__list__unicode_branch_name.snap
index b7816ff99..5789ea12e 100644
--- a/tests/snapshots/integration__integration_tests__list__unicode_branch_name.snap
+++ b/tests/snapshots/integration__integration_tests__list__unicode_branch_name.snap
@@ -18,9 +18,9 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State Path
-main  9 months ago b834638e ./main
-feature-日本語-test 9 months ago b834638e ./feature-日本語-test
-fix-émoji-🎉 9 months ago b834638e ./fix-émoji-🎉
+Branch  Age  Commit  Path
+main  9 months ago b834638e ./main
+feature-日本語-test 9 months ago b834638e ./feature-日本語-test
+fix-émoji-🎉 9 months ago b834638e ./fix-émoji-🎉
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
index 7b1379fda..e38b03584 100644
--- a/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
+++ b/tests/snapshots/integration__integration_tests__list__unicode_commit_message.snap
@@ -18,8 +18,8 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts  Cmt +/- WT +/- Remote Commit  State Path
-main  9 months ago e4614cb7 ./main
-feature-test 9 months ago ↑0 ↓1 0c53695b ./feature-test
+Branch  Age  Commit  Message  Path
+main  9 months ago e4614cb7 Fix bug with...  ./main
+feature-test 9 months ago 0c53695b Add support for...  ./feature-test
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
index f1b721cce..3e3014d4a 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag.snap
@@ -19,11 +19,11 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State Path
-main  9 months ago b834638e ./main
-feature-with-worktree 9 months ago b834638e ./feature-with-worktree
-another-branch 9 months ago b834638e
-feature-without-worktree 9 months ago b834638e
-fix-bug 9 months ago b834638e
+Branch  Age  Commit  Path
+main  9 months ago b834638e ./main
+feature-with-worktree 9 months ago b834638e ./feature-with-worktree
+another-branch 9 months ago b834638e
+feature-without-worktree 9 months ago b834638e
+fix-bug 9 months ago b834638e
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
index 65efe3250..12ee13ad5 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag_none_available.snap
@@ -19,9 +19,9 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago b834638e Initial commit ./main
-feature-a 9 months ago b834638e Initial commit ./feature-a
-feature-b 9 months ago b834638e Initial commit ./feature-b
+Branch  Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit ./main
+feature-a 9 months ago b834638e Initial commit ./feature-a
+feature-b 9 months ago b834638e Initial commit ./feature-b
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap b/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap
index 3b577bd04..548281952 100644
--- a/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap
+++ b/tests/snapshots/integration__integration_tests__list__with_branches_flag_only_branches.snap
@@ -19,10 +19,10 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State Path
-main  9 months ago b834638e .
-branch-alpha 9 months ago b834638e
-branch-beta 9 months ago b834638e
-branch-gamma 9 months ago b834638e
+Branch  Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit .
+branch-alpha 9 months ago b834638e Initial commit
+branch-beta 9 months ago b834638e Initial commit
+branch-gamma 9 months ago b834638e Initial commit
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
index 1e41026a1..1d9557c96 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
@@ -18,10 +18,10 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch  Age  Cmts Cmt +/- WT +/- Remote Commit  State Path
-main  9 months ago b834638e ./main
-another-extremely-long-name-here 9 months ago b834638e ./another-extremely-long-name-here
-short 9 months ago b834638e ./short
-very-long-feature-branch-name 9 months ago b834638e ./very-long-feature-branch-name
+Branch  Commit  Path
+main  b834638e ./main
+another-extremely-long-name-here b834638e ./another-extremely-long-name-here
+short b834638e ./short
+very-long-feature-branch-name b834638e ./very-long-feature-branch-name
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
index 2ed349526..c21907bbd 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
@@ -18,10 +18,10 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago b834638e Initial commit ./main
-long 9 months ago b834638e Initial commit ./extremely-long-branch-name-that-might-cause-layout-issues
-medium 9 months ago b834638e Initial commit ./medium-length-name
-x 9 months ago b834638e Initial commit ./x
+Branch Commit  Path
+main  b834638e ./main
+long b834638e ./extremely-long-branch-name-that-might-cause-layout-issues
+medium b834638e ./medium-length-name
+x b834638e ./x
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
index 473448070..d21c76e6d 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__short_branch_names.snap
@@ -18,10 +18,10 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago b834638e Initial commit ./main
-a 9 months ago b834638e Initial commit ./a
-bb 9 months ago b834638e Initial commit ./bb
-ccc 9 months ago b834638e Initial commit ./ccc
+Branch Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit ./main
+a 9 months ago b834638e Initial commit ./a
+bb 9 months ago b834638e Initial commit ./bb
+ccc 9 months ago b834638e Initial commit ./ccc
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
new file mode 100644
index 000000000..e977c5365
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_120.snap
@@ -0,0 +1,27 @@
+---
+source: tests/integration_tests/spacing_edge_cases.rs
+info:
+ program: wt
+ args:
+ - list
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "120"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: true
+exit_code: 0
+----- stdout -----
+Branch  Age  Commit  Message  Path
+main  9 months ago a7bc47ca Initial commit with a reasonably long message ./main
+feature-a 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-a
+feature-b 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-b
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
new file mode 100644
index 000000000..e49c32e7c
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_150.snap
@@ -0,0 +1,27 @@
+---
+source: tests/integration_tests/spacing_edge_cases.rs
+info:
+ program: wt
+ args:
+ - list
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: true
+exit_code: 0
+----- stdout -----
+Branch  Age  Commit  Message  Path
+main  9 months ago a7bc47ca Initial commit with a reasonably long message ./main
+feature-a 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-a
+feature-b 9 months ago a7bc47ca Initial commit with a reasonably long message ./feature-b
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
new file mode 100644
index 000000000..d68e086a2
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__terminal_width_80.snap
@@ -0,0 +1,27 @@
+---
+source: tests/integration_tests/spacing_edge_cases.rs
+info:
+ program: wt
+ args:
+ - list
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "80"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1704067200"
+---
+success: true
+exit_code: 0
+----- stdout -----
+Branch  Age  Commit  Message  Path
+main  9 months ago a7bc47ca Initial commit with a...  ./main
+feature-a 9 months ago a7bc47ca Initial commit with a...  ./feature-a
+feature-b 9 months ago a7bc47ca Initial commit with a...  ./feature-b
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
index 87ec4f539..41e8bc1d7 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap
@@ -18,10 +18,10 @@ info:
success: true
exit_code: 0
----- stdout -----
-Branch Age  Cmts Cmt +/- WT +/- Remote Commit  Message  State Path
-main  9 months ago b834638e Initial commit ./main
-cafe 9 months ago b834638e Initial commit ./café
-naive 9 months ago b834638e Initial commit ./naïve
-resume 9 months ago b834638e Initial commit ./résumé
+Branch Age  Commit  Message  Path
+main  9 months ago b834638e Initial commit ./main
+cafe 9 months ago b834638e Initial commit ./café
+naive 9 months ago b834638e Initial commit ./naïve
+resume 9 months ago b834638e Initial commit ./résumé
----- stderr -----