Skip to content

feat(frontend): support drag-and-drop upload with reusable file dropzone#609

Draft
yiboyasss wants to merge 4 commits into
xorbitsai:mainfrom
yiboyasss:feat/home-input-drag-upload
Draft

feat(frontend): support drag-and-drop upload with reusable file dropzone#609
yiboyasss wants to merge 4 commits into
xorbitsai:mainfrom
yiboyasss:feat/home-input-drag-upload

Conversation

@yiboyasss

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a reusable FileDropzone component to consolidate and simplify file drag-and-drop functionality across the application, replacing duplicate drag-and-drop event handling in both the home page and the main chat input component. The review feedback highlights layout issues caused by the new wrapper div in FileDropzone stretching unexpectedly. To resolve this, the reviewer suggests adding support for a className prop on the FileDropzone component and applying appropriate width constraints (max-w-[780px] w-full and w-full) where it is integrated.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread frontend/src/components/file/file-dropzone.tsx
Comment thread frontend/src/components/file/file-dropzone.tsx
Comment thread frontend/src/components/file/file-dropzone.tsx
Comment thread frontend/src/app/page.tsx
Comment thread frontend/src/components/chat/ChatInput.tsx
@yiboyasss

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the file drag-and-drop functionality by introducing a reusable FileDropzone component and integrating it into both the home page and the chat input component, which simplifies state management and removes duplicate event-handling code. The review feedback highlights two important improvements for the new FileDropzone component: first, always call preventDefault() and stopPropagation() on drop events even when the component is disabled to prevent accidental browser navigation; second, add a useEffect hook to reset the dragging state if the component becomes disabled during an active drag operation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread frontend/src/components/file/file-dropzone.tsx
Comment thread frontend/src/components/file/file-dropzone.tsx Outdated
@yiboyasss

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a reusable FileDropzone component to encapsulate drag-and-drop file upload logic, replacing duplicate custom implementations in the Home and ChatInput pages. Feedback on the new component suggests wrapping the resetDragState function in React.useCallback to prevent dependency issues in useEffect, and ensuring that drag-and-drop events are not intercepted when the dropzone is disabled.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread frontend/src/components/file/file-dropzone.tsx Outdated
Comment thread frontend/src/components/file/file-dropzone.tsx
@yiboyasss yiboyasss marked this pull request as draft June 11, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants