trash/mac: list shows all items regardless of original path #9
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/canola-collection#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The macOS trash adapter's `list` function returns every item in `~/.Trash` without filtering by original directory. The freedesktop and Windows adapters compare each item's `original_path` against the current URL to show only items that belonged there; the macOS adapter has no such logic.
Navigating to e.g. `canola-trash:///Users/user/projects/` shows all trashed items from every directory, not just those originally under `~/projects/`.
A `TODO` comment at line 81 of `lua/canola/adapters/trash/mac.lua` notes this explicitly.
Solution
Read macOS-specific metadata to recover the original path of each trashed item. Options include:
The right approach likely mirrors how freedesktop reads `.trashinfo` files: iterate items in `~/.Trash`, recover their original path, and filter against the requested URL.