fix(activity): report failed worktree lookups instead of showing partial session lists

This commit is contained in:
Chris Scott committed 2026-10-16 20:50:35 +00:00
1 parent bfbbbf08ef
commit 62c2eb8aed
5 files changed
+35 -4

No files matched your search

@@ -425,6 +425,14 @@ describe('DesktopSessionTree', () => {
expect(await screen.findByText('Failed to load sessions')).toBeTruthy()
})
it('shows the error state when the worktree siblings lookup fails', async () => {
getRepoSiblingsMock.mockRejectedValue(new Error('siblings failed'))
render(<DesktopSessionTree />, { wrapper: createWrapper(['/repos/1']) })
expect(await screen.findByText('Failed to load sessions')).toBeTruthy()
})
it('creates a session in the repo full path', async () => {
const user = userEvent.setup()
render(<DesktopSessionTree />, { wrapper: createWrapper(['/']) })
@@ -206,6 +206,8 @@ function RepoSessionList({ repo, onSelectSession }: RepoSessionListProps) {
)
if (siblings.isLoading) return <SessionNavStatus>Loading sessions...</SessionNavStatus>
if (siblings.isError && siblings.data === undefined)
return <SessionNavStatus>Failed to load sessions</SessionNavStatus>
return <RepoSessionListItems repo={repo} worktrees={worktrees} onSelectSession={onSelectSession} />
}