{!isSessionMode && (
setTitle(e.target.value)}
disabled={isSessionMode}
/>
)}
{isSessionMode && (
)}
{isSessionMode && }
{!isSessionMode && (
{
const workspaceRepo = repositories.find((repo: Repository) => repo.id === value);
if (workspaceRepo) {
setRepositoryId(value);
setDiscoveredRepoPath('');
setSelectedLocalRepo(null);
setLocalBranches([]);
setBranch('');
return;
}
handleSelectLocalRepository(value);
}}
placeholder={
!workspaceId
? 'Select workspace first'
: repositoriesLoading || discoverReposLoading
? 'Loading repositories...'
: 'Select repository'
}
searchPlaceholder="Search repositories..."
emptyMessage={
repositoriesLoading || discoverReposLoading
? 'Loading repositories...'
: 'No repositories found.'
}
disabled={!workspaceId || repositoriesLoading || discoverReposLoading || isEditMode}
/>
{
const displayName =
branchObj.type === 'remote' && branchObj.remote
? `${branchObj.remote}/${branchObj.name}`
: branchObj.name;
// Use display name as unique value since it includes remote prefix
return {
value: displayName,
label: displayName,
renderLabel: () => (
{displayName}
{branchObj.type === 'local' ? 'local' : branchObj.remote || 'remote'}
),
};
})}
value={branch}
onValueChange={(displayName) => {
// Store the full display name (e.g., "origin/master" or "master")
setBranch(displayName);
}}
placeholder={
!hasRepositorySelection
? 'Select repository first'
: repositoryId
? branchesLoading
? 'Loading branches...'
: 'Select branch'
: localBranchesLoading
? 'Loading branches...'
: branchOptions.length > 0
? 'Select branch'
: 'No branches found'
}
searchPlaceholder="Search branches..."
emptyMessage="No branch found."
disabled={
isEditMode ||
!hasRepositorySelection ||
(repositoryId && branchesLoading) ||
(!repositoryId && (localBranchesLoading || branchOptions.length === 0))
}
/>
{startAgent && (
{agentProfiles.length === 0 && !agentProfilesLoading ? (
No agents found.
Add agent
) : (
({
value: profile.id,
label: profile.label,
renderLabel: () => {
const parts = profile.label.split(' • ');
const agentLabel = parts[0] ?? profile.label;
const profileLabel = parts[1] ?? '';
return (
{agentLabel}
{profileLabel ? (
{profileLabel}
) : null}
);
},
}))}
value={agentProfileId}
onValueChange={setAgentProfileId}
placeholder={
agentProfilesLoading
? 'Loading agents...'
: agentProfiles.length === 0
? 'No agents available'
: 'Select agent'
}
disabled={agentProfilesLoading}
/>
)}
)}
)}
{/* Agent Profile - shown in session mode */}
{isSessionMode && (
({
value: profile.id,
label: profile.label,
renderLabel: () => {
const parts = profile.label.split(' • ');
const agentLabel = parts[0] ?? profile.label;
const profileLabel = parts[1] ?? '';
return (
{agentLabel}
{profileLabel ? (
{profileLabel}
) : null}
);
},
}))}
value={agentProfileId}
onValueChange={setAgentProfileId}
placeholder={agentProfilesLoading ? 'Loading agent profiles...' : 'Select agent profile'}
disabled={agentProfilesLoading}
triggerClassName="w-[280px]"
/>
{/* More Options Toggle */}
)}
{!isSessionMode && startAgent && (
)}
{showAdvancedSettings && isSessionMode && (
)}
{showAdvancedSettings && !isSessionMode && startAgent && (
)}