Closed
Conversation
- Add global isDraggingFiles state to app store - Implement full-window drag overlay in MainLayout - Move drop handling from FileExplorer to MainLayout - Files can now be dropped anywhere in the window and will be imported to explorer - Overlay shows 'Drop files here' message with blur effect - Automatically hides overlay after drop or cancel
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.
This PR adds and fixes multiple bugs with the Drag & Drop functionality and perfects the workflow for importing external .md files into the Cinder Notes application. Previously, there were event bubbling conflicts and UI flickering issues when dragging files above the app window.
✨ Key Changes
Resolved Drag Event Conflict: Updated drag handlers in FileExplorer.tsx to explicitly ignore external file drags (e.dataTransfer.types.includes('Files')). This correctly allows the drag events to bubble up to the MainLayout, avoiding the scenario where the sidebar intercepted drops intended for the whole app.
Fixed Overlay Flickering: Improved handleWindowDragLeave in MainLayout.tsx by using !e.currentTarget.contains(e.relatedTarget as Node) instead of e.currentTarget === e.target. This ensures the "Drop files here" overlay remains solidly visible when dragging over editor child elements, instead of unexpectedly hiding.
App-wide Drag Initialization: Added handleWindowDragEnter to naturally trigger the file drop overlay the instant an external file enters the window boundaries.
Preserved File Tree Functionality: Ensured that native (internal) workspace drag-and-drop operations, like moving files to the root, remain cleanly separated from cross-application file imports.