fix: scope idle agent setting to dashboard (#12941)

This commit is contained in:
Brennan Benson 2026-08-06 13:28:16 -07:00 committed by GitHub
parent 74e1678d4b
commit 99d2f03ca7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 38 deletions

View File

@ -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>

View File

@ -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', () => {