fix: scope idle agent setting to dashboard (#12941)
This commit is contained in:
parent
74e1678d4b
commit
99d2f03ca7
|
|
@ -16,7 +16,6 @@ export function AgentDashboardExperimentalSetting({
|
|||
}: AgentDashboardExperimentalSettingProps): React.JSX.Element {
|
||||
const enabled = settings.experimentalAgentDashboardPopout === true
|
||||
const mode = settings.experimentalAgentDashboardMode ?? 'in-window'
|
||||
const showIdle = settings.experimentalAgentDashboardShowIdle === true
|
||||
|
||||
return (
|
||||
<SearchableSetting
|
||||
|
|
@ -99,22 +98,6 @@ export function AgentDashboardExperimentalSetting({
|
|||
]}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="min-w-0 shrink space-y-0.5">
|
||||
<Label>{translate('dashboardPopout.settings.showIdle', 'Show idle agents')}</Label>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{translate(
|
||||
'dashboardPopout.settings.showIdleCopy',
|
||||
'Include agents that have gone quiet for 30 minutes without reporting completion. Hidden by default.'
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<SettingsSwitch
|
||||
checked={showIdle}
|
||||
onChange={() => updateSettings({ experimentalAgentDashboardShowIdle: !showIdle })}
|
||||
ariaLabel={translate('dashboardPopout.settings.showIdle', 'Show idle agents')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</SearchableSetting>
|
||||
|
|
|
|||
|
|
@ -164,29 +164,15 @@ describe('ExperimentalPane', () => {
|
|||
root.unmount()
|
||||
})
|
||||
|
||||
it('exposes idle-agent visibility for pop-out dashboards', async () => {
|
||||
const updateSettings = vi.fn()
|
||||
const settings = {
|
||||
...getDefaultSettings('/tmp'),
|
||||
experimentalAgentDashboardPopout: true
|
||||
}
|
||||
const { root, container } = await renderExperimentalPane({
|
||||
settings,
|
||||
updateSettings
|
||||
})
|
||||
const idleSwitch = container.querySelector<HTMLButtonElement>(
|
||||
'#experimental-agent-dashboard button[role="switch"][aria-label="Show idle agents"]'
|
||||
it('keeps idle-agent visibility out of global settings', () => {
|
||||
const markup = renderToStaticMarkup(
|
||||
<ExperimentalPane
|
||||
settings={{ ...getDefaultSettings('/tmp'), experimentalAgentDashboardPopout: true }}
|
||||
updateSettings={vi.fn()}
|
||||
/>
|
||||
)
|
||||
if (!idleSwitch) {
|
||||
throw new Error('Idle-agent visibility switch was not rendered')
|
||||
}
|
||||
|
||||
await act(async () => {
|
||||
idleSwitch.dispatchEvent(new MouseEvent('click', { bubbles: true }))
|
||||
})
|
||||
|
||||
expect(updateSettings).toHaveBeenCalledWith({ experimentalAgentDashboardShowIdle: true })
|
||||
root.unmount()
|
||||
expect(markup).not.toContain('Show idle agents')
|
||||
})
|
||||
|
||||
it('renders Cloud VM as an off-by-default experimental subsection', () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue