From 4d23896f39ba08e1df6660af71f29340ce5e609c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Sat, 11 Jul 2026 05:20:01 +0800 Subject: [PATCH] fix(desktop): hide background stop control for SubAgents --- .../src/components/activity/SessionActivityPanel.test.tsx | 5 ++--- desktop/src/components/activity/SessionActivityPanel.tsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop/src/components/activity/SessionActivityPanel.test.tsx b/desktop/src/components/activity/SessionActivityPanel.test.tsx index 9e86a988..17a8af8d 100644 --- a/desktop/src/components/activity/SessionActivityPanel.test.tsx +++ b/desktop/src/components/activity/SessionActivityPanel.test.tsx @@ -310,7 +310,7 @@ describe('SessionActivityPanel', () => { expect(screen.getByRole('button', { name: 'Stopping background task Sleep for 300 seconds' })).toBeDisabled() }) - it('offers the same stop control for a running background SubAgent', () => { + it('does not offer the background task stop control for a running SubAgent', () => { const onStopBackgroundTask = vi.fn() render( { />, ) - fireEvent.click(screen.getByRole('button', { name: 'Stop background task Background reviewer' })) - expect(onStopBackgroundTask).toHaveBeenCalledWith('agent-task-1') + expect(screen.queryByRole('button', { name: 'Stop background task Background reviewer' })).not.toBeInTheDocument() }) it('keeps SubAgent rows to name and status instead of result previews', () => { diff --git a/desktop/src/components/activity/SessionActivityPanel.tsx b/desktop/src/components/activity/SessionActivityPanel.tsx index 0999e6e5..5597f5f7 100644 --- a/desktop/src/components/activity/SessionActivityPanel.tsx +++ b/desktop/src/components/activity/SessionActivityPanel.tsx @@ -351,7 +351,7 @@ function ActivityRowView({ ) const interactiveRowClassName = 'flex min-w-0 items-center gap-2.5 rounded-lg px-2.5 py-2.5 text-left transition-[background-color,transform] duration-150 ease-out hover:bg-[var(--color-surface-hover)] active:translate-y-px focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-border-focus)]' - const stopButton = onStopBackgroundTask ? ( + const stopButton = row.section === 'backgroundTasks' && onStopBackgroundTask ? (