mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-25 14:53:32 +08:00
fix(desktop): hide background stop control for SubAgents
This commit is contained in:
parent
20bb86ab63
commit
4d23896f39
@ -310,7 +310,7 @@ describe('SessionActivityPanel', () => {
|
|||||||
expect(screen.getByRole('button', { name: 'Stopping background task Sleep for 300 seconds' })).toBeDisabled()
|
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()
|
const onStopBackgroundTask = vi.fn()
|
||||||
render(
|
render(
|
||||||
<SessionActivityPanel
|
<SessionActivityPanel
|
||||||
@ -341,8 +341,7 @@ describe('SessionActivityPanel', () => {
|
|||||||
/>,
|
/>,
|
||||||
)
|
)
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole('button', { name: 'Stop background task Background reviewer' }))
|
expect(screen.queryByRole('button', { name: 'Stop background task Background reviewer' })).not.toBeInTheDocument()
|
||||||
expect(onStopBackgroundTask).toHaveBeenCalledWith('agent-task-1')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('keeps SubAgent rows to name and status instead of result previews', () => {
|
it('keeps SubAgent rows to name and status instead of result previews', () => {
|
||||||
|
|||||||
@ -351,7 +351,7 @@ function ActivityRowView({
|
|||||||
)
|
)
|
||||||
const interactiveRowClassName =
|
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)]'
|
'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 ? (
|
||||||
<BackgroundTaskStopButton
|
<BackgroundTaskStopButton
|
||||||
row={row}
|
row={row}
|
||||||
stopping={Boolean(stoppingBackgroundTask)}
|
stopping={Boolean(stoppingBackgroundTask)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user