-
Add Fetch Request pipeline UI with real-time SSEs (#8)
released this
2026-05-30 15:58:48 +00:00 | 11 commits to main since this releaseSummary
Add Fetch Request pipeline UI with real-time SSE progress tracking, ambiguity resolution, list page with filtering/retry, and detail page with stepper/event feed.
Changes
New files
src/FetchRequestDetail.tsx(+675 lines) — Full detail page for a single fetch request with:- SSE connection for real-time pipeline progress (
/fetch-requests/:id/events) - 4-step stepper (Extract → Raw Expense → Enrich → Save) with active/completed/failed/paused states
- Granular progress bar (10% Extract, 20% Raw Expense, 50% Enrich, 20% Save)
- Progress event feed with auto-scroll and deduplication (only latest
progressper step, hidesstartedwhen terminal event follows) - Ambiguity resolution cards with candidate selection buttons
- Retry support with retry-count progress bar
- Failure/success snackbar notifications
- Error display for failed fetch requests
- SSE connection for real-time pipeline progress (
Modified files
react-openapi/api/client.ts— addedapi.patch()method for PATCH requestsreact-openapi/hooks/useResource.ts— addedusePatch()mutation hook for partial updates with cache invalidationsrc/FetchRequests.tsx(+347/−73 lines) — Major list page rewrite:- Row-level actions: retry (failed <3 retries), navigate to detail (paused), delete with confirmation dialog
- Filter bar: status multi-select, account text filter, file/email source toggle
- Account name autocomplete from API
- Format dropdown driven by
resourceOverridesconfig - Date pickers (changed from
datetime-localtodate) - Copy fingerprint button, retry count display, date range column
- Row click navigates to detail, sorted by
created_atdesc pausestatus support instatusColors- 409 conflict handling on duplicate fingerprint
formatApiError()for 422 validation error display
src/features/fetch-requests/fetch-requests.models.ts— Added types:pausedtoFetchRequestStatusFetchRequestUpdateinterfaceretry_counttoFetchRequestinterfaceraw_lines,txn_blocks,txn_dicts,txn_dict_count/txn_dicts_countto source typesPendingAmbiguity,AmbiguityCandidate,ResolveAmbiguityPayloadSSEEvent,SSEEventStep,SSEEventStatus,ProgressMessageFetchRequestFiltersformatApiError()helper for FastAPI 422 error parsingRETRY_MAX = 3constant
src/features/fetch-requests/index.ts— Barrel exports for all new types, hooks, and helperssrc/features/fetch-requests/useFetchRequests.ts— Added hooks:useUpdateFetchRequest()— PATCH viausePatchuseFetchRequestAmbiguities(id)— queries/fetch-requests/:id/ambiguitiesuseResolveAmbiguity()— posts to/ambiguities/:id/resolvewith cache invalidation
src/main.jsx— Added route/fetch-requests/:id→FetchRequestDetail
Key decisions
- SSE event stream is the single source of truth for progress; REST is only fallback for page load
- Stepper shows granular ratio-based progress counts (e.g.
150/246for enrich) pipeline/failedSSE event triggers refetch + error snackbarload_contentevents excluded from event feed entirely- Enrich/Save progress counts come only from SSE (no REST fallback since those phases don't pause)
Reviewed-on: #8
Co-authored-by: Vishesh 'ironeagle' Bangotra aetoskia@gmail.com
Co-committed-by: Vishesh 'ironeagle' Bangotra aetoskia@gmail.comDownloads