Skip to content

fix(web): dropped folders no longer become failed attachments - #2

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789516908-skip-folder-drops
Closed

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789516908-skip-folder-drops

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Fixes pingdotgg#11961

What Changed

makeWorkspaceFileDropHandlers.onDrop now reads dataTransfer.items when the browser exposes it and skips any item whose webkitGetAsEntry() reports a directory; only real files reach host.addFiles. When items is unavailable it falls back to the old dataTransfer.files path. The shared handler covers both the composer drop zone and sidebar thread drops.

function droppedFiles(dataTransfer): File[] {
  if (dataTransfer.items === undefined) return Array.from(dataTransfer.files);
  // items: skip kind !== "file", skip webkitGetAsEntry()?.isDirectory, keep getAsFile() !== null
}

Tests: mixed folder + file drop forwards only the file; folder-only drop forwards []; existing files-only fallback still covered.

Why

Chromium surfaces a dropped folder in dataTransfer.files as a File with 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

  1. vp run dev, pair the browser, open a new thread in any project.
  2. Drag a folder from the OS file manager onto the composer.
  3. Before: an error banner (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):

before

After (folder drop is ignored):

after

After (regular image drop still attaches):

after-file

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 11bca9cf-462d-4232-96b5-a7741823893e

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Sep 16, 2026
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>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1789516908-skip-folder-drops branch from b7a4f3b to 486a1b7 Compare September 16, 2026 00:17
@devin-ai-integration

Copy link
Copy Markdown
Author

Evidence for upstream pingdotgg#12001 (revised behavior):

after-desktop-chip

after-browser-toast

@devin-ai-integration

Copy link
Copy Markdown
Author

Evidence for upstream pingdotgg#12001 (browser, local environment):

after-browser-chip

after-browser-missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dropped folders become failed file uploads

1 participant