Skip to content

TEN-30: Implement trash management service and Tauri commands#5

Open
nicolas-agentzero wants to merge 2 commits intomainfrom
feature/ten-30-trash-management
Open

TEN-30: Implement trash management service and Tauri commands#5
nicolas-agentzero wants to merge 2 commits intomainfrom
feature/ten-30-trash-management

Conversation

@nicolas-agentzero
Copy link
Copy Markdown
Collaborator

Summary

Implements TEN-30 trash management in the codebase with a new core TrashService and Tauri commands for desktop integration.

What was implemented

Core (tentacle-core)

  • Added new module: core/src/trash.rs
  • Added and exported pub mod trash; in core/src/lib.rs
  • Implemented TrashService APIs:
    • list_trash(documents_folder)
    • recover_item(documents_folder, trash_path, strategy)
    • delete_permanently(documents_folder, trash_path)
    • clear_trash(documents_folder)
    • run_auto_cleanup(documents_folder) (30-day retention)
    • get_trash_stats(documents_folder)
  • Implemented path safety validation for trash_path (relative-only, no traversal)
  • Implemented conflict-safe recovery strategy:
    • original_location (fails if destination exists)
    • with_suffix (restores as name (1).md, etc)
  • Added payloads for UI/backend integration:
    • TrashedItem
    • TrashListResult
    • TrashStats
    • RecoveryResult

Desktop/Tauri bridge (frontend/src-tauri)

Added commands in frontend/src-tauri/src/lib.rs:

  • list_trash_items
  • recover_trash_item
  • delete_trash_item_permanently
  • clear_trash_items
  • run_trash_auto_cleanup
  • get_trash_stats

And registered all of them in the Tauri invoke handler.

Tests

Added unit tests in core/src/trash.rs for:

  • listing trash items
  • restoring to original path
  • suffix recovery on destination conflict

Notes

  • This PR covers backend/service + Tauri command surface.
  • Frontend trash UI wiring can now be built on top of these commands.

nicolas-agentzero and others added 2 commits March 1, 2026 14:45
- Add core TrashService with list/recover/delete/clear/auto-cleanup APIs
- Add recovery strategies (original location or suffix-on-conflict)
- Add trash stats payloads for UI badge/count integration
- Expose trash commands via Tauri invoke handler
- Add unit tests for listing + recovery behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants