block / block/buzz

feat(desktop): preview and download binary documents in Projects Files

Open
#7,045 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

**Motivation**
Projects → Files currently previews only small UTF-8 text files. Selecting a PDF, DOCX, XLSX, PPTX, or other binary document shows:

> Preview unavailable for this file. Large and binary files only show metadata.

This makes a project document register difficult to use as a human-facing library. Users can see the filename and size, but cannot inspect or retrieve an invoice, contract, proposal, or course document from the Files pane.

The current desktop implementation also uses one fallback message for two different cases: files over the text-preview limit and binary formats that need a dedicated renderer.

**Proposed solution**
Add safe document handling to the existing Projects repository Files pane:

- Render PDFs inline, with page navigation and zoom.
- Provide read-only previews for common Office formats (`.docx`, `.xlsx`, and `.pptx`) where practical.
- Add **Download** and **Open externally** actions for every repository file, including formats without an inline renderer.
- Preserve the metadata-only fallback for unsupported or oversized files, but include the download/open actions.
- Distinguish “too large to preview” from “format not supported” in the UI.

Private repository documents should be rendered locally in the desktop client. A preview must not upload file contents to a third-party conversion service. Existing repository authorization must apply to both preview and download, with bounded file-size and resource limits.

A phased implementation would still be useful: PDF preview plus download/open actions first, followed by Office preview support.

**Alternatives considered**

- Increasing the existing 64 KiB text limit: this does not make PDF or Office binaries renderable and risks reading large files into a text component.
- Converting every file to PNG/PDF before committing it: creates duplicate artifacts, loses the original-document workflow, and requires manual synchronization.
- Opening every file externally: useful as a fallback, but it breaks review context and does not provide an in-app PDF experience.
- Using a hosted Office/Google preview service: unsuitable for private contracts, invoices, and learner or customer documents because it sends the file outside the configured Buzz community.

**Additional context**

Environment observed: Buzz Desktop 0.5.20, Projects repository Files view.

Closest issues found:

- #5675 requests previews for shared message attachments and explicitly leaves PDF/binary files download-only; this request is for repository files in Projects and includes PDF/Office handling.
- #4400 covers safe upload of generated HTML preview artifacts, not native repository-document preview.
- #3083 covers Office MIME upload support in the CLI, not viewing committed files.
- #2906 covers opening repository files from message links, not rendering or downloading them from the Files pane.

Duplicate search: no issue or PR found for PDF/DOCX/XLSX preview in the Projects repository Files view, the exact fallback message, or binary-document download from that pane.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.