fix(app): non-git projects should be renameable

This commit is contained in:
Adam
2026-01-22 18:07:48 -06:00
parent 7c80ac072b
commit bcf7a65e36
4 changed files with 102 additions and 10 deletions

View File

@@ -1018,11 +1018,16 @@ export default function Layout(props: ParentProps) {
const displayName = (project: LocalProject) => project.name || getFilename(project.worktree)
async function renameProject(project: LocalProject, next: string) {
if (!project.id) return
const current = displayName(project)
if (next === current) return
const name = next === getFilename(project.worktree) ? "" : next
await globalSDK.client.project.update({ projectID: project.id, directory: project.worktree, name })
if (project.id && project.id !== "global") {
await globalSDK.client.project.update({ projectID: project.id, directory: project.worktree, name })
return
}
globalSync.project.meta(project.worktree, { name })
}
async function renameSession(session: Session, next: string) {