Skip to content

Upload a message box's files in parallel, with progress - #609

Open
thiblahute wants to merge 1 commit into
powerfooI:mainfrom
thiblahute:upstream/upload-progress
Open

thiblahute wants to merge 1 commit into
powerfooI:mainfrom
thiblahute:upstream/upload-progress

Conversation

@thiblahute

Copy link
Copy Markdown
Collaborator

Summary

Upload the files of a message box in parallel, keep their order, and show progress.

Why

Images picked in the chat's message box, and files added to the terminal composer, uploaded one after another with only "Uploading file…" to show for it: a batch of photos from a phone took a long time with no sense of how far it was. A file that failed also dropped every file after it.

What changed

  • web/src/uploadInOrder.ts (new): uploads three files at a time; the results keep the order the files were picked in, and a failure is kept per file instead of aborting the batch. uploadFailureMessage names the files that did not upload and why.
  • web/src/components/UploadProgressBar.tsx (new): "Uploading 3/8" over a thin bar, summed over every batch going up at once (two pastes in a row).
  • AgentHistoryComposer.tsx: the chat's images go through uploadInOrder; each image's thumbnail shows (dimmed) as soon as it is up, and they enter the draft together, in picked order, once the batch is done. rememberComposerAttachment now returns the attachment it remembers.
  • TerminalComposer.tsx: the same for files added to the terminal composer; the paths that uploaded are kept when another file fails.
  • FEATURES.md (Mobile and PWA, the Message box paragraph).

Verification

  • bun test web/src/uploadInOrder.test.ts web/src/components/AgentHistoryComposer.test.tsx web/src/components/TerminalComposer.uploads.test.ts: concurrency, order, failures and progress in uploadInOrder; the chat box uploads four images three at a time, shows "Uploading 1/4" and the early thumbnail, and inserts the paths in picked order; the terminal composer keeps picked order and the uploaded paths on a failure. The composer tests fail on main.
  • bun run format:check, bun run lint, bun run typecheck:bun, bun run build:web, bun run test:quick with an isolated HOME/TMPDIR.
  • Asset budget: unchanged (initial JS 832.3/833 KiB, gzip 256.7/257 KiB); the composers are lazy chunks.

Manual checks

  • In a chat, pick eight photos: "Uploading n/8" counts up, thumbnails appear as each lands, and the draft gets the paths in picked order.
  • Turn the network off mid-batch: the error names the files that did not upload; the ones that did stay in the draft.
  • In the terminal composer, add several files: same progress, paths in picked order.

Images picked in the chat's message box, and files added to the terminal
composer, now upload three at a time instead of one after another, and
land in the box in the order they were picked. While they go up, the box
says "Uploading 3/8" over a thin bar, and the chat shows each image's
thumbnail as soon as it is up. A file that fails no longer drops the
others: they are kept, and the error names the file that did not upload
and why.
@github-actions github-actions Bot added the enhancement New feature or request label Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant