Skip to content

feat: move archives to Trash after extracting from Finder - #330

Open
athousanddetails wants to merge 3 commits into
sarensw:mainfrom
athousanddetails:feat/trash-archive-after-extraction
Open

athousanddetails wants to merge 3 commits into
sarensw:mainfrom
athousanddetails:feat/trash-archive-after-extraction

Conversation

@athousanddetails

@athousanddetails athousanddetails commented Oct 12, 2026 •

Copy link
Copy Markdown

Reopened copy of #316. The original was closed when my fork was deleted by mistake; the code is unchanged. Screenshots that were hosted on the old fork may no longer load.

What & why

A new General setting, off by default: "Move archive to Trash after extracting from Finder". Once Finder's Extract Here, Extract to "" or Extract to… has extracted the whole archive successfully, the archive goes to the Trash. There is no further question, because the Trash itself is the way back. Every volume of a split set goes with it. A failed or cancelled extraction leaves the archive where it is.

This replaces the cleanup part of #285 and the confirmation sub-option in #296, as one small change on current main. There is no Core cleanup engine and no extra dialog. It is one setting, one check, and FileManager.trashItem.

  • ArchiveState.lastExtractionState records how the last extract(to:smart:) ended. The progress center drops finished jobs when its window closes, so a caller that waited for the end reads the result here.
  • ArchiveState.sourceFiles returns the archive's file. For a split set, it returns every volume of the set in the archive's folder, matched by the existing splitSetName.
  • AppUrlHandler.extractArchive moves sourceFiles to the Trash only when the setting is on and the state is .done.
  • The new string follows the catalog's manual-key pattern, English only, with a comment.

How it was verified

  • New tests in ExtractionProgressTests: extractFullArchiveRecordsItsOutcome and sourceFilesCoverEveryVolumeOfASplitSet (set.z01, set.z02 and set.zip are included; other.zip and set.txt are not). The full suite passes.
  • Debug build with the setting on, Finder extractHere URL. The log shows Moved extracted archive to the Trash {"file":"test.zip"}, the contents were extracted, and no dialog appeared.
  • A truncated zip: the extraction failed, the archive stayed in place, and the failure window was shown.

Settings screenshot to follow.

Changelog

Added: 1.1.0, feat, issue 330, in all 16 languages.

Checklist

  • Verification evidence is included above
  • Changelog entry added to Config/products/macpacker.json
  • AI involvement disclosed: Claude Code wrote the code and ran the tests above under my account. I reviewed the change and tested it on my Mac.

A new General setting, off by default: once Finder's Extract Here,
Extract to <folder> or Extract to... has extracted an archive
completely, the archive goes to the Trash without a further question.
Every volume of a split set goes with it. A failed or cancelled
extraction leaves the archive where it is, and the Trash is always the
way back.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9203992c-1b59-4db0-b335-fb69f617149f

📥 Commits

Reviewing files that changed from the base of the PR and between 3b505ef and 27b9c29.


📒 Files selected for processing (7)
  • Config/products/macpacker.json
  • MacPacker/Core/UrlHandling/AppUrlHandler.swift
  • MacPacker/Features/Settings/GeneralSettingsView.swift
  • MacPacker/Localizable.xcstrings
  • Modules/Sources/Core/AppStorageKeys.swift
  • Modules/Sources/Core/ArchiveState.swift
  • Modules/Tests/CoreTests/ExtractionProgressTests.swift

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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