Repository navigation
fix(app): stop the composer dropzone flickering and showing for text drags - #60746
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Looks good. I ran the new composer e2e test on the base: it fails both at the text-drag check (the dropzone shows) and at the file-drag check (the dropzone element is unmounted and remounted when the drag moves onto the editor's text). With this change, both dropzone tests in composer.spec.ts pass. packages/app unit tests and tsc -b are clean. Workspace-tree drags still open the dropzone, because startFileDrag sets text/uri-list.
Public API is unchanged (onDragLeave → clearDrag is internal to the app).
No concerns.


Summary
drag.enterstate, so the text drags that feat(app): drag-n-drop to @mention file #12569 treated as @mention drags now opened the file dropzone. It also added the editordragleavehandler that clears the state.dragoverlistener treated any drag that carriedtext/plainas a file drag. When you dragged a selection in the composer, "Drop images, PDFs, or files to add" covered the page.dragleavecleared the drag state every time the pointer moved between the editor's own nodes. The nextdragoverset it again, so the dropzone unmounted, remounted, and restarted its fade on each move.dragoverowns the drag state. The editor no longer sets or clears it. The dropzone opens only for drags that carryFiles(from the system) ortext/uri-list(file rows from the workspace tree).Before
drag-before.mp4
After
drag-after.mp4
Implementation
attachments.ts:dragoversets the state from the drag's types:interaction.ts/editor.tsx: The editor'sdragenteronly callspreventDefault(), and it has nodragleavehandler.onDragLeaveis nowclearDrag. The session controller calls it when the composer becomes hidden.composer.spec.ts: A new keeper checks two things. A text drag shows no dropzone. When a file drag moves onto the editor's text, the dropzone element stays mounted and visible.Visual