remove duplicate commands in dropdowns

This commit is contained in:
Cody Seibert
2025-12-16 02:27:19 -05:00
parent 8c5759d74e
commit b95c54a539
2 changed files with 6 additions and 35 deletions

View File

@@ -337,15 +337,6 @@ export function WorktreeSelector({
)}
</DropdownMenuItem>
<DropdownMenuSeparator />
{worktree.hasChanges && (
<DropdownMenuItem
onClick={() => onCommit(worktree)}
className="text-xs"
>
<GitCommit className="w-3.5 h-3.5 mr-2" />
Commit Changes ({worktree.changedFilesCount} file{worktree.changedFilesCount !== 1 ? "s" : ""})
</DropdownMenuItem>
)}
<DropdownMenuItem
onClick={() => onCreateBranch(worktree)}
className="text-xs"
@@ -392,37 +383,16 @@ export function WorktreeSelector({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="w-48">
{/* Pull latest changes */}
<DropdownMenuItem
onClick={() => handlePull(worktree)}
disabled={isPulling}
className="text-xs"
>
<Download className={cn("w-3.5 h-3.5 mr-2", isPulling && "animate-pulse")} />
{isPulling ? "Pulling..." : "Pull Latest"}
</DropdownMenuItem>
{/* Create new branch - only for main repo */}
{worktree.isMain && (
{/* Commit changes */}
{worktree.hasChanges && (
<DropdownMenuItem
onClick={() => onCreateBranch(worktree)}
onClick={() => onCommit(worktree)}
className="text-xs"
>
<GitBranchPlus className="w-3.5 h-3.5 mr-2" />
New Branch
<GitCommit className="w-3.5 h-3.5 mr-2" />
Commit Changes
</DropdownMenuItem>
)}
{worktree.hasChanges && (
<>
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={() => onCommit(worktree)}
className="text-xs"
>
<GitCommit className="w-3.5 h-3.5 mr-2" />
Commit Changes
</DropdownMenuItem>
</>
)}
{/* Show PR option if not on main branch, or if on main with changes */}
{(worktree.branch !== "main" || worktree.hasChanges) && (
<DropdownMenuItem

View File

@@ -50,6 +50,7 @@ export function createPushHandler() {
result: {
branch: branchName,
pushed: true,
message: `Successfully pushed ${branchName} to origin`,
},
});
} catch (error) {