Skip to content

Compressing shows no progress #192

Description

@sarensw

Compressing gives no progress feedback. Drop a 2.6 GB folder on the Quick Compress
window or the start page's compress area and nothing happens on screen until the
archive appears — the UI stays responsive, but there is no bar, no byte count, and
no signal that it finished.

Extraction already has all of this: ExtractionProgressCenter drives a window that
auto-shows on an active job, shows a bar, a speed graph and an ETA, auto-closes when
done, and stays open on failure. Compression should reuse it.

Why this is mostly plumbing

ExtractionJob is a byte-transfer model, not an extraction-specific one —
archiveName, destination, itemCount, totalBytes, completedBytes,
state {running, done, failed, cancelled}, speed samples, ETA.

The data already lines up. The center takes:

reportEngineProgress(_ id: UUID, completed: Int64, total: Int64)

and ArchiveState.save() already receives exactly that from 7-Zip, then discards it:

let onWriteProgress: @Sendable (UInt64, UInt64) -> Bool = { completed, total in
    let pct = Int((completed * 100) / total)   // bytes thrown away here

The progress view needs no wording changes either: its only localized string is
"\(formatDuration(remaining)) left". Everything else is names, sizes and speeds.

Scope

  • ArchiveState.save() reports bytes, not just a percentage
  • DropCompressor calls begin() / finish() on the center
  • Compute totalBytes from the dropped files, or pass nil and let
    engineTotalBytes supersede it once the engine reports (the model already
    handles both)
  • Restore the running row in the drop window — the filter that hides finished
    successes also hides .running, so the ProgressView in DropJobRow can
    never appear

Both surfaces are affected: the Quick Compress window and the start page's compress
area.

Deliberately out of scope

Each of these spills past the plumbing and is worth its own decision:

  1. Naming. Everything is Extraction*, including ExtractionProgressCenter.shared.
    Compression joining it either lives with the name or forces a rename across every
    extraction call site.
  2. Quit guard. applicationShouldTerminate refuses on hasActiveJobs with
    "An extraction is still in progress". Compress jobs would inherit that wording —
    right behaviour, wrong sentence.
  3. Cancellation. Wireable: save()'s progress callback returns Bool, and false
    aborts the write. But that leaves a partial archive on disk to clean up, which is
    new behaviour rather than reuse.
  4. DropJob becomes redundant once the center tracks compress jobs — the drop
    window's own row model duplicates it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions