Repository navigation
List other drives' trash in Trash - #138
Conversation
What's deleted on another mounted drive goes to that drive's own trash (.Trash-$uid at its top), which Trash never listed: it couldn't be seen, restored or deleted, and with the home trash empty there was no Empty Trash to press either. Trash now lists every trash folder FileOps::trashDirs() finds, sorted together, and watches those with something in them. Restore, Delete and Empty Trash already worked on any of them. Fixes omacom#137 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The reviewed changes appear safe to merge; both numbered previous findings are fixed. SummaryThe PR combines home and mounted-drive trash in one listing and searches them together.
Reviews (5) · Last reviewed commit: "Share a search's limit across the trashe..." · Reviewed by Greptile |
A search in Trash looked only in the home trash, missing what Trash lists from other drives. And another drive's trash was watched only once it had something in it, so what was trashed there into an empty trash, or a drive's first trash, didn't show until Trash was opened again. Trash's search now runs over every trash's files folder, sorted together and limited in all. Its listing, off the window's thread, also says what to watch: each trash's files folder, empty or not, and the top of each writable drive without a trash yet, where the first trash on it is made. A folder watched for the first time is read once more, for anything that arrived before it was watched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A drive's first trash is made a folder at a time: .Trash-<uid>, then its files folder. Trash watched the drive's top until the files folder was there, and a top folder isn't told what's made in its folders, so what was trashed after a listing that ran in between didn't show. Trash now watches the deepest folder of a drive's trash there is so far (and the drive's shared .Trash, or its folder for the user, when there's one). And once a drive has its trash, its top is no longer watched: Trash stops watching what its latest listing doesn't name, so changes there don't list every trash again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The maintainer asked for this to be as simple as it can be. Trash lists and searches every trash's files folder through one listTrash(), on the listing thread, and watches another drive's trash once it has shown something from it. Trash no longer watches the top of every writable drive for a first trash to appear. That watched /tmp and /run/user/<uid>, so ordinary activity there re-listed Trash, and each re-listing looked over every mount again. A drive's first trash, made while Trash is open, now shows the next time Trash is opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watching only the trashes something was listed from missed an empty one: what another app, or another Folio pane, trashed onto that drive while the trash was open didn't show until it was opened again. The listing now hands back the trash folders it found, and each one's files folder is watched, as the home trash's is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed and run on a disposable Omarchy worker. #137 is real and this fixes it. The maintainer asked for this pull request to be as simple as it can be, so I pushed a smaller version of it to your branch, plus one fix. One problem is left, and the maintainer needs to decide how to fix it. The bug. I loop-mounted a user-owned ext4 image at Pushed: a321d55, "List every drive's trash with less." The approach is still yours: list each trash's Pushed: a3abbca, "Watch every drive's trash while the trash is shown." In the smaller version, another drive's trash was watched only once it had shown an item. If that trash was empty when Trash opened, anything trashed there later (by another app or another Folio pane) didn't show. On the worker, a file trashed with Conflict. The branch conflicted with main's f5cbc03 (#93, "Tell the trash from the path, without asking every drive") in Left for the maintainer: a drive that stops answering. Each Trash listing now checks every mounted drive, on the app's shared thread pool. I froze an rclone FUSE mount at Clicking Empty Trash still counts every drive's trash on the window's thread through Tests. The full suite passed on a worker: 203 passed at this head, and 209 passed and 1 skipped with this branch merged into current main. One earlier merged run hit the known 5 s timeout in Second opinion. Codex (medium effort) and muse-wonder (via pi, high thinking) reviewed this in two rounds. Codex found the missing watch on an empty trash, which is why a3abbca exists. Both confirmed the frozen-mount problem from the code and agree that fixing it is a design decision. I rejected one Codex claim. It said Folio's own operations reload the pane, but that connection is the translator's, and the pane updates only through the watcher. In the second round, both found nothing more to change. Both models could read this review's working notes, so their agreement isn't fully independent. This now waits on the maintainer: whether to keep Trash listings off the shared pool before merging, and approval to run CI. |
Simplifying listTrash() dropped two things the original searchTrash() and listTrash() had. Each trash got a fresh 1000-match limit, so a search kept going through later drives after earlier ones had filled it. And nothing checked stop between trashes, so a listing left behind still went on to read each remaining drive. One limit now covers every trash, no further drive is searched once it is reached, and a listing that is stopped returns before the next drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Greptile's two notes on a3abbca were right, and the fault was ours. When we simplified this pull request in a321d55, we dropped two things your
Two assertions were added to Codex (medium effort) and muse-wonder (via pi, high thinking) reviewed the commit and found nothing wrong with it. They also compared your original version line by line with the simplified one, looking for anything else it shouldn't have dropped. What else was dropped, and why:
I've replied on each Greptile thread with the commit that answers it. Both models could read this review's notes, so their agreement isn't fully independent. This still waits on the maintainer. They need to decide whether Trash listings move off the shared thread pool before merging: a drive that stops answering can tie up every listing thread. They also need to approve the CI run for this fork. |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |



Fixes #137.
Something deleted on another mounted drive goes to that drive's own trash (
.Trash-$uidat its top), but Trash only listed~/.local/share/Trash/files. Those items couldn't be seen, restored or deleted one at a time, and when the home trash was empty the Empty Trash bar (visible: pane.inTrash && backend.folder.count > 0) disappeared, so there was nothing to click.Change
FolderModel::list()sends the home trash'sfilesfolder to a newFolderModel::listTrash(), which lists every folderFileOps::trashDirs()finds and sorts them all together. This runs on the background listing thread, so the mount sweep stays off the GUI thread (see UI freezes on every navigation: inTrash() sweeps all mounts on the GUI thread (dead sshfs mount = multi-second hangs) #80).filesfolders that have items in them are watched too.restoreOne,deleteTrashed/infoFileForandemptyTrashalready handle every trash folder. Because the listing count now includes other drives, Empty Trash shows up whenever any trash has items.Testing
trashListsEveryDrivesTrash: one item in the home trash and two in another drive's trash are listed and sorted together, a drive with no trash folder is skipped, and the listing stops when it's interrupted.bin/test: all pass (191 passed, 12 skipped).<mount>/.Trash-1000/files/<file>, and deleting it removes both the item and its note.🤖 Generated with Claude Code