fix: agent projects reached the project-actions dialog via the scope menu

Appending agent groups to `projectGroups` put them in the sidebar's scope
filter menu — correct, they are a real place to scope to — but every row
there carries the ⋯ actions button, and the dialog behind it treats its
target as a user-managed workspace: rename, grouping overrides, Copy path
(of the synthetic directory), and Remove, which would delete the synthetic
project backing the agent along with its Home thread history. The whole
synthetic-project design says agents are not user-managed there; the button
is now hidden for them.

The same menu also missed the agent mark: the scope trigger and its menu
items were the only two `ProjectFavicon` call sites not passing
`agentDriverKind`, so an agent showed a folder there while showing its mark
everywhere else — the exact inconsistency centralizing the branch in
`ProjectFavicon` was meant to prevent. Both now resolve through
`resolveAgentProjectDriverKind` like every other site.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Ben DavisandClaude Fable 5 committed 2026-07-27 13:03:21 -07:00
1 parent d66bc536b8
commit 0790133072
1 file changed
+29 -12
+29 -12
View File
@@ -77,6 +77,7 @@ import {
} from "../logicalProject";
import {
buildSidebarProjectSnapshots,
isAgentProject,
resolveAgentProjectDriverKind,
type SidebarProjectGroupMember,
type SidebarProjectSnapshot,
@@ -2351,6 +2352,11 @@ export default function SidebarV2() {
environmentId={scopedProjectGroup.environmentId}
cwd={scopedProjectGroup.workspaceRoot}
className="size-4 shrink-0"
agentDriverKind={resolveAgentProjectDriverKind(
scopedProjectGroup,
providerEntryByInstanceId,
)}
agentDisplayName={scopedProjectGroup.displayName}
/>
) : (
<FolderIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />
@@ -2388,20 +2394,31 @@ export default function SidebarV2() {
environmentId={project.environmentId}
cwd={project.workspaceRoot}
className="size-4 shrink-0"
agentDriverKind={resolveAgentProjectDriverKind(
project,
providerEntryByInstanceId,
)}
agentDisplayName={project.displayName}
/>
<span className="min-w-0 truncate text-sm">{project.displayName}</span>
<button
type="button"
aria-label={`Project actions for ${project.displayName}`}
title={`Project actions for ${project.displayName}`}
className="ml-auto inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground/55 outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
void handleProjectActions(event, project);
}}
>
<EllipsisIcon className="size-3.5" />
</button>
{/* No actions for an agent's synthetic project: the
dialog offers rename/regroup/Remove, all of which
treat it as a user-managed workspace — Remove
would delete the agent's Home thread history. */}
{isAgentProject(project) ? null : (
<button
type="button"
aria-label={`Project actions for ${project.displayName}`}
title={`Project actions for ${project.displayName}`}
className="ml-auto inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground/55 outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
void handleProjectActions(event, project);
}}
>
<EllipsisIcon className="size-3.5" />
</button>
)}
</MenuRadioItem>
);
})}