notes icon indicating copy to clipboard operation
notes copied to clipboard

copy/move notes when changing the notes path

Open Rexaris opened this issue 5 years ago • 6 comments

Describe the bug When changing the storage location existing notes get deleted. Actually, the old "Notes" directory remains, but the txt-files wont moved to the new location.

To Reproduce Steps to reproduce the behavior:

  1. create at least one note
  2. Change "Folder to save your notes" to e.g. "Documents/Notes"
  3. all previously created notes are gone
  4. Look at the HD on the old location: all note-files are existing

Expected behavior All Existing notes gets copied to the new location.

Server (please complete the following information):

  • Notes app version: 3.0.3
  • Nextcloud version: 16.0.5
  • OS: Raspbian 9.11 (Kernel: 4.19.57-v7+)
  • Web server: apache2
  • PHP version: 7.3.9
  • Database: mysql 10.1.38

Client (please complete the following information):

  • Browser (incl. version): Google Chrome (mobile) 77.0.3865.92
  • OS: Android 7.1.1

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Rexaris avatar Oct 08 '19 19:10 Rexaris

That's indeed a good enhancement which we should implement. It's similar to https://github.com/stefan-niedermann/nextcloud-notes/issues/127. We should provide three options:

  1. move existing notes to new path
  2. copy existing notes to new path
  3. don't touch existing notes

I'm unsure on how to implement the user workflow and how to style the whole thing. My first idea is that the three options are shown after changing the path in the settings (clicking on the arrow or putting focus somewhere else after editing the notes path field). In order to prevent a modal dialogue, we could replace the existing settings component with those three options and a cancel button.

Any idea on how this should look like, @nextcloud/designers ?

korelstar avatar Oct 13 '19 06:10 korelstar

I think the common use-case is to move the files to the new location. If we have three options this should definitely be preselected.

All in all i do believe, that not providing options but simply always move the files should be totally enough. advanced scenarios can be performed in the files app if needed.

stefan-niedermann avatar Oct 13 '19 08:10 stefan-niedermann

All in all i do believe, that not providing options but simply always move the files should be totally enough.

Hmmm. I like the current behavior (don't touch existing notes) and I use it frequently (for testing the notes app). Furthermore, I believe that moving files without announcement and/or the possibility to cancel this is very dangerous (if I set the notes directory to a shared folder, then my existing private notes can become accidentally public!). Hence, the best default behavior is to do nothing. Anything else can be done manually, afterwards. So if we change the behavior, let's do it right and provide those three options.

korelstar avatar Oct 13 '19 08:10 korelstar

Hmm, i agree that moving files to a shared folder is a risc.

Maybe this can be combined with an "undo"-toast which basically says "Notes moved to xxx. [Move files back]".

Alternatively "Notes directory changed to xxx. [Move old notes]" … though i still prefer directly moving the files.

I know for testing and development purposes it seems to be fine, but in productive use, i simply would expext it (Oh, i want my notes in "documents" not in the root folder. le's move it there - and wonder why there are no notes after change the setting - oh no? did it just delete all my notes!!?)

This would not interrupt the user.

stefan-niedermann avatar Oct 13 '19 09:10 stefan-niedermann

Even without copying the old notes it would be an issue if you (accidentally) choose a public folder. Maybe a Hint just in that case would be enough.

I think most user want the notes copied, and just a minority doesnt want to copy the notes. The question is: How to deal with conflicts?

Rexaris avatar Oct 13 '19 11:10 Rexaris

All in all i do believe, that not providing options but simply always move the files should be totally enough. advanced scenarios can be performed in the files app if needed.

Agree with @stefan-niedermann here. While the other scenarios might be useful for testing the Notes app, most app users are not testing or developers, they just want things to work. :)

jancborchardt avatar Feb 26 '20 08:02 jancborchardt