mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
fix(settings): indent the Agent sleep "Sleep after" sub-setting (#18379)
"Sleep after" rendered flush with its parent toggle, unlike the Agent Dashboard and Chat UI sub-settings which sit inside the indented, left-bordered group. Reuse that same wrapper and drop the row's extra vertical padding so the block matches its siblings. Co-authored-by: Merge Sim <sim@local>
This commit is contained in:
co-authored by
Merge Sim
parent
16e2624578
commit
91c5a615c5
@@ -190,30 +190,33 @@ export function ExperimentalPane({
|
||||
/>
|
||||
</div>
|
||||
{agentHibernationEnabled ? (
|
||||
<NumberField
|
||||
label={translate(
|
||||
'auto.components.settings.ExperimentalPane.agentHibernation.idleMinutesLabel',
|
||||
'Sleep after'
|
||||
)}
|
||||
description={translate(
|
||||
'auto.components.settings.ExperimentalPane.agentHibernation.idleMinutesDescription',
|
||||
'How many idle minutes a completed background agent must wait before Orca can sleep it.'
|
||||
)}
|
||||
value={agentHibernationIdleMinutes}
|
||||
min={MIN_AGENT_HIBERNATION_IDLE_MS / MS_PER_MINUTE}
|
||||
max={MAX_AGENT_HIBERNATION_IDLE_MS / MS_PER_MINUTE}
|
||||
step={1}
|
||||
suffix={translate(
|
||||
'auto.components.settings.ExperimentalPane.agentHibernation.idleMinutesSuffix',
|
||||
'minutes'
|
||||
)}
|
||||
onChange={(minutes) =>
|
||||
updateSettings({
|
||||
// Why: settings persist the planner contract, not the display unit.
|
||||
agentHibernationIdleMs: minutes * MS_PER_MINUTE
|
||||
})
|
||||
}
|
||||
/>
|
||||
<div className="ml-4 space-y-3 border-l border-border pl-4">
|
||||
<NumberField
|
||||
className="py-0"
|
||||
label={translate(
|
||||
'auto.components.settings.ExperimentalPane.agentHibernation.idleMinutesLabel',
|
||||
'Sleep after'
|
||||
)}
|
||||
description={translate(
|
||||
'auto.components.settings.ExperimentalPane.agentHibernation.idleMinutesDescription',
|
||||
'How many idle minutes a completed background agent must wait before Orca can sleep it.'
|
||||
)}
|
||||
value={agentHibernationIdleMinutes}
|
||||
min={MIN_AGENT_HIBERNATION_IDLE_MS / MS_PER_MINUTE}
|
||||
max={MAX_AGENT_HIBERNATION_IDLE_MS / MS_PER_MINUTE}
|
||||
step={1}
|
||||
suffix={translate(
|
||||
'auto.components.settings.ExperimentalPane.agentHibernation.idleMinutesSuffix',
|
||||
'minutes'
|
||||
)}
|
||||
onChange={(minutes) =>
|
||||
updateSettings({
|
||||
// Why: settings persist the planner contract, not the display unit.
|
||||
agentHibernationIdleMs: minutes * MS_PER_MINUTE
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</SearchableSetting>
|
||||
) : null}
|
||||
|
||||
@@ -270,6 +270,7 @@ type NumberFieldProps = {
|
||||
integer?: boolean
|
||||
onChange: (value: number) => void
|
||||
suffix?: string
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function ColorField({
|
||||
@@ -315,7 +316,8 @@ export function NumberField({
|
||||
step = 1,
|
||||
integer = false,
|
||||
onChange,
|
||||
suffix
|
||||
suffix,
|
||||
className
|
||||
}: NumberFieldProps): React.JSX.Element {
|
||||
const [draft, setDraft] = useState(Number.isFinite(value) ? String(value) : '')
|
||||
const [prevValue, setPrevValue] = useState(value)
|
||||
@@ -346,6 +348,7 @@ export function NumberField({
|
||||
|
||||
return (
|
||||
<SettingsRow
|
||||
className={className}
|
||||
label={label}
|
||||
description={
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user