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

@@ -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>
<div className="flex items-center gap-3">
<FileCode2 className="h-4 w-4 text-muted-foreground" />
<div className="flex-1">
<p className="text-sm">Name collision strategy</p>
<p className="text-xs text-muted-foreground">
How to handle repos with the same name from different owners
</p>
</div>
<Select <Select
value={githubConfig.starredDuplicateStrategy || "suffix"} value={githubConfig.starredDuplicateStrategy || "suffix"}
onValueChange={(value) => handleGitHubChange('starredDuplicateStrategy', value as DuplicateNameStrategy)} onValueChange={(value) => handleGitHubChange('starredDuplicateStrategy', value as DuplicateNameStrategy)}
> >
<SelectTrigger id="duplicate-strategy" className="w-full"> <SelectTrigger className="w-[180px] h-8 text-xs">
<SelectValue placeholder="Select duplicate handling strategy" /> <SelectValue placeholder="Select strategy" />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent align="end">
<SelectItem value="suffix"> <SelectItem value="suffix" className="text-xs">
Add owner as suffix (awesome-project-user1) <span className="font-mono">repo-owner</span>
</SelectItem> </SelectItem>
<SelectItem value="prefix"> <SelectItem value="prefix" className="text-xs">
Add owner as prefix (user1-awesome-project) <span className="font-mono">owner-repo</span>
</SelectItem> </SelectItem>
</SelectContent> </SelectContent>
</Select> </Select>
<p className="text-xs text-muted-foreground"> </div>
Handle starred repos with duplicate names from different owners. Currently supports suffix and prefix strategies.
</p>
</div> </div>
)} )}
</div> </div>