feat(sessions): show background activity for shells and child sessions

This commit is contained in:
Chris Scott committed 2026-10-11 21:52:03 +00:00
1 parent 51e92d8cf2
commit 2e2eff05af
7 files changed
+434 -15

No files matched your search

@@ -0,0 +1,37 @@
import { render, screen } from '@testing-library/react'
import { beforeEach, describe, expect, it } from 'vitest'
import { SessionStatusIndicator } from './session-status-indicator'
import { useSessionStatus } from '@/stores/sessionStatusStore'
const resetStore = () => {
useSessionStatus.setState({
statuses: new Map(),
statusCache: new Map(),
statusRevisions: new Map(),
knownSessions: new Set(),
outcomes: new Map(),
parents: new Map(),
runningShells: new Map(),
revision: 0,
})
}
describe('SessionStatusIndicator background activity', () => {
beforeEach(() => {
resetStore()
})
it('shows the background tasks label when idle with a running shell', () => {
useSessionStatus.getState().setShellRunning('shell-1', 'session-a', '/repo')
render(<SessionStatusIndicator sessionID="session-a" showLabel />)
expect(screen.getByLabelText('Background tasks running')).toBeInTheDocument()
})
it('renders nothing when idle without background activity', () => {
const { container } = render(<SessionStatusIndicator sessionID="session-a" showLabel />)
expect(container).toBeEmptyDOMElement()
})
})