feat(ui): dock repo and session tools in a desktop side panel

Add a docked desktop tool panel with an icon rail, driven by the shared panel URL param, and keep the mobile dialogs and drawers. Extract dialog bodies into reusable content components, rename the walkthrough dialog to a sheet, and make walkthrough generation asynchronous with client polling.
This commit is contained in:
Chris Scott committed 2026-10-07 23:58:56 -04:00
1 parent bdbcc60716
commit 485ab940aa
49 files changed
+2631 -1753

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { FetchError, fetchWrapper } from './fetchWrapper'
function respondWith(body: string, status: number) {
vi.stubGlobal('fetch', vi.fn(async () => new Response(body, { status })))
}
describe('fetchWrapper error bodies', () => {
afterEach(() => {
vi.unstubAllGlobals()
})
it('uses the JSON error message', async () => {
respondWith(JSON.stringify({ error: 'Session not found', code: 'NOT_FOUND' }), 404)
await expect(fetchWrapper('/api/x')).rejects.toMatchObject({ message: 'Session not found', statusCode: 404, code: 'NOT_FOUND' })
})
it('keeps a plain-text error body', async () => {
respondWith('upstream unavailable', 502)
await expect(fetchWrapper('/api/x')).rejects.toMatchObject({ message: 'upstream unavailable' })
})
it('replaces an HTML error page with a status message', async () => {
respondWith('<!DOCTYPE html><html><body>A timeout occurred</body></html>', 524)
const error = await fetchWrapper('/api/x').catch((caught: unknown) => caught)
expect(error).toBeInstanceOf(FetchError)
expect((error as FetchError).message).toBe('Request failed with status 524')
})
})