fix(agent-manager): enable row worktree control before project state loads

This commit is contained in:
marius-kilocode
2026-09-15 09:33:23 +02:00
parent 5584ba52ce
commit a242a912d5
3 changed files with 5 additions and 6 deletions
@@ -245,7 +245,6 @@ export const ProjectList: Component<Props> = (props) => {
onSection={(projectId) => newSection(projectId)}
onSettings={(projectId) => vscode.postMessage({ type: "openSettingsPanel", tab: "agentManager", projectId })}
bindings={props.bindings}
loaded={(projectId) => props.states[projectId] !== undefined}
baseBranch={(projectId) => props.states[projectId]?.defaultBaseBranch ?? props.local[projectId]?.branch ?? "main"}
onExpand={(projectId, expanded) =>
vscode.postMessage({ type: "agentManager.setProjectExpanded", projectId, expanded })
@@ -4,7 +4,7 @@ import { Show, type Component } from "solid-js"
import { IconButton } from "@kilocode/kilo-ui/icon-button"
import { WorktreeCreate, type WorktreeCreateProps } from "./ProjectActions"
interface Props extends WorktreeCreateProps {
interface Props extends Omit<WorktreeCreateProps, "loaded"> {
pinned: boolean
onHistory: () => void
onSettings: () => void
@@ -14,14 +14,16 @@ interface Props extends WorktreeCreateProps {
/**
* Project row actions: the new-worktree split control plus the individual
* project actions. Clicks stay off the row toggle so the plus opens the dialog
* without expanding a collapsed project.
* without expanding a collapsed project. The control is not gated on the
* project's pushed state: create messages are state-gated on the host, so a
* collapsed project that has never been expanded still works.
*/
export const ProjectRowActions: Component<Props> = (props) => (
<div class="am-project-actions-row" onClick={(event) => event.stopPropagation()}>
<WorktreeCreate
branch={props.branch}
bindings={props.bindings}
loaded={props.loaded}
loaded
t={props.t}
onCreate={props.onCreate}
onNew={props.onNew}
@@ -22,7 +22,6 @@ interface ProjectsSectionProps {
onSection: (id: string) => void
onSettings: (id: string) => void
count: (id: string) => number | undefined
loaded: (id: string) => boolean
baseBranch: (id: string) => string
tools?: JSX.Element
body: (project: AgentProjectSnapshot) => JSX.Element
@@ -81,7 +80,6 @@ export const ProjectsSection: Component<ProjectsSectionProps> = (props) => (
<ProjectRowActions
branch={props.baseBranch(project().id)}
bindings={props.bindings}
loaded={props.loaded(project().id)}
t={props.t}
pinned={project().pinned}
onCreate={() => props.onCreate(project().id)}