)}
+ {/* Branch / folder badge — unchanged from the original logic so we
+ never lose the branch name, even when the main worktree is checked
+ out on a non-primary branch like "feature-x". */}
{isFolder ? (
) : isPrimaryBranch(worktree.branch) ? (
-
- main
-
+ worktree.isMainWorktree ? (
+
+
+
+ main
+
+
+
+ Main worktree
+
+
+ ) : (
+
+ main
+
+ )
) : (
{branch}
)}
+ {/* Why: the main worktree (the original clone directory) cannot be
+ deleted via `git worktree remove`. Surfacing this in the card lets
+ users identify it at a glance. When the branch is already primary,
+ the blue "main" badge above does double duty; otherwise we add a
+ separate blue badge so both the branch and worktree type are visible. */}
+ {worktree.isMainWorktree && !isFolder && !isPrimaryBranch(worktree.branch) && (
+
+
+
+ main
+
+
+
+ Main worktree
+
+
+ )}
+
{/* Why: the conflict operation (merge/rebase/cherry-pick) is the
only signal that the worktree is in an incomplete operation state.
Showing it on the card lets the user spot worktrees that need
diff --git a/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx b/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
index 2a9ddee0382..c1b8869890b 100644
--- a/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
+++ b/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
@@ -176,7 +176,20 @@ const WorktreeContextMenu = React.memo(function WorktreeContextMenu({ worktree,
Shutdown
-
+ {/* Why: `git worktree remove` always rejects the main worktree, so we
+ disable the item upfront. Radix forwards unknown props to the DOM
+ element, so `title` works directly without a wrapper span — this
+ preserves Radix's flat roving-tabindex keyboard navigation. */}
+
{isDeleting ? 'Deleting…' : isFolder ? 'Remove Folder from Orca' : 'Delete'}