mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
remove duplicate commands in dropdowns
This commit is contained in:
@@ -337,15 +337,6 @@ export function WorktreeSelector({
|
|||||||
)}
|
)}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuSeparator />
|
<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
|
<DropdownMenuItem
|
||||||
onClick={() => onCreateBranch(worktree)}
|
onClick={() => onCreateBranch(worktree)}
|
||||||
className="text-xs"
|
className="text-xs"
|
||||||
@@ -392,37 +383,16 @@ export function WorktreeSelector({
|
|||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="start" className="w-48">
|
<DropdownMenuContent align="start" className="w-48">
|
||||||
{/* Pull latest changes */}
|
{/* Commit changes */}
|
||||||
<DropdownMenuItem
|
{worktree.hasChanges && (
|
||||||
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 && (
|
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => onCreateBranch(worktree)}
|
onClick={() => onCommit(worktree)}
|
||||||
className="text-xs"
|
className="text-xs"
|
||||||
>
|
>
|
||||||
<GitBranchPlus className="w-3.5 h-3.5 mr-2" />
|
<GitCommit className="w-3.5 h-3.5 mr-2" />
|
||||||
New Branch
|
Commit Changes
|
||||||
</DropdownMenuItem>
|
</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 */}
|
{/* Show PR option if not on main branch, or if on main with changes */}
|
||||||
{(worktree.branch !== "main" || worktree.hasChanges) && (
|
{(worktree.branch !== "main" || worktree.hasChanges) && (
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export function createPushHandler() {
|
|||||||
result: {
|
result: {
|
||||||
branch: branchName,
|
branch: branchName,
|
||||||
pushed: true,
|
pushed: true,
|
||||||
|
message: `Successfully pushed ${branchName} to origin`,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user