feat: add repo rename capability with custom name field (#294)

* feat: add repo rename capability with custom name field

Add a custom name field to repos, allowing users to set a display name
independent of the repo URL or path. Includes a migration, PATCH endpoint,
rename dialog, and display name consolidation.

- DB migration 014 adds name column to repos table
- PATCH /api/repos/:id endpoint with Zod validation
- RenameRepoDialog component with clear/reset support
- RepoRowActions gains Rename action in both dropdown and inline modes
- getRepoDisplayName() consolidated to accept a repo object and prefer name
- All repo name display call sites updated to use the new API

* fix: add DialogTitle to RenameRepoDialog for a11y compliance

* refactor: extract getRepoDisplayName to shared utils, fix schedule cache invalidation on rename
This commit is contained in:
Chris Scott authored and GitHub committed 2026-06-28 14:49:00 -04:00
1 parent 01e50a7019
commit 6a4e8734f9
33 files changed
+535 -84

No files matched your search

@@ -9,6 +9,7 @@ import { Alert } from '@/components/ui/alert'
import { Checkbox } from '@/components/ui/checkbox'
import { MultiSelect, type MultiSelectOption } from '@/components/ui/multi-select'
import { showToast } from '@/lib/toast'
import { getRepoDisplayName } from '@/lib/utils'
import type { GitCredential } from '@/api/types/settings'
import type { Repo } from '@/api/types'
@@ -83,7 +84,7 @@ export function GitCredentialDialog({ open, onOpenChange, onSave, credential, re
const repoOptions: MultiSelectOption[] = repos.map((repo) => ({
value: String(repo.id),
label: repo.repoUrl?.split('/').pop()?.replace('.git', '') || repo.localPath,
label: getRepoDisplayName(repo),
description: repo.repoUrl || repo.fullPath,
}))
@@ -8,6 +8,7 @@ import { Input } from '@/components/ui/input'
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'
import { Textarea } from '@/components/ui/textarea'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
import { getRepoDisplayName } from '@/lib/utils'
import type { SkillFileInfo, CreateSkillRequest, UpdateSkillRequest, SkillScope } from '@opencode-manager/shared'
import type { Repo } from '@/api/types'
import { listRepos } from '@/api/repos'
@@ -205,7 +206,7 @@ export function SkillDialog({ open, onOpenChange, onSubmit, editingSkill }: Skil
<SelectContent>
{repos.map((repo) => (
<SelectItem key={repo.id} value={repo.id.toString()}>
{repo.localPath}
{getRepoDisplayName(repo)}
</SelectItem>
))}
</SelectContent>
@@ -7,6 +7,7 @@ import { Label } from '@/components/ui/label'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { getRepoDisplayName } from '@/lib/utils'
import { settingsApi } from '@/api/settings'
import { listRepos } from '@/api/repos'
import { FetchError } from '@/api/fetchWrapper'
@@ -194,7 +195,7 @@ export function SkillInstallDialog({ open, onOpenChange, onInstalled }: SkillIns
<SelectContent>
{repos.map((repo) => (
<SelectItem key={repo.id} value={repo.id.toString()}>
{repo.localPath}
{getRepoDisplayName(repo)}
</SelectItem>
))}
</SelectContent>