Inline download progress for result files (#24)¶
Motivation¶
Downloading a result file showed only a spinner — no sense of how much was left,
which is rough for large (multi-MB) .out / XML results streamed through the api
sidecar.
User-facing change¶
- The download button now shows live progress while a file downloads: a percent
when the server sends
Content-Length, otherwise the received byte count (e.g.42%or2.3 MB). The blob is still fully materialised, so the actual download behaviour is unchanged — only the feedback is richer.
Code change summary¶
- web/src/api/blast.ts:
downloadResultFilegained an optionalonProgress(received, total)callback and streams the response body via aReadableStreamreader (falls back to a one-shotresponse.blob()when the body stream or callback is absent). - web/src/hooks/useBlastResultActions.ts:
added
downloadProgressstate (exportedBlastDownloadProgresstype), wired the callback, cleared it infinally. - Threaded
downloadProgressthrough ResultsCard → ResultsBody → BlastResultsTable (ResultsFileTable/ArtifactDetails) →BlastResultRow, which renders the percent/bytes label next to the spinner.
Validation evidence¶
cd web && npm run build→ clean.cd web && npm test -- --run→ 929 passed (full suite).npx eslinton the five changed files → clean.
No backend / API / IaC changes (the streaming endpoint already exists).