mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 09:41:04 +01:00
Clean up agent config environment selector
Show the environment override selector only when a meaningful alternative exists, remove the explanatory helper copy, relabel the inherited option, and rename the section header to Environment. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
0b945f449b
commit
03bbe3e15c
1 file changed
+10
-16
@@ -400,10 +400,12 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
||||
}),
|
||||
[environments, supportedEnvironmentDrivers],
|
||||
);
|
||||
// `runnableEnvironments` excludes the always-available Local environment, so a
|
||||
// single entry already means the user has more than one environment configured
|
||||
// (Local + that environment) and the override selector is meaningful.
|
||||
const showEnvironmentOverrideControl = environmentsEnabled && (
|
||||
forcedKubernetes ||
|
||||
currentDefaultEnvironmentId.length > 0 ||
|
||||
runnableEnvironments.length > 1
|
||||
runnableEnvironments.length >= 1
|
||||
);
|
||||
const inheritedEnvironmentLabel = instanceDefaultEnvironment
|
||||
? `${instanceDefaultEnvironment.name} (${instanceDefaultEnvironment.driver})`
|
||||
@@ -883,8 +885,8 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
||||
// Render the environment read-only instead of the selectable picker.
|
||||
<div className={cn(!cards && (isCreate ? "border-t border-border" : "border-b border-border"))}>
|
||||
{cards
|
||||
? <h3 className="text-sm font-medium mb-3">Execution</h3>
|
||||
: <div className="px-4 py-2 text-xs font-medium text-muted-foreground">Execution</div>
|
||||
? <h3 className="text-sm font-medium mb-3">Environment</h3>
|
||||
: <div className="px-4 py-2 text-xs font-medium text-muted-foreground">Environment</div>
|
||||
}
|
||||
<div className={cn(cards ? "border border-border rounded-lg p-4 space-y-3" : "px-4 pb-3 space-y-3")}>
|
||||
<Field
|
||||
@@ -908,20 +910,12 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
||||
) : showEnvironmentOverrideControl ? (
|
||||
<div className={cn(!cards && (isCreate ? "border-t border-border" : "border-b border-border"))}>
|
||||
{cards
|
||||
? <h3 className="text-sm font-medium mb-3">Execution</h3>
|
||||
: <div className="px-4 py-2 text-xs font-medium text-muted-foreground">Execution</div>
|
||||
? <h3 className="text-sm font-medium mb-3">Environment</h3>
|
||||
: <div className="px-4 py-2 text-xs font-medium text-muted-foreground">Environment</div>
|
||||
}
|
||||
<div className={cn(cards ? "border border-border rounded-lg p-4 space-y-3" : "px-4 pb-3 space-y-3")}>
|
||||
<Field
|
||||
label="Environment override"
|
||||
hint="Leave this unset to inherit the instance default. Agent-specific overrides only appear when there is a real alternative."
|
||||
>
|
||||
<Field label="Environment override">
|
||||
<div className="space-y-2">
|
||||
<div className="text-xs text-muted-foreground">
|
||||
{currentDefaultEnvironment
|
||||
? `Overriding the instance default with ${currentDefaultEnvironment.name}.`
|
||||
: `Inheriting the instance default: ${inheritedEnvironmentLabel}.`}
|
||||
</div>
|
||||
<select
|
||||
className={inputClass}
|
||||
value={currentDefaultEnvironmentId}
|
||||
@@ -934,7 +928,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
||||
mark("identity", "defaultEnvironmentId", nextValue || null);
|
||||
}}
|
||||
>
|
||||
<option value="">Inherit instance default ({inheritedEnvironmentLabel})</option>
|
||||
<option value="">Default: {inheritedEnvironmentLabel}</option>
|
||||
{runnableEnvironments.map((environment) => (
|
||||
<option key={environment.id} value={environment.id}>
|
||||
{environment.name} · {environment.driver}
|
||||
|
||||
Reference in new issue
Block a user