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

@@ -222,7 +222,8 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
const metadata = projectID
? globalSync.data.project.find((x) => x.id === projectID)
: globalSync.data.project.find((x) => x.worktree === project.worktree)
return {
const base = {
...(metadata ?? {}),
...project,
icon: {
@@ -231,6 +232,20 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
color: metadata?.icon?.color,
},
}
if (projectID !== "global") return base
const local = childStore.projectMeta
return {
...base,
name: local?.name,
commands: local?.commands,
icon: {
url: base.icon?.url,
override: local?.icon?.override,
color: local?.icon?.color,
},
}
}
const roots = createMemo(() => {
@@ -296,6 +311,10 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
used.add(color)
setColors(project.worktree, color)
if (!project.id) continue
if (project.id === "global") {
globalSync.project.meta(project.worktree, { icon: { color } })
continue
}
void globalSdk.client.project.update({ projectID: project.id, directory: project.worktree, icon: { color } })
}
})