Fixed workspace UI freeze during large multi-file uploads#1
Draft
tariqismail wants to merge 1 commit into
Draft
Conversation
Selecting many files uploaded them one at a time while the workspace version poller kept firing full tree refreshes, saturating the browser's ~6 connections-per-origin limit and making the page appear frozen until the batch finished. Uploads now run with bounded concurrency, pause version polling for the duration of a batch, and refresh the tree once at the end. A progress indicator shows the count and current file and can cancel the remaining queue, and large selections prompt for confirmation before starting. Adds a UI-page test asserting the upload progress markup renders and documents the behavior in docs/visual-workspace-ui.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
Selecting a large batch of files to upload in the
/workspaceUI makes the whole page appear to freeze until the upload finishes. It is not a server or resource problem — the backend accepts the requests fine and never hits a memory limit.Root cause
uploadFilesToFolderuploaded files strictly one at a time. Meanwhile the 4s workspace version poller (pollWorkspaceVersion) sees the version change after every uploaded file and fires a full tree refresh + open-tab recheck. The serialized uploads plus the polling/refresh traffic saturate the browser's ~6 connections-per-origin limit, so the UI's own requests (clicks, navigation, tree loads) queue behind the batch and the tab looks frozen until it drains.Fix (client-side only)
UPLOAD_CONCURRENCY = 3) instead of strict one-at-a-time — drains faster without monopolizing the connection pool.uploadInProgressguard inpollWorkspaceVersion) and do a single tree refresh when it finishes, instead of one per file.#upload-progress) showing count + current file; cancelling stops the remaining queue.The progress element is static markup in
workspace.html(toggled by JS), mirroring the existingchat-working-indicatorpattern, so it is covered by atest_ui_pagesassertion.Tests
test_workspace_renders_upload_progresstoagent/tests/test_ui_pages.py(server-rendered HTML assertion, matching the existing UI tests).python tests/test_ui_pages.py→ 5/5 pass.npm run build(vite) builds cleanly.Notes
workspace.bundle.jsis gitignored and not included.docs/visual-workspace-ui.mdupdated to describe the new upload behavior.