Drop external folders onto the Tree View to create new project folders#1209
Drop external folders onto the Tree View to create new project folders#1209
Conversation
| # Drop event from OS | ||
| for file in e.dataTransfer.files | ||
| @moveEntry(file.path, newDirectoryPath) | ||
| else if e.dataTransfer.files.length |
There was a problem hiding this comment.
Would e.dataTransfer.files be undefined ?
There was a problem hiding this comment.
Good question. files is a standard DataTransfer property that will always be available. https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/files
There was a problem hiding this comment.
Thanks for the info. BTW it says that dataTransfer exists on all drag events. Good News.
|
I looked into implementing drag-and-drop indicators. It will be harder than I thought because then you'll have to differentiate between moving external folders into existing projects or whether to create a new project folder for it. I'll punt that for a later PR. |
|
Note that as of 2018-03-06 , this request remains unreleased in the Atom core editor with the tree-view core package at v221.3 or v222 based on https://github.com/atom/tree-view/releases |
|
Share a shell snippet for checking releases # atom latest releases and corresponding tree-view version
$ curl https://api.github.com/repos/atom/atom/releases/latest -s | grep 'tag_name'
"tag_name": "v1.24.0",
$ curl https://raw.githubusercontent.com/atom/atom/v1.24.0/package.json -s | grep 'tree-view'
"tree-view": "0.221.3", |
|
@here we're dealing with tree-view spec failures that need to be fixed before we feel comfortable updating it in Atom itself. Sorry for the delay. |
Requirements
Description of the Change
Implements the popularly-requested feature #480. Basically if no existing folder is selected the Tree View adds the entries in the data transfer event as new project folders. There are a few rough edges with this implementation, such as but not limited to:
Alternate Designs
No alternatives were considered.
Benefits
External folders can now be dragged-and-dropped into the Tree View to be added as project folders.
Possible Drawbacks
I don't believe there are any drawbacks with this other than the limitations addressed above.
Applicable Issues
Fixes #480