feat(drag-and-drop): implement workspace item drag-and-drop functiona…#1413
feat(drag-and-drop): implement workspace item drag-and-drop functiona…#1413
Conversation
…lity and reference insertion
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR introduces drag-and-drop support for workspace file nodes into the chat input box. Users can now drag files and folders from the workspace tree and drop them as workspace references in the chat input. A new utility module handles the custom drag payload format and reference text generation, with updates to chat input components, file mention suggestions, and corresponding tests. Changes
Sequence DiagramsequenceDiagram
actor User
participant WorkspaceFileNode
participant DataTransfer as Drag Payload
participant ChatInputBox
participant TipTap as TipTap Editor
User->>WorkspaceFileNode: dragstart on file node
WorkspaceFileNode->>DataTransfer: setChatInputWorkspaceItemDragData()<br/>(path, isDirectory)
DataTransfer->>DataTransfer: Store via custom MIME type
User->>ChatInputBox: dragover on input
ChatInputBox->>ChatInputBox: onDragOver()<br/>preventDefault() & set dropEffect
User->>ChatInputBox: drop on input
ChatInputBox->>DataTransfer: getChatInputWorkspaceItemDragData()
DataTransfer-->>ChatInputBox: Parsed payload (path, isDirectory)
ChatInputBox->>ChatInputBox: buildChatInputWorkspaceReferenceText()
ChatInputBox->>ChatInputBox: resolveChatInputWorkspaceReferencePath()
ChatInputBox->>TipTap: insertContent(`@workspace/path` )
TipTap->>TipTap: Insert reference into editor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…lity and reference insertion
20260331_162142.mp4
Summary by CodeRabbit
New Features
Tests