Skip to content

feat: share archives after compression - #292

Closed
athousanddetails wants to merge 2 commits into
sarensw:mainfrom
athousanddetails:feat/share-after-compression
Closed

athousanddetails wants to merge 2 commits into
sarensw:mainfrom
athousanddetails:feat/share-after-compression

Conversation

@athousanddetails

@athousanddetails athousanddetails commented Oct 3, 2026 •

Copy link
Copy Markdown

Closes #234.

What changes: Finder can optionally show Compress and Share… (off by default). It creates a zip beside the selected files and opens the macOS share picker for the finished archive. MacPacker also offers File → Share Archive… for an open, saved archive. When Finder starts the app for this action, the share picker has a small fallback window, and a queued action skips the ordinary launch and welcome windows.

Verification:

  • swift test --package-path Modules — 578 tests passed in 137 suites, including new Finder-menu and URL-handoff coverage.
  • Direct and Mac App Store Release builds succeeded unsigned. The architecture check passed for all 10 direct-build and 5 Store-build Mach-O files (arm64 and x86_64).
  • Manually opened a disposable sample.zip and confirmed File → Share Archive… opens the native picker with AirDrop, Mail, and Messages. Confirmed the new Finder setting appears unchecked. Also exercised the no-window presenter with a disposable test archive and confirmed it opens the picker automatically.
  • The complete Finder compression handoff could not be exercised with the unsigned local build because macOS required a folder-access grant that the test build did not accept; the new action reuses MacPacker's existing compression path, with the handoff and menu behavior covered by unit tests.
Before After
Finder settings before Finder settings with the optional Share action

AI disclosure: Codex was the primary author and performed the verification described above. The human contributor remains responsible for review before merge.

Summary by CodeRabbit

  • New Features
    • Added “Compress and Share…” to the Finder menu, letting you create a ZIP archive and share it through macOS sharing services.
    • Added an option to share a saved archive from the File menu.
    • Updated the MacPacker 1.0.1 changelog with the new sharing feature.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 325f5a54-4a93-4fe3-87aa-7d1b4e018b01
📥 Commits

Reviewing files that changed from the base of the PR and between 518110d and e1e2b06.

📒 Files selected for processing (12)
  • Config/products/macpacker.json
  • FinderExtension/FinderSync.swift
  • MacPacker/AppDelegate.swift
  • MacPacker/Core/UrlHandling/AppUrlCompressHandler.swift
  • MacPacker/Features/ArchiveWindow/ArchiveCommands.swift
  • MacPacker/Features/Settings/IntegrationSettingsView.swift
  • MacPacker/Features/Sharing/ArchiveSharePresenter.swift
  • MacPacker/Localizable.xcstrings
  • Modules/Sources/FinderMenu/AppUrl.swift
  • Modules/Sources/FinderMenu/FinderMenuItem.swift
  • Modules/Tests/CoreTests/AppUrlTests.swift
  • Modules/Tests/CoreTests/FinderMenuSettingsTests.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

Walkthrough

Adds a Finder action and File-menu command to share compressed archives. The app routes the Finder request through archive creation, then presents the resulting archive using macOS sharing services.

Changes

Archive Sharing

Layer / File(s) Summary
Define and route the Finder action
Modules/Sources/FinderMenu/AppUrl.swift, Modules/Sources/FinderMenu/FinderMenuItem.swift, FinderExtension/FinderSync.swift, MacPacker/Features/Settings/IntegrationSettingsView.swift, Modules/Tests/CoreTests/*
Adds .compressAndShare as a Finder menu item and app URL action. Finder forwards the action to the main app. The item produces a ZIP, is disabled by default, and applies to any selection. Tests cover URL round-tripping, selection behavior, and menu settings.
Create and route the archive
MacPacker/AppDelegate.swift, MacPacker/Core/UrlHandling/AppUrlCompressHandler.swift, Config/products/macpacker.json
Routes .compressAndShare to the compression handler. After a successful archive write, the handler presents the archive for sharing. Launch detection skips the empty launch and welcome windows for a queued matching URL. The changelog adds a sharing entry.
Present and manage archive sharing
MacPacker/Features/Sharing/ArchiveSharePresenter.swift, MacPacker/Features/ArchiveWindow/ArchiveCommands.swift, MacPacker/Localizable.xcstrings
Adds a presenter for the macOS sharing picker, including cancellation, completion, and failure handling. Adds a File-menu command for saved archives that are not saving and have no pending changes. Adds localization entries for sharing controls.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant FinderSync
  participant AppDelegate
  participant AppUrlCompressHandler
  participant ArchiveSharePresenter
  FinderSync->>AppDelegate: Forward compressAndShare request
  AppDelegate->>AppUrlCompressHandler: Route compressAndShare action
  AppUrlCompressHandler->>AppUrlCompressHandler: Write archive
  AppUrlCompressHandler->>ArchiveSharePresenter: Present archive URL
Loading

Suggested reviewers: sarensw

Merge Risk: ⚪ Minimal · up to e1e2b

The reviewed sharing paths appear mergeable after normal checks. The complete Finder handoff was not manually exercised with a signed build, but no specific failure was established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to e1e2b

The new action reuses existing compression permissions and opens the native sharing picker rather than sending files automatically. The impact is bounded to the current user’s archives. Signed, sandboxed end-to-end behavior and overlapping sharing requests remain insufficiently verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The effective exposure is the current user’s filesystem access and the archive offered to a user-selected sharing service. External URL callers can request the new action, but the comparison found the same file and target reachability already exposed by ordinary compression, without a new unattended transmission path.

Trust Boundaries and Controls

  • observed — Target-folder authorization remains in FolderAccessStore before compression. Archive writing brackets bookmark-scoped target access, but the presenter subsequently receives a plain URL without visibly reacquiring that scope. Whether the complete sharing operation retains sufficient access is unverified; this is not evidence of a permission bypass.

Resilience and Maintainability Implications

  • inferred — Overlapping compression completions can replace an active sharing presentation. Service completion and failure callbacks check only the chosen service object, so correlation across replacement remains uncertain if AppKit reuses that object. The inspected code does not establish that these callbacks transmit a different archive or bypass service selection.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 10 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 summarizes the main change: sharing archives after compression.
Linked Issues check ✅ Passed Issue #234 requests a Finder action that compresses the selection and opens the macOS share picker, with the action off by default. FinderMenuItem.compressAndShare accepts selections, maps to `.comp…
Out of Scope Changes check ✅ Passed The added in-app sharing command, fallback presenter, URL launch handling, settings label, localization entries, tests, and release note support archive sharing requested by issue #234. The reviewed c…
Full details: Docstring Coverage

Explanation

Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 10 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · 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.

@athousanddetails athousanddetails closed this by deleting the head repository Oct 11, 2026
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.

Share an archive right after compressing

1 participant