From 7710485c04d72f4e6dd8bf02d682bcc8bf124a40 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 19 Jul 2026 07:33:26 -0400 Subject: [PATCH] feat(desktop): let inherited projects set color and icon Auto-detected git repos ("inherited" projects) have no projects.db row, so their menu hid appearance/rename/etc. entirely and they could never be themed. Add appearance to the auto-project menu: the first color/icon choice adopts the repo as a real project (folder = repo root, name = its label) carrying that look, after which it themes in place like any explicit project. Routes both explicit and auto edits through one setProjectAppearance helper; the picker closes on adopt so a stale second write can't double-create. --- .../chat/sidebar/projects/project-menu.tsx | 43 +++++++++++++++---- apps/desktop/src/store/projects.ts | 32 ++++++++++++++ 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/apps/desktop/src/app/chat/sidebar/projects/project-menu.tsx b/apps/desktop/src/app/chat/sidebar/projects/project-menu.tsx index 8995013cb751..5b77fe342a48 100644 --- a/apps/desktop/src/app/chat/sidebar/projects/project-menu.tsx +++ b/apps/desktop/src/app/chat/sidebar/projects/project-menu.tsx @@ -24,7 +24,7 @@ import { openProjectRename, revealPath, setActiveProject, - updateProject + setProjectAppearance } from '@/store/projects' import type { SidebarProjectTree } from './workspace-groups' @@ -110,6 +110,26 @@ export function ProjectMenu({ } } + // Appearance writes route through the adopt-aware helper: an auto project is + // materialized on its first change (its id then changes), so close the picker + // when that happens to avoid a second write double-creating from a stale node. + const applyAppearance = (patch: { color?: null | string; icon?: null | string }) => { + void setProjectAppearance(project, patch).then(adopted => { + if (adopted) { + setAppearanceOpen(false) + } + }) + } + + // Set color / pick an icon — shown for explicit projects and for auto ones + // (where selecting adopts the repo as a real project so the look sticks). + const appearanceItem = ( + setAppearanceOpen(true)}> + + {p.menuAppearance} + + ) + const trigger = (