Skip to content

feat: add drag-drop file upload#1258

Open
bittoby wants to merge 2 commits intoeigent-ai:mainfrom
bittoby:feat/drag-drop-file-upload
Open

feat: add drag-drop file upload#1258
bittoby wants to merge 2 commits intoeigent-ai:mainfrom
bittoby:feat/drag-drop-file-upload

Conversation

@bittoby
Copy link
Contributor

@bittoby bittoby commented Feb 13, 2026

Close: #156

Description

This PR implements drag-and-drop file upload functionality in the chatbox, allowing users to drag files directly into the input area instead of using the file picker button.

What this PR solves:

  • Users can now drag and drop files into both empty and active chatboxes
  • Files are properly processed through Electron's webUtils.getPathForFile() API to handle context isolation
  • Visual feedback shows a blue border and "Drop files to attach" overlay during drag operations
  • Success/error toast notifications provide clear feedback to users
test.webm

Technical implementation:

  • Added IPC handler process-dropped-files in main process
  • Exposed webUtils.getPathForFile() via preload script for secure file path access
  • Updated InputBox component with async drag-drop handlers
  • Enabled drag-drop on both empty and active chatbox states
  • Added comprehensive error handling and console logging for debugging

What is the purpose of this pull request?

  • New Feature
  • Bug fix
  • Documentation update
  • Other

@bittoby
Copy link
Contributor Author

bittoby commented Feb 13, 2026

@Wendong-Fan @Pakchoioioi Please review this PR

// Use Electron's webUtils.getPathForFile to get file paths
const fileData = dropped.map((f: File) => {
try {
const path = window.electronAPI.getPathForFile(f);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we get the absolute path as maybe there are symlinks.

];
console.log('[Drag-Drop] Setting files:', newFiles);
onFilesChange?.(newFiles);
toast.success(`Added ${result.files.length} file(s)`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that now agent will not look at these attached files? If so we can notify user it will be supported soon something like that.


console.log('[Drag-Drop] Processing dropped files:', dropped.length);

// Use Electron's webUtils.getPathForFile to get file paths
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move these to another helper function?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] The task box supports drag-and-drop file uploads.

4 participants