Skip to content

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

refactor(list): use + for previous worktree gutter instead of - (#699)

Maximilian Roos5dca9f20f14f
diff --git a/src/commands/list/render.rs b/src/commands/list/render.rs
index 914268b4d..e8168c0b7 100644
--- a/src/commands/list/render.rs
+++ b/src/commands/list/render.rs
@@ -352,15 +352,13 @@ impl ColumnLayout {
ColumnKind::Gutter => {
let mut cell = StyledLine::new();
let symbol = if let Some(data) = worktree_data {
- // Priority: @ (current) > ^ (main) > - (previous) > + (regular)
+ // Priority: @ (current) > ^ (main) > + (regular, including previous)
if data.is_current {
"@ " // Current worktree
} else if data.is_main {
"^ " // Main worktree
- } else if data.is_previous {
- "- " // Previous worktree (wt switch -)
} else {
- "+ " // Regular worktree
+ "+ " // Regular worktree (including previous)
}
} else {
" " // Branch without worktree (two spaces to match width)
diff --git a/tests/integration_tests/list.rs b/tests/integration_tests/list.rs
index 16b1b4854..7956b3a29 100644
--- a/tests/integration_tests/list.rs
+++ b/tests/integration_tests/list.rs
@@ -125,7 +125,8 @@ fn test_list_previous_worktree_gutter(mut repo: TestRepo) {
cmd.args(["switch", "main"]).current_dir(&feature_path);
cmd.output().unwrap();
- // Now list should show `-` for feature (the previous worktree, target of `wt switch -`)
+ // List shows previous worktree with `+` (same as regular worktrees).
+ // The previous worktree is the target of `wt switch -`.
assert_cmd_snapshot!(list_snapshots::command(&repo, repo.root_path()));
}
diff --git a/tests/snapshots/integration__integration_tests__list__list_previous_worktree_gutter.snap b/tests/snapshots/integration__integration_tests__list__list_previous_worktree_gutter.snap
index d28f00d29..28e8077b5 100644
--- a/tests/snapshots/integration__integration_tests__list__list_previous_worktree_gutter.snap
+++ b/tests/snapshots/integration__integration_tests__list__list_previous_worktree_gutter.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stdout -----
Branch Status HEAD± main↕ Path Remote⇅ Commit Age Message
@ main ^| . | 05a4a45d 16h Initial commit
-- feature _ ../repo.feature 05a4a45d 16h Initial commit
++ feature _ ../repo.feature 05a4a45d 16h Initial commit
+ 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