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

Undo deletion (of files, users, contacts etc) #3216

Open
jancborchardt opened this issue Jan 23, 2017 · 16 comments
Open

Undo deletion (of files, users, contacts etc) #3216

jancborchardt opened this issue Jan 23, 2017 · 16 comments

Comments

@jancborchardt
Copy link
Member

(Since the relevant pull request was closed, opening this to track the feature: #1610 )

We should offer undo for destructive actions. This is a normal software pattern now (see Gmail, Android etc) and is very nice as opposed to modal windows. Also read Never Use a Warning When you Mean Undo

cc @nextcloud/javascript @ChristophWurst

@skjnldsv
Copy link
Member

What style of popup/modal/notification do we want for that?

@jancborchardt
Copy link
Member Author

jancborchardt commented Feb 22, 2017

I would say showNotification is fitting in this case. We used that before I think in the News app or somewhere else.

@jancborchardt
Copy link
Member Author

@schiessle mentioned that this could be done by triggering the restore function of the »Deleted files« app. Might be good as a first working implementation. :)

cc @icewind1991 @ChristophWurst

@skjnldsv
Copy link
Member

What about a menu like the contact menu with a count indicator (like the notification icon) of how many items are still in the undo section?
On each item we could have a progressbar to display how many time left the user have before final deletion?

@jancborchardt
Copy link
Member Author

@skjnldsv a counter is not really necessary and strangely obstructive. That’s also not how any other undo mechanism works which people are used to from Google or Apple apps. :)

@jancborchardt
Copy link
Member Author

Traditional tri-yearly postponing of this issue to the next milestone. 🎉

@biva
Copy link

biva commented Mar 8, 2018

I like this idea and agree with @jancborchardt about the counter: we should keep it simple, as anybody can still go to the deleted files section to recover deleted files. The objective should remain a quick possibility to correct an unwanted deletion.

Any chance to see it happening in NC14? I'd be particularly interested in seeing this possibility anywhere in NC, including apps (incl. contacts, calendar, deck)

@ChristophWurst
Copy link
Member

Any chance to see it happening in NC14? I'd be particularly interested in seeing this possibility anywhere in NC, including apps (incl. contacts, calendar, deck)

Totally. Would you be interested in implementing this functionality?

@biva
Copy link

biva commented Mar 8, 2018

I'd love to... but I don't have any skills in coding. Available for testing though

@Quix0r
Copy link

Quix0r commented Mar 17, 2019

The simplest way would be to add a column deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0. More advance is deleted_at DATETIME/TIMESTAMP NULL DEFAULT NULL while default is not deleted (obviously).

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Mar 17, 2019
@korelstar
Copy link
Member

I was thinking about how to implement undo for deleted notes in the Notes app. My idea was:

Don't delete the object when the user wants to delete it, but just mark it as deleted on the client frontend and show an undo button. After seven seconds, remove the button and delete the object in the backend.

Drawback of this approach: if the client looses the connection to the server during these seven seconds, the object can't be finally deleted. Is this anyway a valid approach for generalization? The advantage is that it's implementation is relatively easy (only frontend).

@Quix0r
Copy link

Quix0r commented Mar 17, 2019

You are running through open door here. :-) Mine was exactly the same with a specific idea for the database side.

@natrius

This comment has been minimized.

@marcelklehr
Copy link
Member

if the client looses the connection to the server during these seven seconds, the object can't be finally deleted. Is this anyway a valid approach for generalization?

@korelstar Good point. What do you say @jancborchardt ?

@ecc86
Copy link

ecc86 commented Jun 8, 2021

Drawback of this approach: if the client looses the connection to the server during these seven seconds, the object can't be finally deleted. Is this anyway a valid approach for generalization? The advantage is that it's implementation is relatively easy (only frontend).

Wouldn't it be possible to have something like a cron job in the backend handle such requests of deletion? The frontend would then only communicate, that the file to be deleted will be gone in minimum 7 seconds and maximum $cron_repeat_time_for_delete_requests (or something).

Sorry I am just a hobbyist developer, no more coding expierience in PHP for many years..

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Mar 10, 2023

I just lost all of my contacts in Nextcloud because Outlook decided that a deletion of its contact via the Google Contacts Android application deletes all linked contacts. I can't believe that I can see all of my contacts in the activity log, but that no recycle bin of sorts exists.

This is really necessary.

By the way, @jancborchardt, http://alistapart.com/article/neveruseawarning was exactly the reason that I accidentally did this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Enhancements
Status: 🧭 Planning evaluation / ideas
Development

No branches or pull requests