feat: expand webchat drag-and-drop upload to the whole chat area - #9564
Merged
Soulter merged 3 commits intoAug 7, 2026
Conversation
The full-area drop handler was only attached to .conversation-stack (the non-project branch), and ChatInput's own handlers were removed, so project mode lost drag-and-drop upload entirely. Hoist dragEvents and the overlay to .chat-main so all three branches (provider / project / conversation) are covered; guard the drop and hide the overlay while the provider workspace is active. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use onScopeDispose so a timeout left pending when the component unmounts mid-drag can't write to the composable's state afterwards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wcqqq1214
marked this pull request as ready for review
August 6, 2026 05:33
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The drag-upload CSS for
.chat-drop-overlay,.chat-drop-overlay-content,.chat-drop-text, and.drop-fade-*is duplicated in bothChat.vueandStandaloneChat.vue; consider extracting this into a shared style (or a global utility class) to avoid divergence and simplify future changes. - In
Chat.vuethedragEventsfromuseDragUploadare still attached even whenisProviderWorkspaceis true, and the onDrop handler just returns early; if drag-and-drop is meant to behave normally in provider workspace, consider disabling the composable or skippingpreventDefaultin that mode to avoid intercepting drags that won’t lead to an upload.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The drag-upload CSS for `.chat-drop-overlay`, `.chat-drop-overlay-content`, `.chat-drop-text`, and `.drop-fade-*` is duplicated in both `Chat.vue` and `StandaloneChat.vue`; consider extracting this into a shared style (or a global utility class) to avoid divergence and simplify future changes.
- In `Chat.vue` the `dragEvents` from `useDragUpload` are still attached even when `isProviderWorkspace` is true, and the onDrop handler just returns early; if drag-and-drop is meant to behave normally in provider workspace, consider disabling the composable or skipping `preventDefault` in that mode to avoid intercepting drags that won’t lead to an upload.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Soulter
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 动机
Drag-and-drop file/image upload in the webchat/ChatUI currently only works when dropping onto the small input composer bar. The hot zone is too small, so dragging onto the message area gives no response and the feature is easy to miss. This PR expands the drop zone to the whole right-side chat area (message list + composer). Fixes #9561.
Modifications / 改动点
Added
useDragUploadcomposable (dashboard/src/composables/useDragUpload.ts) encapsulating the drag state, overlay visibility, and drop handling.ChatInput.vue: removed its own drag handlers/overlay so a single drop is not uploaded twice via event bubbling.Chat.vue: wireddragEventsand a full-area drop overlay onto.conversation-stack.StandaloneChat.vue: same handling on the root container.This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
Before / 改动前
Dragging a file onto the message area currently shows no overlay and does not upload — the hot zone is limited to the bottom input bar.
Dropping onto the message area does nothing.
The hot zone is only the input bar.
After / 改动后
Dropping anywhere in the right-side chat area shows the full-area upload overlay and triggers the same upload flow.
Full-area upload overlay on drop.
Image upload verified — the model reads the uploaded image correctly.
Verification Steps / 验证步骤
vue-tsc --noEmitandvite buildpass.Checklist / 检查清单
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
/ 我的更改经过了良好的测试,并已在上方提供了"验证步骤"和"运行截图"。
/ 我确保没有引入新依赖库。
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Expand drag-and-drop file upload to cover the entire chat area in both embedded and standalone chat views using a shared composable.
New Features:
Enhancements:
Summary by Sourcery
Expand drag-and-drop upload to cover the entire chat area in embedded and standalone webchat views using a shared composable.
New Features:
Enhancements: