Make delete, rename and move undoable

A delete is no longer a removal: it is a move into a hidden .plainfiles-trash folder on the same volume, which costs a rename and keeps the item recoverable. The snackbar offers Undo for delete, rename and a pasted cut; the handle is cleared as soon as it is used.

domain/Trash carries four deliberate limits: the trash lives on the users own volume, so it counts against their free space until it expires (24 hours, purged opportunistically, no startup hook and no empty-trash chore); a name taken again in the meantime is never overwritten, so an item returns beside it; a delete through Androids own dialog is not staged because the system owns it; and each item is staged in its own slot so two files sharing a name cannot overwrite each other on the way in. When a pasted move landing names cannot be established with confidence, no undo is offered rather than risking the wrong file moving back.
This commit is contained in:
2026-10-15 09:06:24 +02:00
parent 77acb80f17
commit 02780c97e5
8 changed files with 685 additions and 13 deletions
+9 -3
View File
@@ -54,6 +54,7 @@
<string name="browser_action_share">Share</string>
<string name="browser_action_select_all">Select all</string>
<string name="browser_action_clear_selection">Clear selection</string>
<string name="browser_action_undo">Undo</string>
<string name="browser_action_more">More options</string>
<string name="browser_action_refresh">Refresh</string>
<string name="browser_action_cancel">Cancel</string>
@@ -130,9 +131,14 @@
<item quantity="one">Moved %1$d item</item>
<item quantity="other">Moved %1$d items</item>
</plurals>
<plurals name="message_deleted">
<item quantity="one">Deleted %1$d item</item>
<item quantity="other">Deleted %1$d items</item>
<!-- What a delete says now that it stages instead of removing: recoverable, not gone. -->
<plurals name="message_deleted_undo">
<item quantity="one">Moved %1$d item to the trash</item>
<item quantity="other">Moved %1$d items to the trash</item>
</plurals>
<plurals name="message_undone">
<item quantity="one">Put %1$d item back</item>
<item quantity="other">Put %1$d items back</item>
</plurals>
<plurals name="message_failed">
<item quantity="one">%1$d item could not be processed</item>