Updated deisgn for 'Duplicate collision strategy'

This commit is contained in:
Arunavo Ray
2025-09-13 23:54:14 +05:30
parent 0caa53b67f
commit 46d5ec46fc

View File

@@ -15,11 +15,11 @@ import {
PopoverContent, PopoverContent,
PopoverTrigger, PopoverTrigger,
} from "@/components/ui/popover"; } from "@/components/ui/popover";
import { import {
Info, Info,
GitBranch, GitBranch,
Star, Star,
Lock, Lock,
Archive, Archive,
GitPullRequest, GitPullRequest,
Tag, Tag,
@@ -30,7 +30,8 @@ import {
GitFork, GitFork,
ChevronDown, ChevronDown,
Funnel, Funnel,
HardDrive HardDrive,
FileCode2
} from "lucide-react"; } from "lucide-react";
import type { GitHubConfig, MirrorOptions, AdvancedOptions, DuplicateNameStrategy } from "@/types/config"; import type { GitHubConfig, MirrorOptions, AdvancedOptions, DuplicateNameStrategy } from "@/types/config";
import { import {
@@ -289,28 +290,34 @@ export function GitHubMirrorSettings({
{/* Duplicate name handling for starred repos */} {/* Duplicate name handling for starred repos */}
{githubConfig.mirrorStarred && ( {githubConfig.mirrorStarred && (
<div className="mt-4 space-y-2"> <div className="mt-4 space-y-2">
<Label htmlFor="duplicate-strategy" className="text-sm"> <Label className="text-xs font-medium text-muted-foreground">
Duplicate name handling Duplicate name handling
</Label> </Label>
<Select <div className="flex items-center gap-3">
value={githubConfig.starredDuplicateStrategy || "suffix"} <FileCode2 className="h-4 w-4 text-muted-foreground" />
onValueChange={(value) => handleGitHubChange('starredDuplicateStrategy', value as DuplicateNameStrategy)} <div className="flex-1">
> <p className="text-sm">Name collision strategy</p>
<SelectTrigger id="duplicate-strategy" className="w-full"> <p className="text-xs text-muted-foreground">
<SelectValue placeholder="Select duplicate handling strategy" /> How to handle repos with the same name from different owners
</SelectTrigger> </p>
<SelectContent> </div>
<SelectItem value="suffix"> <Select
Add owner as suffix (awesome-project-user1) value={githubConfig.starredDuplicateStrategy || "suffix"}
</SelectItem> onValueChange={(value) => handleGitHubChange('starredDuplicateStrategy', value as DuplicateNameStrategy)}
<SelectItem value="prefix"> >
Add owner as prefix (user1-awesome-project) <SelectTrigger className="w-[180px] h-8 text-xs">
</SelectItem> <SelectValue placeholder="Select strategy" />
</SelectContent> </SelectTrigger>
</Select> <SelectContent align="end">
<p className="text-xs text-muted-foreground"> <SelectItem value="suffix" className="text-xs">
Handle starred repos with duplicate names from different owners. Currently supports suffix and prefix strategies. <span className="font-mono">repo-owner</span>
</p> </SelectItem>
<SelectItem value="prefix" className="text-xs">
<span className="font-mono">owner-repo</span>
</SelectItem>
</SelectContent>
</Select>
</div>
</div> </div>
)} )}
</div> </div>