feat(activity): surface active work across the session picker, tool rail and mobile

This commit is contained in:
Chris Scott committed 2026-10-16 00:54:06 -04:00
1 parent be874ee07c
commit d8f2fcf29c
46 files changed
+3120 -277

No files matched your search

+29 -1
View File
@@ -1,5 +1,33 @@
import { describe, expect, it } from 'vitest'
import { toggleToolDialogParams, toggleToolPanelParams } from './useToolPanel'
import { createElement } from 'react'
import { render, screen, waitFor } from '@testing-library/react'
import { MemoryRouter, useLocation } from 'react-router-dom'
import { isPanelTool, toggleToolDialogParams, toggleToolPanelParams, useToolPanel } from './useToolPanel'
describe('activity tool', () => {
it('is a panel tool', () => {
expect(isPanelTool('activity')).toBe(true)
})
it('clears without opening a dialog when the panel is not docked', async () => {
function Probe() {
useToolPanel(false)
const location = useLocation()
return createElement('div', { 'data-testid': 'search' }, location.search)
}
render(
createElement(
MemoryRouter,
{ initialEntries: ['/repos/1/sessions/abc?panel=activity'] },
createElement(Probe),
),
)
await waitFor(() => expect(screen.getByTestId('search').textContent).not.toContain('panel=activity'))
expect(screen.getByTestId('search').textContent).not.toContain('dialog=activity')
})
})
describe('toggleToolPanelParams', () => {
it('opens a tool, clears other tools owned params, and preserves unrelated params', () => {