thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/mobile
Apache License 2.0
11.11k stars 2.51k forks source link

Add a confirmation action for permanently deleting emails #7707

Open PhilC813 opened 9 months ago

PhilC813 commented 9 months ago

Checklist

App version

6.800

Problem you are trying to solve

Prevent accidental deletion of emails in the "Trash", since after they're gone from there, they're gone for good.

One scenario when this can happen (as it just did to me): You delete an email from inbox, then realize you still had to check something. You go to the trash to get the email back, and verify what you needed to. Then, when you're done with it, you may forget that it's already in the trash, and so you click the "Delete" button again; it's gone for good.

Suggested solution

Add something similar to the Outlook for Android implementation (default), where a confirmation message is shown before being able to delete an email from the "Trash" folder, and which specifies that the deletion will be permanent.

Screenshots / Drawings / Technical details

Add a new action to the already existing "Confirm actions" menu of the Interaction settings section; maybe something called "Delete (in Trash)".

Screenshot_20240308-152951-452

I would assume that, by default, the confirmation message for these actions are generic, and so if this new action was to be implemented, having a personalized message (like done by Outlook devs) would be beneficial. Otherwise, a user who has multiple confirm actions enabled might confirm without thinking twice, which defeats the whole purpose of the confirmation feature.

beradeep commented 8 months ago

@cketti I am new to this project. I hope my PR solves this issue. Would like you to review it.

PhilC813 commented 8 months ago

Thank you for committing to this!

Would the confirmation also appear for when you delete a message located in the trash but that you fetched using the search? In this context, it would make sense to have the message specify that it will be deleted from the trash, since search results, as of now, do not indicate the folder that messages are located in.

beradeep commented 8 months ago

Thanks, I looked into it. Right now, I think there isn't any way to find out whether a result from a search in the unified inbox belongs to the trash folder.

cketti commented 8 months ago

I don't think this should be limited to deleting messages from the trash folder. The app should ask for confirmation whenever a message is about to be deleted permanently. That includes deleting messages from the trash folder, but also applies when no trash folder is configured and deleting a message would permanently delete it right away.

I suggest using the following messages:

A special case is deleting multiple messages from the message list. In that case some messages could be deleted permanently while others will be moved to the trash folder.

I suggest the following message for this special case:

beradeep commented 8 months ago

Yes, that makes a lot of sense.

PhilC813 commented 8 months ago

Definitely the best way to implement this indeed! Well thought.

With that said, it would require a verification of the folder in which the selected messages are located. As @beradeep said, you can get a list of messages from multiple folders in the unified inbox, but it can also be the case if you initiate a search from any folder, and then change the mode to "search everywhere". — @beradeep said this capability doesn't seem possible currently.

cketti commented 8 months ago

It is possible to find out what folder a message is in. The app also uses this information to decide whether to move the message to the trash folder or delete it permanently. But that's a detail that belongs to the pull request discussion, not here.