Skip to content

fix(frontend): upload a dropped folder's contents instead of a 0-byte pseudo-file - #5635

Merged
mmabrouk merged 2 commits into
release/v0.107.0from
fix/drive-folder-drop-walk
Aug 1, 2026
Merged

fix(frontend): upload a dropped folder's contents instead of a 0-byte pseudo-file#5635
mmabrouk merged 2 commits into
release/v0.107.0from
fix/drive-folder-drop-walk

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Aug 1, 2026

Copy link
Copy Markdown
Member

What was broken

Dragging a folder into the Files drawer created a single 0-byte file named after the folder. The drop handlers read dataTransfer.files, and a directory arrives there as an empty pseudo-file. Closes #5626.

Fix

  • New dropEntries.ts: reads dataTransfer.items synchronously (the list is only alive during the event), takes webkitGetAsEntry() per item, and recursively walks directory entries. readEntries is called until it returns an empty batch, since it caps each batch. The walk is a pure helper with 9 unit tests.
  • Files flow as {file, relativePath} pairs through the existing upload machinery, so a nested file posts to ${destFolder}/${relativePath} and the progress UI renders it under its folder while in flight.
  • All three drop affordances covered: folder-row drop, open-folder background drop, and drop-to-stage on a recents peek (staging now carries paths so the tree survives until a destination is picked).

Implicit decisions and their tradeoffs

  • Uploads now go through a small FIFO gate (4 concurrent). Before, a 500-file folder would fire 500 concurrent requests. Retry uses the same gate.
  • The dedup key moved from name::size::lastModified to relativePath::size::lastModified, otherwise same-named files in two subfolders silently collapse. Identical behavior for top-level files.
  • The file-picker button is unchanged: no webkitdirectory, since folder-picking via the button would be a new affordance, not a bug fix.
  • No new user-facing strings; per-file failures surface through the existing upload error state.

Stacked on #5625 (the multipart transport fix); base is that branch so this diff shows only the walk.

https://claude.ai/code/session_01McMogkcDRV7UpSAjfd8VKG

…d explorer

fix(frontend): thread dropped-file paths through the staging inbox and explorer
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 1, 2026 4:48pm

Request Review

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bf45e0f6-86fa-43c9-bf6c-3e96b82407fa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dosubot dosubot Bot added the frontend label Aug 1, 2026
@mmabrouk
mmabrouk changed the base branch from fix/drive-upload-multipart to release/v0.107.0 August 1, 2026 18:16
@mmabrouk
mmabrouk merged commit ed83a26 into release/v0.107.0 Aug 1, 2026
40 of 41 checks passed
@mmabrouk
mmabrouk deleted the fix/drive-folder-drop-walk branch August 1, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant