mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
fix(activity): animate the braille spinner in SVG and tighten the activity lists
- Draw the TUI braille spinner as a 2x4 SVG dot cell stepped by declarative <animate> timelines derived from SPINNER_FRAMES: no JavaScript timer or React render per frame, and it keeps animating under prefers-reduced-motion so an active session never looks stalled - Enlarge the spinner cell and dots so it stays legible next to 14px text - Add a compact ActivityList variant for the mobile More drawer and Repos sheet: one flat list capped at five rows, single-line rows, no group subheadings - Let ActivityList callers own navigation so a row tap navigates once instead of pushing a duplicate history entry - Share the picker keyboard navigation between the session and project tabs and reuse the shared session merge helpers in the sidebar repo groups
This commit is contained in:
1 parent
d8f2fcf29c
commit
8b6251d83b
24 files changed
+858
-787
No files matched your search
@@ -91,8 +91,8 @@ vi.mock('@/hooks/useActiveWork', () => ({
|
||||
mocks.activeWorkWindowMs = windowMs
|
||||
return { groups: mocks.activeWorkGroups, isLoading: false, isError: false }
|
||||
},
|
||||
useActivityWindowMs: () =>
|
||||
(mocks.preferences?.activityWindowMinutes ?? DEFAULT_ACTIVITY_WINDOW_MINUTES) * 60 * 1000,
|
||||
useActivityWindowMinutes: () =>
|
||||
mocks.preferences?.activityWindowMinutes ?? DEFAULT_ACTIVITY_WINDOW_MINUTES,
|
||||
}))
|
||||
|
||||
vi.mock('@/stores/sessionStatusStore', async (importOriginal) => {
|
||||
@@ -619,6 +619,35 @@ describe('SessionPickerDialog', () => {
|
||||
expect(onSelectRepo).toHaveBeenCalledWith(mocks.repos[0])
|
||||
})
|
||||
|
||||
it('navigates the projects tab with wrapping arrows, PageUp/PageDown and Enter', async () => {
|
||||
mocks.repos = Array.from({ length: 12 }, (_, index) =>
|
||||
repo(index + 1, `repo-${index + 1}`, `/w/r${index + 1}`),
|
||||
)
|
||||
const { onSelectRepo } = renderPicker()
|
||||
|
||||
openProjectsTab()
|
||||
|
||||
expect(await screen.findByRole('option', { name: 'repo-1' })).toHaveAttribute(
|
||||
'aria-selected',
|
||||
'true',
|
||||
)
|
||||
|
||||
fireEvent.keyDown(combobox(), { key: 'ArrowUp' })
|
||||
expect(screen.getByRole('option', { name: 'repo-12' })).toHaveAttribute('aria-selected', 'true')
|
||||
|
||||
fireEvent.keyDown(combobox(), { key: 'ArrowDown' })
|
||||
expect(screen.getByRole('option', { name: 'repo-1' })).toHaveAttribute('aria-selected', 'true')
|
||||
|
||||
fireEvent.keyDown(combobox(), { key: 'PageDown' })
|
||||
expect(screen.getByRole('option', { name: 'repo-11' })).toHaveAttribute('aria-selected', 'true')
|
||||
|
||||
fireEvent.keyDown(combobox(), { key: 'Enter' })
|
||||
expect(onSelectRepo).toHaveBeenCalledWith(mocks.repos[10])
|
||||
|
||||
fireEvent.keyDown(combobox(), { key: 'PageUp' })
|
||||
expect(screen.getByRole('option', { name: 'repo-1' })).toHaveAttribute('aria-selected', 'true')
|
||||
})
|
||||
|
||||
it('opens a repo on click in the projects tab', async () => {
|
||||
mocks.repos = [repo(1, 'alpha', '/w/a'), repo(2, 'beta', '/w/b')]
|
||||
const { onSelectRepo } = renderPicker()
|
||||
@@ -765,13 +794,25 @@ describe('SessionPickerDialog', () => {
|
||||
openActiveTab()
|
||||
|
||||
expect(
|
||||
await screen.findByText('No active or recent sessions in the last 120 minutes'),
|
||||
await screen.findByText('No active or recent sessions in the last 2 hours'),
|
||||
).toBeInTheDocument()
|
||||
expect(screen.queryByText('Needs input')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('Running')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('Recent')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('formats a full-day active work window as hours in the empty state', async () => {
|
||||
mocks.preferences = { activityWindowMinutes: 1440 }
|
||||
|
||||
renderPicker()
|
||||
openActiveTab()
|
||||
|
||||
expect(
|
||||
await screen.findByText('No active or recent sessions in the last 24 hours'),
|
||||
).toBeInTheDocument()
|
||||
expect(mocks.activeWorkWindowMs).toBe(1440 * 60 * 1000)
|
||||
})
|
||||
|
||||
it('opens the cursor active row with Enter and selects its session and repo', async () => {
|
||||
mocks.repos = [repo(1, 'alpha', '/w/a'), repo(2, 'beta', '/w/b')]
|
||||
mocks.activeWorkGroups = {
|
||||
|
||||
Reference in new issue
Block a user