fix(web): dropped folders no longer become failed attachments - #2
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced 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 |
Dropping folders in Chromium staged an attachment that failed to upload and blocked Send. Filter directory entries from dropped files before passing them to the composer while preserving the files fallback for browsers without DataTransfer items. Made with Devin (Claude) via Devin. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
b7a4f3b to
486a1b7
Compare
|
Evidence for upstream pingdotgg#12001 (revised behavior): |
|
Evidence for upstream pingdotgg#12001 (browser, local environment): |
Fixes pingdotgg#11961
What Changed
makeWorkspaceFileDropHandlers.onDropnow readsdataTransfer.itemswhen the browser exposes it and skips any item whosewebkitGetAsEntry()reports a directory; only real files reachhost.addFiles. Whenitemsis unavailable it falls back to the olddataTransfer.filespath. The shared handler covers both the composer drop zone and sidebar thread drops.Tests: mixed folder + file drop forwards only the file; folder-only drop forwards
[]; existingfiles-only fallback still covered.Why
Chromium surfaces a dropped folder in
dataTransfer.filesas aFilewith an empty type and no readable contents. The composer treated it as a real attachment, which produced a failed/blocking attachment (or, with the current image-only composer, an "Unsupported file type for 'sample-folder'" error). Dropping a folder should just be a no-op for that entry rather than staging something that can never upload. This does not add folder references or a toast — it only stops folders from being treated as files.Reproduce
vp run dev, pair the browser, open a new thread in any project.Unsupported file type for 'sample-folder'…) appears and nothing usable is attached. After: the drop is ignored; dropping a real image still attaches it.UI Changes
Before (folder drop):
After (folder drop is ignored):
After (regular image drop still attaches):
Checklist
Verified with
vp test run apps/web/src/components/chat/workspaceFileDrop.test.ts, web typecheck, and targeted lint.Written by Claude (Devin harness).
Link to Devin session: https://app.devin.ai/sessions/f8f4775e52774156bee9327338af577f
Open in Devin Desktop: https://app.devin.ai/desktop/session/f8f4775e52774156bee9327338af577f?variant=devin