feat: enhance git operations with unpublished commits detection and upstream setup on first push

This commit is contained in:
Bohdan Triapitsyn
2025-12-31 01:06:33 +02:00
parent 7b98f972f3
commit cadcf0bcf6
7 changed files with 228 additions and 43 deletions
@@ -210,17 +210,28 @@ export const GitHeader: React.FC<GitHeaderProps> = ({
/>
)}
{status.tracking && (
<div className="flex items-center gap-2 px-1.5 typography-meta text-muted-foreground">
<span className="flex items-center gap-0.5">
<RiArrowUpLine className="size-3.5 text-primary/70" />
<span className="font-semibold text-foreground">{status.ahead}</span>
</span>
<span className="flex items-center gap-0.5">
<RiArrowDownLine className="size-3.5 text-primary/70" />
<span className="font-semibold text-foreground">{status.behind}</span>
</span>
</div>
{(Boolean(status.tracking) || status.ahead > 0 || status.behind > 0) && (
<Tooltip delayDuration={800}>
<TooltipTrigger asChild>
<div className="flex items-center gap-2 px-1.5 typography-meta text-muted-foreground">
<span className="flex items-center gap-0.5">
<RiArrowUpLine className="size-3.5 text-primary/70" />
<span className="font-semibold text-foreground">{status.ahead}</span>
</span>
{Boolean(status.tracking) && (
<span className="flex items-center gap-0.5">
<RiArrowDownLine className="size-3.5 text-primary/70" />
<span className="font-semibold text-foreground">{status.behind}</span>
</span>
)}
</div>
</TooltipTrigger>
<TooltipContent sideOffset={8}>
{status.tracking
? `Upstream: ${status.tracking}`
: 'Unpublished commits (no upstream set yet)'}
</TooltipContent>
</Tooltip>
)}
<SyncActions