Add worktree support and consolidate branch management UI (#78)

* Fix git credential saving and improve host matching

- Fix token masking bug in GitCredentialDialog that corrupted tokens on edit
- Add tokenEdited state to preserve original token when not modified
- Default new credential host to https://github.com
- Add normalizeHostname helper for consistent host comparison
- Improve credential lookup logging to show configured vs requested hosts
- Remove overly permissive fuzzy matching that could leak tokens

* Make OpenCode reload non-fatal when saving git credentials

Settings are now saved to database even if the OpenCode server reload
fails. The reload error is returned separately so the UI can inform
the user that credentials were saved but the server needs a manual
restart.

* Fix git fetch using credentials in silent mode

Previously, silent mode (used for UI fetch operations) would skip
credential lookup entirely and return empty, causing auth failures.
Now credentials are always looked up via IPC regardless of silent mode.

* Add worktree support and consolidate branch management UI

* Remove duplicate SECURE_COOKIES property from auth config

* Bump version to 0.7.8
This commit is contained in:
Chris Scott authored and GitHub committed 2026-01-25 11:06:57 -05:00
1 parent fb9413782a
commit 204e79c713
12 files changed
+149 -489

No files matched your search

@@ -1,74 +0,0 @@
import { GitBranch, Loader2 } from 'lucide-react'
import { cn } from '@/lib/utils'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
interface GitBranchSelectorProps {
repoId: number | undefined
branch: string | null
branches: string[]
onBranchChange: (branch: string) => void
isLoading?: boolean
error?: Error | null
ahead?: number
behind?: number
}
export function GitBranchSelector({ branch, branches, onBranchChange, isLoading, error, ahead, behind }: GitBranchSelectorProps) {
if (isLoading) {
return (
<div className="flex items-center gap-2 px-3 py-2">
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
<span className="text-sm text-muted-foreground">Loading branches...</span>
</div>
)
}
if (error) {
return (
<div className="flex items-center gap-2 px-3 py-2">
<GitBranch className="w-4 h-4 text-muted-foreground" />
<span className="text-sm text-red-500">Failed to load branches</span>
</div>
)
}
if (!branch || branches.length === 0) {
return (
<div className="flex items-center gap-2 px-3 py-2">
<GitBranch className="w-4 h-4 text-muted-foreground" />
<span className="text-sm text-muted-foreground">No branches available</span>
</div>
)
}
const getBranchLabel = (branchName: string, isCurrent: boolean) => {
if (!isCurrent) return branchName
const parts = [branchName]
if (ahead && ahead > 0) parts.push(`${ahead} ahead`)
if (behind && behind > 0) parts.push(`${behind} behind`)
return parts.join(' ')
}
return (
<Select value={branch} onValueChange={onBranchChange}>
<SelectTrigger className="w-full h-auto py-1.5">
<div className="flex items-center gap-2 flex-1">
<GitBranch className="w-4 h-4 text-muted-foreground" />
<SelectValue placeholder="Select branch" />
</div>
</SelectTrigger>
<SelectContent>
{branches.map((branchName) => (
<SelectItem key={branchName} value={branchName}>
<div className="flex items-center gap-2">
<GitBranch className="w-3 h-3 text-muted-foreground" />
<span className={cn(branchName === branch && 'font-medium')}>
{getBranchLabel(branchName, branchName === branch)}
</span>
</div>
</SelectItem>
))}
</SelectContent>
</Select>
)
}