Skip to content

feat: add move to trash to the file menu - #148

Merged
itsjoshpark merged 4 commits into
mainfrom
feat/move-to-trash
Sep 26, 2026
Merged

itsjoshpark merged 4 commits into
mainfrom
feat/move-to-trash

Conversation

@itsjoshpark

Copy link
Copy Markdown
Owner

Description:

Finishing a video and wanting it gone meant switching to the Finder to find it. File > Move to Trash now trashes the playing file, closes the player window and returns to the welcome window. There is no keyboard shortcut.

Holding Option turns the item into Delete Immediately.... It asks first, the way the Finder does (“Are you sure you want to delete “file.mkv”?” / “This item will be deleted immediately. You can’t undo this action.”), and then deletes the file without going through the Trash.

  • The file's recents entry is removed too, so the welcome window doesn't list a file that is gone.
  • The welcome window opens before the player closes, since closing the last window quits the app.
  • A file that can't be removed, such as one on a volume with no Trash, leaves the player open and shows an alert with the reason.
  • The confirmation and the failure are SwiftUI alerts held by PresentationModel, so they share the one alert slot with the conversion and recent-file alerts. Both items are disabled while any sheet or alert is up, as the Playback items are.

Testing

  • Unit tests pass, including a new PresentationModelTests case for the removal alert's slot.
  • UI tests pass for Move to Trash, and for Delete Immediately with both Cancel and Delete.
  • Not checked by hand yet: that the menu title visibly flips when Option is held, and which button Return presses in the confirmation.

Finishing a video and wanting it gone meant switching to the Finder to find
it. File > Move to Trash now trashes the playing file, closes the player
window and returns to the welcome window. Holding Option turns the item into
Delete Immediately..., which asks first, the way the Finder does, and then
deletes the file without going through the Trash.

Either way the file's recents entry goes too, so the welcome window doesn't
list a file that is no longer there. The welcome window is opened before the
player closes, since closing the last window quits the app. A file that can't
be removed, such as one on a volume with no Trash, leaves the player as it was
and says why.

The confirmation and the failure are SwiftUI alerts held by
PresentationModel, so they share the one alert slot with the conversion and
recent-file alerts rather than appearing over them.
The six strings added with Move to Trash shipped untranslated. Fifteen
languages get them, worded after the Finder's own Delete Immediately
confirmation and matching the catalog's existing form of address and
quotation marks in each. Arabic, Greek, Finnish, Hungarian, Romanian, Turkish
and Vietnamese are left for translators.
The Delete button removed whatever was playing when it was clicked. A file
opened from the Finder while the confirmation was up replaced the playing one,
so Delete removed that file, unconfirmed and unrecoverably, and left the one
the alert named. Removal now takes the file it is meant for and does nothing if
that is no longer the one playing.

Also put a test's doc comment back above the test it describes.
Move to Trash and the Delete confirmation each removed the file and then
switched windows themselves, and only one of them explained why the welcome
window has to open before the player closes. Both now go through
FileRemover, which holds that order in one place.

FileRemover also takes the playing file, the recents store and the
presentation model as dependencies rather than reaching for the shared
instances. That puts the check against deleting a file other than the one the
confirmation named under unit tests, along with the recents cleanup and the
failure alert.
@itsjoshpark
itsjoshpark merged commit 8eb8f33 into main Sep 26, 2026
2 checks passed
@itsjoshpark
itsjoshpark deleted the feat/move-to-trash branch September 26, 2026 05:40
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.

1 participant