feat(web): drag files from the explorer into the chat composer#4140
feat(web): drag files from the explorer into the chat composer#4140yordis wants to merge 2 commits into
Conversation
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (drag-and-drop from file explorer to chat composer) with new modules and integration between two systems. New user-facing capabilities warrant human review regardless of implementation quality. You can customize Macroscope's approvability policy. Learn more. |
Dropped mentions bypassed the project-selection and pending-input guards and skipped the leading boundary, so a drop after existing text rendered raw markdown instead of a pill. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Screen.Recording.2026-07-18.at.4.47.25.PM.mov |
Note
Low Risk
UI-only composer and file-browser interaction changes with unit tests; no auth, API, or data-layer changes.
Overview
Users can drag workspace file-tree rows onto the chat composer to insert the same serialized file-link mentions as the context menu, instead of the gesture doing nothing.
The file browser tags row drags with a custom
application/x-t3code-composer-mentionpayload (single or multi-selection), enables row dragging without in-tree reordering, suppresses “open file” on selection changes during a drag, and deselects dragged rows when the drag ends. ChatComposer handles these drags in the capture phase (native stop propagation,movedrop effect, no synchronous editor focus) so the Lexical editor does not overwrite the insert; it reuses shared end-of-prompt insert logic and shows an error toast when the composer cannot accept input. OS file drops and non-row text drags are left unchanged.Reviewed by Cursor Bugbot for commit c3f8442. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add drag-and-drop support for files from the explorer into the chat composer
fileTreeDragMentioncontroller in fileTreeDragMention.ts that interceptsdragstartevents on file tree rows and populates the drag data store with serialized composer mention payloads.composerMentionDraghandlers in composerMentionDrag.ts that detect these payloads on drop and insert file-link mentions at the end of the composer prompt.Macroscope summarized c3f8442.