android icon indicating copy to clipboard operation
android copied to clipboard

Recycle bin

Open 0x4f53 opened this issue 1 year ago • 0 comments

:recycle: Current situation

Accidents can happen when you're in a hurry. When you tap the delete button, the item is permanently deleted. If you do this on accident, you lose data forever.

:bulb: Proposed solution

Adding support for a "deleted items" feature, which kinda works like the .Trash directory on some Linux distros or Recycle Bin on Windows. This section lets you:

  • Restore an item
  • Delete an item forever
  • Restore all items
  • Delete all items forever

📷 Screenshots

Account dialog Delete confirmation dialog Deleted items menu
Screenshot_20230206-105715 Screenshot_20230206-105739 Screenshot_20230206-094656

📚 Release Notes

KeyspaceFS changes

Added a boolean value called deleted to KeyspaceFS. This value is set to false by default (for the first time / when an item is created). If the item is being edited, the trash icon appears on the editing screen. Tapping that icon sets the value to true after user confirmation, then writes that change to

  • The local vault KeyspaceFS file
  • The backend, via a PUT request

When the deleted items list is displayed, the vault is first sorted by recently edited items to (for obvious reasons).

UI changes

Added a new button called "Deleted items" to the user account menu on the Dashboard.

📝 Testing

Deleting an item

  • Create a login, note or card.
  • Save it.
  • Edit it.
  • Tap the delete icon.
  • Go back to the Dashboard and tap the user account icon → Deleted items.
  • You will see your deleted item here.

Restoring an item

  • Go to the Dashboard and tap the user account icon → Deleted items.
  • You will see your deleted items here.
  • Tap on an item, then tap restore.
  • Go back to the Dashboard. You will see the item reappear here.

0x4f53 avatar Feb 06 '23 05:02 0x4f53