Skip to content

Extraction should bundle multi-root archives like Finder #1159

Description

@JoeJoeflyn

Problem or use case

Extracting an archive that contains several top-level entries ("Extract here", double-click, or "Extract to…") drops every entry loose into the destination folder. A zip of fifty loose photos spills fifty files into the current directory, mixing them with whatever already lives there.

The opposite wart also exists: activating an archive always wraps its contents in a folder named after the archive, so foo.zip that already contains a single foo/ directory extracts to foo/foo/.

Proposed solution

Match Finder / Archive Utility: extract an archive's contents into the destination, and when more than one top-level entry was written, bundle them into a fresh folder named after the archive (photos.zipphotos/). A single-root archive — one loose file or one top-level directory — extracts as-is, never double-wrapped.

Alternatives considered

  • Keep "Extract here" verbatim and "Extract to…" for wrapped extraction (status quo): both ends are wrong — spill for multi-root archives, double-wrap for tidy single-folder archives.
  • Always create the wrapper folder before extraction (previous activation behavior): cannot know whether the wrapper is needed without inspecting the archive, and produces foo/foo/.

Visual examples

N/A

Strata version

main @ 528b1ab

Additional context

Implemented by bundling after decode: the extraction session reports the distinct resolved top-level paths it wrote, and the worker moves them into a reserved stem/stem (n) folder when there is more than one. Same-directory renames only, no archive pre-scan, cancellation and conflict naming unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions