Files
kandev/apps/web/components/task-create-dialog-create-mode-selectors.tsx
T
Jonathan Marbutt 97140168d8 fix(web): keep a usable agent selected when the executor changes (#3388)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
2026-09-05 17:42:06 +00:00

60 lines
2.3 KiB
TypeScript

"use client";
import type { AgentProfileOption } from "@/lib/state/slices";
import type { AgentCompatState, DialogFormState } from "@/components/task-create-dialog-types";
import { CreateEditSelectors } from "@/components/task-create-dialog-form-body";
import { AgentSelector, ExecutorProfileSelector } from "@/components/task-create-dialog-selectors";
import { useAgentProfileOptions } from "@/components/task-create-dialog-options";
type CreateModeSelectorsProps = {
isTaskStarted: boolean;
agentProfileOptions: ReturnType<typeof useAgentProfileOptions>;
executorProfileOptions: Array<{
value: string;
label: string;
renderLabel?: () => React.ReactNode;
}>;
agentProfiles: AgentProfileOption[];
agentProfilesLoading: boolean;
executorsLoading: boolean;
isCreatingSession: boolean;
fs: DialogFormState;
onAgentProfileChange: (v: string) => void;
onExecutorProfileChange: (v: string) => void;
workflowAgentLocked: boolean;
agentCompatState: AgentCompatState;
selectedAgentProfileName: string | null;
effectiveWorkflowName: string | null;
executorProfileName: string | null;
};
/**
* Create/edit-mode form body section: agent + executor profile selectors.
* Repo, branch and fresh-branch toggle live in the chip row above the
* description (RepoChipsRow).
*/
export function CreateModeSelectors(props: CreateModeSelectorsProps) {
return (
<CreateEditSelectors
isTaskStarted={props.isTaskStarted}
agentProfiles={props.agentProfiles}
agentProfilesLoading={props.agentProfilesLoading}
agentProfileOptions={props.agentProfileOptions}
agentProfileId={props.fs.agentProfileId}
onAgentProfileChange={props.onAgentProfileChange}
isCreatingSession={props.isCreatingSession}
executorProfileOptions={props.executorProfileOptions}
executorProfileId={props.fs.executorProfileId}
onExecutorProfileChange={props.onExecutorProfileChange}
executorsLoading={props.executorsLoading}
workflowAgentLocked={props.workflowAgentLocked}
agentCompatState={props.agentCompatState}
selectedAgentProfileName={props.selectedAgentProfileName}
effectiveWorkflowName={props.effectiveWorkflowName}
executorProfileName={props.executorProfileName}
AgentSelectorComponent={AgentSelector}
ExecutorProfileSelectorComponent={ExecutorProfileSelector}
/>
);
}