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

Conversation

Projects
None yet
4 participants
@50Wliu
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

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 50Wliu added the needs-review label Sep 13, 2017

@50Wliu

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link

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 added some commits Jan 3, 2019

@50Wliu

This comment has been minimized.

Copy link
Member Author

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 minimized.

Copy link

commented Apr 10, 2019

Any news on this?

@50Wliu

This comment has been minimized.

Copy link
Member Author

commented Apr 10, 2019

It's waiting for someone from the team to review it.

@matt3224

This comment has been minimized.

Copy link

commented Apr 10, 2019

26 pull requests makes me think we are in for a wait. Tree view is a critical part of the Atom experience, it needs more love!

@rafeca rafeca self-assigned this Apr 26, 2019

@rafeca

rafeca approved these changes Apr 26, 2019

Copy link
Contributor

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! 😍

Show resolved Hide resolved lib/tree-view.coffee Outdated

rafeca and others added some commits Apr 26, 2019

Update lib/tree-view.coffee
Co-Authored-By: 50Wliu <50Wliu@users.noreply.github.com>
@50Wliu

This comment has been minimized.

Copy link
Member Author

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

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@50Wliu 50Wliu deleted the wl-move-conflicting-files branch Apr 26, 2019

@50Wliu 50Wliu referenced this pull request May 14, 2019

Merged

Copy files on drop if control is pressed #1257

4 of 5 tasks complete

50Wliu added a commit that referenced this pull request May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.