feat(editor): add internal object like drag and drop functionality#2878
feat(editor): add internal object like drag and drop functionality#2878
Conversation
palmer-cl
commented
Apr 21, 2026
- Added internal drag-and-drop support for structured content and existing rendered images
- Added post-paint interaction layers and editor styling so rendered SDTs and images become draggable in the DOM.
- Creates a shared SDT identifier module
- Expanded automated coverage for the new behavior.
…nt resolution - Added internal node move logic to handle drag-and-drop operations for nodes within the editor. - Introduced structured content resolution helpers to find structured content blocks and inlines by position and ID. - Enhanced EditorInputManager to utilize new structured content resolution methods for better drag-and-drop handling. - Created comprehensive tests for drag-and-drop behavior involving existing images and structured content. - Implemented helper functions for simulating drag-and-drop events in tests.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 852fbe08bd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }; | ||
|
|
||
| for (const fragment of Array.from(container.querySelectorAll<HTMLElement>(`.${DOM_CLASS_NAMES.IMAGE_FRAGMENT}`))) { | ||
| if (fragment.querySelector?.(`[data-image-metadata]`) == null) continue; |
There was a problem hiding this comment.
Detect metadata on image fragment roots
Update the block-image filter to include metadata on the fragment element itself. collectImageRoots() currently skips a block fragment unless fragment.querySelector('[data-image-metadata]') finds a descendant, but the DOM painter writes data-image-metadata on the fragment root for normal block images (see renderer behavior around fragmentEl.setAttribute('data-image-metadata', ...)). In that common case the fragment never gets draggable/data-drag-source-kind, so block images cannot participate in the new internal drag-move flow.
Useful? React with 👍 / 👎.