Repository navigation
Upload a message box's files in parallel, with progress - #609
Open
thiblahute wants to merge 1 commit into
Open
thiblahute wants to merge 1 commit into
thiblahute wants to merge 1 commit into
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.uploadFailureMessagenames 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 throughuploadInOrder; 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.rememberComposerAttachmentnow 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 inuploadInOrder; 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 onmain.bun run format:check,bun run lint,bun run typecheck:bun,bun run build:web,bun run test:quickwith an isolatedHOME/TMPDIR.Manual checks