Skip to content

Preview archive contents without extracting #210

Description

@jongio

Problem

Archives show up in repos as release bundles, fixtures, and assets. In grut they are treated like binary files, so the preview cannot answer what is inside. Users need to leave the TUI for unzip -l or tar -tf just to inspect names and sizes.

Proposed solution

Extend the preview loader to detect .zip, .tar, .tar.gz, and .tgz files and render a read-only manifest instead of the generic binary message. Show entry path, uncompressed size, and modified time for the first capped set of entries. Use Go standard library packages and do not extract files.

User impact

Developers can inspect release artifacts and test fixture archives in place before opening, deleting, or committing them.

Acceptance criteria

  • The preview panel shows a manifest for zip, tar, tar.gz, and tgz files.
  • The manifest includes entry path, size, and modified time when available.
  • Large archives are capped and show how many entries were omitted.
  • Corrupt or unsupported archives show a clear preview error without crashing.
  • Tests cover supported archive types, truncation, and corrupt archive handling.

Complexity & priority

Complexity: S | Priority: 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions