mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +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()
|
||||
})
|
||||
|
||||
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(
|
||||
<SessionActivityPanel
|
||||
@ -341,8 +341,7 @@ describe('SessionActivityPanel', () => {
|
||||
/>,
|
||||
)
|
||||
|
||||
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', () => {
|
||||
|
||||
@ -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 ? (
|
||||
<BackgroundTaskStopButton
|
||||
row={row}
|
||||
stopping={Boolean(stoppingBackgroundTask)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user