Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI for moving conflicting entries #1180

Merged
merged 13 commits into from Apr 26, 2019
Merged

Add UI for moving conflicting entries #1180

merged 13 commits into from Apr 26, 2019

Conversation

@50Wliu
Copy link
Member

@50Wliu 50Wliu commented Sep 12, 2017

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

When an EEXIST error is encountered when drag-n-dropping files, Atom would previously bail out and refuse to move the file. However, most OSes handle EEXIST by displaying a dialog and asking if the user would like to replace the existing file with the one being moved. Atom now does the same. This also works for multiple directories, where readdirSync will be performed on the directory and each entry will be moved.

Alternate Designs

None.

Benefits

The decision whether to overwrite files when drag-n-dropping can now be done inside of Atom.

Possible Drawbacks

I'm not sure there are any.

Applicable Issues

Fixes #860

@50Wliu
Copy link
Member Author

@50Wliu 50Wliu commented Sep 12, 2017

conflicting-files-ui
Cancelling will stop any further files from the same move event from being moved. For example, if you're moving 5 conflicting files and you cancel at the 3rd file, the 3rd-5th files won't be moved.

@50Wliu
Copy link
Member Author

@50Wliu 50Wliu commented Sep 13, 2017

I think this is ready for general review + testing, though I may continue polishing and adding tests during the next few days.

Quite disappointed how difficult it was to test this. It should become much easier once the files are converted to JS and async/await becomes available.

@50Wliu 50Wliu force-pushed the wl-move-conflicting-files branch from fd2b6eb to 4a93d15 Oct 19, 2017
@brycefranzen
Copy link

@brycefranzen brycefranzen commented Sep 26, 2018

When will this issue be fixed? Still throws "failed to move entry" in latest version of atom.io (1.31.0) :/ Would like to see this resolved.

@50Wliu
Copy link
Member Author

@50Wliu 50Wliu commented Jan 3, 2019

Note: the dialog box is currently sync, due to the lack of async/await in Coffeescript...

@matt3224

This comment has been hidden.

@50Wliu

This comment has been hidden.

@matt3224

This comment was marked as off-topic.

@rafeca rafeca self-assigned this Apr 26, 2019
rafeca
rafeca approved these changes Apr 26, 2019
Copy link
Contributor

@rafeca rafeca left a comment

LGTM! 🎉

I just left a small change suggestion to make sure that this works for symlinks, otherwise is good to go.

I really appreciate that you added some tests, and how you decided to handle the "Cancel" use case! 😍

lib/tree-view.coffee Outdated Show resolved Hide resolved
rafeca and others added 2 commits Apr 26, 2019
Co-Authored-By: 50Wliu <50Wliu@users.noreply.github.com>
@50Wliu
Copy link
Member Author

@50Wliu 50Wliu commented Apr 26, 2019

to avoid handling symlinks as directories

Tried to add a test for this...turns out renaming duplicate symlinks on Windows throws an EPERM error rather than an EEXIST, so that's outside of the scope of this PR 🤷‍♂.

@50Wliu 50Wliu merged commit 1ed4b03 into master Apr 26, 2019
2 checks passed
@50Wliu 50Wliu deleted the wl-move-conflicting-files branch Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants