fix(frontend): upload a dropped folder's contents instead of a 0-byte pseudo-file - #5635
Conversation
…d explorer fix(frontend): thread dropped-file paths through the staging inbox and explorer
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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
dropEntries.ts: readsdataTransfer.itemssynchronously (the list is only alive during the event), takeswebkitGetAsEntry()per item, and recursively walks directory entries.readEntriesis called until it returns an empty batch, since it caps each batch. The walk is a pure helper with 9 unit tests.{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.Implicit decisions and their tradeoffs
name::size::lastModifiedtorelativePath::size::lastModified, otherwise same-named files in two subfolders silently collapse. Identical behavior for top-level files.webkitdirectory, since folder-picking via the button would be a new affordance, not a bug fix.Stacked on #5625 (the multipart transport fix); base is that branch so this diff shows only the walk.
https://claude.ai/code/session_01McMogkcDRV7UpSAjfd8VKG