mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
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:
1 parent
01e50a7019
commit
6a4e8734f9
33 files changed
+535
-84
No files matched your search
@@ -63,7 +63,7 @@ export function MoreDrawer({ isOpen, onClose }: MoreDrawerProps) {
|
||||
const currentBranch = repo?.currentBranch || repo?.branch
|
||||
const repoDisplayName = isAssistantRoute || isAssistantSession
|
||||
? 'Assistant'
|
||||
: repo ? getRepoDisplayName(repo.repoUrl, repo.localPath, repo.sourcePath) : null
|
||||
: repo ? getRepoDisplayName(repo) : null
|
||||
|
||||
const handleSettingsClick = () => {
|
||||
updateParams((p) => {
|
||||
|
||||
@@ -50,7 +50,7 @@ export function RepoQuickSwitchSheet({ isOpen, onClose }: RepoQuickSwitchSheetPr
|
||||
if (!searchQuery.trim()) return sorted
|
||||
const query = searchQuery.toLowerCase()
|
||||
return sorted.filter((repo) =>
|
||||
getRepoDisplayName(repo.repoUrl, repo.localPath, repo.sourcePath).toLowerCase().includes(query)
|
||||
getRepoDisplayName(repo).toLowerCase().includes(query)
|
||||
)
|
||||
}, [regularRepos, searchQuery])
|
||||
|
||||
@@ -161,7 +161,7 @@ export function RepoQuickSwitchSheet({ isOpen, onClose }: RepoQuickSwitchSheetPr
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 min-w-0 font-medium text-sm text-foreground truncate">
|
||||
{getRepoDisplayName(repo.repoUrl, repo.localPath, repo.sourcePath)}
|
||||
{getRepoDisplayName(repo)}
|
||||
</div>
|
||||
{isActive && <Check className="h-4 w-4 text-primary flex-shrink-0" />}
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user