Skip to content

Add move files mode #9

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

Open
rjcrz88 opened this issue Sep 29, 2021 · 9 comments
Open

Add move files mode #9

rjcrz88 opened this issue Sep 29, 2021 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest-accepted Your PR is valid and has been qualified for hacktoberfest

Comments

@rjcrz88
Copy link

rjcrz88 commented Sep 29, 2021

Add move mode for dropping files (instead of just copying files), that would be great if added :)

@rjcrz88 rjcrz88 changed the title Add copy mode Add move files mode Sep 29, 2021
@GameGodS3 GameGodS3 added enhancement New feature or request good first issue Good for newcomers labels Sep 29, 2021
@GameGodS3
Copy link
Owner

I have only read that Electron API's drag-and-drop can copy files. So to implement a move, we might have to delete the source after the copy was successful. Pretty sure that can be done by adding a function for deleting on completion.

Marking this as a good first issue, especially since Hacktoberfest is round the corner.
Thank you,
Cheers

@srijit2002
Copy link

@GameGodS3 I want to work on this issue. Can you please guide me?

@has12zen
Copy link

hi, @srijit2002 if you would like we can work on this together.

@all1000
Copy link

all1000 commented Sep 30, 2021

Thanks for the great app...I wish if you add Cut Instead of deleting mannuly ... it's important

@GameGodS3
Copy link
Owner

GameGodS3 commented Sep 30, 2021

@srijit2002 @has12zen
Maybe use this as a starting point.
https://stackoverflow.com/questions/55328916/electron-run-shell-commands-with-arguments

Considering @all1000 's request since on further thought it makes more sense, I think if you both could modify the drag function of the existing app to instead execute a copy command. When required, copy can be replaced with a move.

Remember to write code for all three platforms (Windows, Mac and Linux) when coding the solution.
Cheers

@GameGodS3 GameGodS3 added the hacktoberfest-accepted Your PR is valid and has been qualified for hacktoberfest label Oct 2, 2021
@tyropro
Copy link

tyropro commented Oct 1, 2022

Has any advancement on this been made?

@GameGodS3
Copy link
Owner

@tyropro Thanks for asking.

Lemme tell you the progress, so to speak, so far.
We were initially planning on executing shell commands to move files when a dragout happens. Although we haven't completely ruled out the possibility of implementing it that way, I thought it would be better to implement it in a way that I came across in an article.

I stumbled upon this while I was looking at native approaches for drag-and-drop in electron.
https://www.fileside.app/blog/2019-04-22_fixing-drag-and-drop/

In a very simplified summary, what's mentioned in the article is that we could use C++ modules to run along with the electron process so that it becomes easier to use native system calls provided by the OSs in C++ (which is much more easily accessible than it is for JavaScript).

Why I, personally, think this is the better idea is because of the upcoming features that could be added to DropPoint. This includes the aforementioned move mode, holding Shift for copy - alt for shorcut - ctrl for move, a mouse-shake gesture for opening DropPoint, using native thumbnails for files rather than custom icons, etc... These are better implemented in C++ and therefore having a start at it through this would be nice.

However, this approach comes with some pretty substantial caveats. Firstly, often times the documentation for such native modules are pretty sparse (*cough Win... *cough ....dows). Secondly, doing so would require extra effort for writing custom modules for Windows, MacOS and Linux (and its gazillion varieties) separately, which would be a huge overhead. There might be more caveats, but these two were what I could pull out of my head as I write this.

I am also considering to contribute to the actual Electron project itself so that these changes may just directly come from the framework which is much more convenient, and could help a lot more people too.

I am only still learning this method. So far, I am exploring node-gyp and how to use it. And I would love to have some company of others who could learn these and discuss about them together here. So if you (or anyone reading this) is interested in taking up this task, please feel free.

Cheers

@tyropro
Copy link

tyropro commented Oct 1, 2022

Thanks for the update. I'm unable to help (sorry) and I hope this can be implemented into electron in the future. Good luck :)

@AnuraagReddy123
Copy link

Hey is there an update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest-accepted Your PR is valid and has been qualified for hacktoberfest
Projects
None yet
Development

No branches or pull requests

7 participants