Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
list: collapse working-tree gate placeholder to one dot (#2181)
Maximilian Roosf1e32a94fec6
diff --git a/src/commands/list/model/status_symbols.rs b/src/commands/list/model/status_symbols.rsindex 872ed69f7..a7030488d 100644--- a/src/commands/list/model/status_symbols.rs+++ b/src/commands/list/model/status_symbols.rs@@ -44,7 +44,10 @@//! **Rule:**//! - `Some(_)` → render the flags it contains. A clean tree leaves all three//! positions blank.-//! - `None` → all three positions render the position-level `·` placeholder.+//! - `None` → the lead position (`STAGED`) renders the `·` placeholder; the+//! other two positions render blank. The gate is one logical decision, so+//! one `·` represents it — matching the visual weight of the+//! single-position gates 2–5.//!//! Branches and prunable worktrees seed `working_tree_status` to a "no//! working tree" sentinel at spawn time, so their positions render blank,@@ -164,7 +167,7 @@//!//! ```text//! +! · ↕ | · ← staged + modified known; worktree state + user marker still loading-//! ··· · ^ | · ← main worktree known from metadata; other gates still loading+//! · · ^ | · ← main worktree known from metadata; other gates still loading//! ^ | 💬 ← everything resolved: main worktree, in sync, user marker//! ```//!@@ -523,7 +526,10 @@ impl StatusSymbols {pub(crate) fn styled_symbols(&self) -> [(usize, SlotState); 7] {use color_print::cformat;- // Gate 1 — working tree flags (positions 0-2). Loading together.+ // Gate 1 — working tree flags (positions 0-2). One logical decision,+ // so while loading we emit a single `·` at the lead position and+ // blank-pad the other two — keeps the gate's visual weight equal to+ // the single-position gates 2-5.let (staged, modified, untracked) = match self.working_tree {Some(wt) => {let flag = |has: bool, sym: char| -> SlotState {@@ -539,7 +545,7 @@ impl StatusSymbols {flag(wt.untracked, '?'),)}- None => (SlotState::Loading, SlotState::Loading, SlotState::Loading),+ None => (SlotState::Loading, SlotState::Empty, SlotState::Empty),};// Gate 3 — main state (position 4).@@ -791,7 +797,7 @@ mod tests {..Default::default()};let rendered = symbols.render_with_mask(&PositionMask::FULL, "·");- assert_snapshot!(rendered, @"[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m↑[22m[2m·[0m[2m·[0m");+ assert_snapshot!(rendered, @"[2m·[0m [2m·[0m[2m↑[22m[2m·[0m[2m·[0m");}#[test]diff --git a/src/commands/list/snapshots/wt__commands__list__layout__tests__snapshot_path_yields_to_summary.snap b/src/commands/list/snapshots/wt__commands__list__layout__tests__snapshot_path_yields_to_summary.snapindex 7a8817b35..b082e3479 100644--- a/src/commands/list/snapshots/wt__commands__list__layout__tests__snapshot_path_yields_to_summary.snap+++ b/src/commands/list/snapshots/wt__commands__list__layout__tests__snapshot_path_yields_to_summary.snap@@ -3,7 +3,7 @@ source: src/commands/list/layout.rsexpression: table---Branch Status HEAD± main↕ main…± Summary Remote⇅ CI Commit Age Message-@ main [2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m | a620bcfe 1y Some comm…-+ hourly-maintenance [2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m ↑2 · · a620bcfe 1y Some comm…-+ lab-continue [2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m ↑1 ↓2 +28 -1 Add extend and block insert in Markdown parser | a620bcfe 1y Some comm…-+ dry-run-pager [2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m[2m·[0m ↑3 ↓1 · | a620bcfe 1y Some comm…+@ main [2m·[0m [2m·[0m[2m·[0m[2m·[0m[2m·[0m | a620bcfe 1y Some comm…++ hourly-maintenance [2m·[0m [2m·[0m[2m·[0m[2m·[0m[2m·[0m ↑2 · · a620bcfe 1y Some comm…++ lab-continue [2m·[0m [2m·[0m[2m·[0m[2m·[0m[2m·[0m ↑1 ↓2 +28 -1 Add extend and block insert in Markdown parser | a620bcfe 1y Some comm…++ dry-run-pager [2m·[0m [2m·[0m[2m·[0m[2m·[0m[2m·[0m ↑3 ↓1 · | a620bcfe 1y Some comm…diff --git a/tests/snapshots/integration__integration_tests__list__list_shows_warning_on_git_error.snap b/tests/snapshots/integration__integration_tests__list__list_shows_warning_on_git_error.snapindex c2653f347..899d2728e 100644--- a/tests/snapshots/integration__integration_tests__list__list_shows_warning_on_git_error.snap+++ b/tests/snapshots/integration__integration_tests__list__list_shows_warning_on_git_error.snap@@ -46,7 +46,7 @@ exit_code: 0+ feature-a [2m↑[22m [32m↑1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file+ feature-b [2m↑[22m [32m↑1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file+ feature-c [2m↑[22m [32m↑1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file-+ feature [2m·[0m[2m·[0m[2m·[0m[2m·[0m [2m·[0m [2m·[0m ../repo.feature [2m·[0m [2m·++ feature [2m·[0m [2m·[0m [2m·[0m [2m·[0m ../repo.feature [2m·[0m [2m·[2m○[22m [2mShowing 5 worktrees, 3 ahead. 2 tasks failed