feat: extract Permissions & Configuration pane, flatten Run Policy
- Move Advanced Adapter Settings into standalone Permissions & Configuration pane - Convert create-mode Run Policy from collapsible to regular section - Remove unused adapterAdvancedOpen and heartbeatOpen state Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -270,9 +270,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Section toggle state — advanced always starts collapsed
|
// Section toggle state — advanced always starts collapsed
|
||||||
const [adapterAdvancedOpen, setAdapterAdvancedOpen] = useState(false);
|
|
||||||
const [runPolicyAdvancedOpen, setRunPolicyAdvancedOpen] = useState(false);
|
const [runPolicyAdvancedOpen, setRunPolicyAdvancedOpen] = useState(false);
|
||||||
const [heartbeatOpen, setHeartbeatOpen] = useState(!isCreate);
|
|
||||||
const [cwdPickerNotice, setCwdPickerNotice] = useState<string | null>(null);
|
const [cwdPickerNotice, setCwdPickerNotice] = useState<string | null>(null);
|
||||||
|
|
||||||
// Popover states
|
// Popover states
|
||||||
@@ -529,14 +527,15 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||||||
<uiAdapter.ConfigFields {...adapterFieldProps} />
|
<uiAdapter.ConfigFields {...adapterFieldProps} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Advanced adapter section — collapsible in both modes */}
|
</div>
|
||||||
{isLocal && (
|
|
||||||
<CollapsibleSection
|
{/* ---- Permissions & Configuration ---- */}
|
||||||
title="Advanced Adapter Settings"
|
{isLocal && (
|
||||||
open={adapterAdvancedOpen}
|
<div className="border-b border-border">
|
||||||
onToggle={() => setAdapterAdvancedOpen(!adapterAdvancedOpen)}
|
<div className="px-4 py-2 text-xs font-medium text-muted-foreground">
|
||||||
>
|
Permissions & Configuration
|
||||||
<div className="space-y-3">
|
</div>
|
||||||
|
<div className="px-4 pb-3 space-y-3">
|
||||||
<Field label="Command" hint={help.localCommand}>
|
<Field label="Command" hint={help.localCommand}>
|
||||||
<DraftInput
|
<DraftInput
|
||||||
value={
|
value={
|
||||||
@@ -684,21 +683,18 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||||||
</Field>
|
</Field>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</CollapsibleSection>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ---- Run Policy ---- */}
|
{/* ---- Run Policy ---- */}
|
||||||
{isCreate ? (
|
{isCreate ? (
|
||||||
<CollapsibleSection
|
<div className="border-b border-border">
|
||||||
title="Run Policy"
|
<div className="px-4 py-2 text-xs font-medium text-muted-foreground flex items-center gap-2">
|
||||||
icon={<Heart className="h-3 w-3" />}
|
<Heart className="h-3 w-3" />
|
||||||
open={heartbeatOpen}
|
Run Policy
|
||||||
onToggle={() => setHeartbeatOpen(!heartbeatOpen)}
|
</div>
|
||||||
bordered
|
<div className="px-4 pb-3 space-y-3">
|
||||||
>
|
|
||||||
<div className="space-y-3">
|
|
||||||
<ToggleWithNumber
|
<ToggleWithNumber
|
||||||
label="Heartbeat on interval"
|
label="Heartbeat on interval"
|
||||||
hint={help.heartbeatInterval}
|
hint={help.heartbeatInterval}
|
||||||
@@ -712,7 +708,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||||||
showNumber={val!.heartbeatEnabled}
|
showNumber={val!.heartbeatEnabled}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</CollapsibleSection>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="border-b border-border">
|
<div className="border-b border-border">
|
||||||
<div className="px-4 py-2 text-xs font-medium text-muted-foreground flex items-center gap-2">
|
<div className="px-4 py-2 text-xs font-medium text-muted-foreground flex items-center gap-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user