Skip to content

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.rs
index 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, @"····↑··");
+ assert_snapshot!(rendered, @"· ·↑··");
}
#[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.snap
index 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.rs
expression: table
---
Branch Status HEAD± main↕ main…± Summary Remote⇅ CI Commit Age Message
-@ main ······· | a620bcfe 1y Some comm…
-+ hourly-maintenance ······· ↑2 · · a620bcfe 1y Some comm…
-+ lab-continue ······· ↑1 ↓2 +28 -1 Add extend and block insert in Markdown parser | a620bcfe 1y Some comm…
-+ dry-run-pager ······· ↑3 ↓1 · | a620bcfe 1y Some comm…
+@ main · ···· | a620bcfe 1y Some comm…
++ hourly-maintenance · ···· ↑2 · · a620bcfe 1y Some comm…
++ lab-continue · ···· ↑1 ↓2 +28 -1 Add extend and block insert in Markdown parser | a620bcfe 1y Some comm…
++ dry-run-pager · ···· ↑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.snap
index 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 ↑ ↑1 ../repo.feature-a 1b87d473 16h Add feature-a file
+ feature-b ↑ ↑1 ../repo.feature-b f62940fc 16h Add feature-b file
+ feature-c ↑ ↑1 ../repo.feature-c 345c7c93 16h Add feature-c file
-+ feature ···· · · ../repo.feature · ·
++ feature · · · · ../repo.feature · ·
○ Showing 5 worktrees, 3 ahead. 2 tasks failed