Skip to content

feat: add configurable one-click archive extraction - #359

Open
n4dh1x wants to merge 2 commits into
sarensw:mainfrom
n4dh1x:feat/one-click-extraction-upstream
Open

n4dh1x wants to merge 2 commits into
sarensw:mainfrom
n4dh1x:feat/one-click-extraction-upstream

Conversation

@n4dh1x

@n4dh1x n4dh1x commented Oct 21, 2026 •

Copy link
Copy Markdown

What & why

Closes #280.

Adds an opt-in One-click extraction setting in General. Recognized archives opened through Finder/Open With/Dock extract immediately, with a remembered destination choice:

  • beside the archive;
  • a fresh folder named after the archive, including compound and split-volume names;
  • a native location chooser (Cancel starts no extraction).

An extraction launch avoids the archive browser/welcome window and quits when its work is done. Existing in-app browsing and explicit extraction actions retain their behavior. Multiple sources receive their own folder grants, and selected volumes of the same split archive are deduplicated. Passwords, progress and cancellation use the existing extraction flow.

One-click output is staged on the destination volume, then whole top-level items move into place with numbered conflict names. For example, an existing hello world.txt is kept and the new file becomes hello world (2).txt. This also avoids extraction failures when a file blocks a directory (or vice versa), and preserves existing dangling symlinks.

How it was verified

  • Added a regression using the existing defaultArchive.zip fixture and reproduced the collision with both engines before the fix: failing run. 7-Zip reported Extraction failed: Failed to create output file; XAD reported Could not create directory (error 16).
  • The fixed regression checks preserved file/directory contents, occupied numbered names, dangling symlinks, byte-identical extracted files, nested archive structure, and staging cleanup.
  • Full package tests and universal Release build passed, including architecture and deep code-signature checks. Downloadable fork prerelease.
  • Fork PR CI passed: 657 tests in 144 suites, plus successful direct and App Store builds/architecture checks.
  • Added XCUITests for the three destination modes, chooser cancellation, and opening the browser when the feature is disabled.
  • UI verification gap: the UI evidence run timed out querying the unchanged upstream app's accessibility hierarchy. Before/after screenshots and manual UI verification have therefore not been completed. The outstanding evidence required by AI_CONTRIBUTING.md is disclosed here; no successful UI run or human QA is claimed.

The six new settings keys/comments were generated with Apple's xcstringstool from compiler output. The larger catalog diff is generated ordering/locale normalization (no → nb, pt-br → pt-BR, es-mx → es-MX); all existing translation values are preserved. The changelog entry is in the existing first untagged block, translated into its 21 languages, and references #280. Version settings and vendored submodules are unchanged.

AI disclosure: Codex was the primary author of this implementation and its tests. Submitted by N4dh1x (@n4dh1x).

Checklist

  • Complete verification evidence: passing core/build evidence linked above; manual UI checks and before/after screenshots still needed
  • Changelog entry added to Config/products/macpacker.json
  • AI involvement disclosed

Summary by CodeRabbit

  • New Features
    • Added optional one-click archive extraction when opening archives from Finder.
    • Choose extraction to the archive’s folder, a new archive-named folder, or a custom destination.
    • Automatically opens Finder to the extracted results.
    • Remembers the selected extraction destination.
    • Preserves existing files by assigning numbered names to conflicts.
  • Bug Fixes
    • Improved handling of split archives, sandbox permissions, cancellation, and extraction errors.
  • Tests
    • Added coverage for destinations, conflict handling, cancellation, and launch behavior.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 226f1be2-ca97-4eb9-8586-373e78e8b7ff
📥 Commits

Reviewing files that changed from the base of the PR and between 4e60973 and 05c5c5b.

📒 Files selected for processing: 15
  • Config/products/macpacker.json
  • MacPacker/AppDelegate.swift
  • MacPacker/Core/UrlHandling/AppUrlExtractToChosenFolderHandler.swift
  • MacPacker/Core/UrlHandling/AppUrlHandler.swift
  • MacPacker/Core/UrlHandling/AppUrlOneClickExtractionHandler.swift
  • MacPacker/Features/Settings/GeneralSettingsView.swift
  • MacPacker/Localizable.xcstrings
  • MacPackerUITests/MacPackerUITests.swift
  • Modules/Sources/Core/AppStorageKeys.swift
  • Modules/Sources/Core/ArchiveExtractor.swift
  • Modules/Sources/Core/ArchiveState.swift
  • Modules/Sources/Core/Launch.swift
  • Modules/Sources/Core/OneClickExtractionDestination.swift
  • Modules/Tests/CoreTests/LaunchTests.swift
  • Modules/Tests/CoreTests/OneClickExtractionTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The change adds an opt-in setting to extract supported archives opened from Finder. It adds destination choices, preserves existing files during extraction, and updates launch handling and tests for the new flow.

Changes: Finder One-Click Extraction

Layer / File(s) Summary
Destination and launch settings
Modules/Sources/Core/AppStorageKeys.swift, Modules/Sources/Core/OneClickExtractionDestination.swift, Modules/Sources/Core/Launch.swift, MacPacker/Features/Settings/GeneralSettingsView.swift, Modules/Tests/CoreTests/LaunchTests.swift, Config/products/macpacker.json
Adds persisted settings for enabling one-click extraction and selecting a destination. The settings UI offers same-folder, archive-folder, and chosen-folder options. Launch handling and launch tests include the new reason. The changelog adds a localized feature entry.
Extraction and destination handling
Modules/Sources/Core/ArchiveExtractor.swift, Modules/Sources/Core/ArchiveState.swift, MacPacker/Core/UrlHandling/AppUrlHandler.swift, MacPacker/Core/UrlHandling/AppUrlExtractToChosenFolderHandler.swift, Modules/Tests/CoreTests/OneClickExtractionTests.swift
Adds an option to preserve existing files by extracting to staging and moving items with numbered names when paths conflict. URL handling adds shared destination selection and sandbox-scoped file access. Tests cover destination resolution and preservation of conflicting files and directories.
Finder extraction flow
MacPacker/AppDelegate.swift, MacPacker/Core/UrlHandling/AppUrlOneClickExtractionHandler.swift, MacPackerUITests/MacPackerUITests.swift
AppDelegate detects supported archive launches when one-click extraction is enabled and invokes the new handler. The handler resolves destinations, processes canonical archives, extracts them, and activates Finder to select results. UI tests cover destination choices, cancellation, and disabled mode.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Finder
  participant AppDelegate
  participant AppUrlOneClickExtractionHandler
  participant AppUrlHandler
  participant ArchiveState
  participant ArchiveExtractor
  Finder->>AppDelegate: Open archive
  AppDelegate->>AppUrlOneClickExtractionHandler: Handle archive URLs and saved destination
  AppUrlOneClickExtractionHandler->>AppUrlHandler: Extract archive with existing files preserved
  AppUrlHandler->>ArchiveState: Start extraction
  ArchiveState->>ArchiveExtractor: Extract archive contents
  AppUrlOneClickExtractionHandler->>Finder: Select extracted results
Loading

Possibly related issues

  • Issue 350 requests fewer extraction windows and questions. This change adds opt-in immediate extraction for archives opened from Finder and avoids opening the archive browser in that flow.

Suggested reviewers: sarensw, hthitoy, enaium

Merge Risk: ⚪ Minimal · up to 05c5c

No actionable issue remains identified for this change; it is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 38.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 13 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: configurable one-click archive extraction.
Linked Issues check Passed Issue #280 requests an option to extract archives opened from Finder instead of opening them in MacPacker. The PR adds the opt-in oneClickExtraction setting, destination options, Finder/Launch Servi…
Out of Scope Changes check Passed The changes remain connected to issue #280. Destination persistence, split-volume handling, conflict-safe staging, symlink preservation, localization, changelog updates, and regression tests support t…
Full details: Linked Issues check

Explanation

Issue #280 requests an option to extract archives opened from Finder instead of opening them in MacPacker. The PR adds the opt-in oneClickExtraction setting, destination options, Finder/Launch Services handling, immediate extraction, chooser cancellation behavior, and browser fallback when disabled. The implementation reuses the extraction flow and adds unit and UI test coverage for the requested behavior. The reported UI evidence gap concerns manual verification, not an identified unmet coding requirement.

Full details: Out of Scope Changes check

Explanation

The changes remain connected to issue #280. Destination persistence, split-volume handling, conflict-safe staging, symlink preservation, localization, changelog updates, and regression tests support the requested extraction workflow or its safe operation. No unrelated feature or unrelated behavior is identified in the supplied change summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 38.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 13 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • 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.

@n4dh1x
n4dh1x force-pushed the feat/one-click-extraction-upstream branch from 1496143 to 05c5c5b Compare October 21, 2026 07:52
@n4dh1x
n4dh1x marked this pull request as ready for review October 21, 2026 07:53
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.

Feature request: Extract archives on open

1 participant