Skip to content

[Bug]: PNG files in PR Code tab expand to blank content #33909

Open

Description

@jacobcorbett

Before submitting

  • I searched existing issues and did not find an exact duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web / apps/desktop — pull request Code tab

Steps to reproduce

  1. Open a GitHub PR containing newly added PNG images alongside text changes.
  2. Open its Code tab in T3 Code.
  3. Expand an image file row.

Observed with a four-file PR containing two added PNGs and two modified text files. Both PNG rows show the expanded chevron, but no image or explanatory message appears. The expand animation plays.

Expected behaviour

Expanding an image change should show a preview, or at least an explicit unsupported/binary-file message with a way to view the image. It should not silently present an empty expanded file.

Actual behaviour

Image file headers expand to blank content. The animation runs, but waiting does not reveal an image. Text file changes have normal line counts.

Screenshot

Both PNG rows are expanded, but no image content is shown. Personal details have been blurred.

Expanded PNG file rows show no image content in the PR Code tab

Impact

Minor bug or occasional failure: image changes cannot be inspected from the PR Code tab, and the blank state gives no explanation.

Environment

Observed in T3 Code (Beta) desktop version 0.18 on macOS (version confirmed by the reporter). Source investigation used checkout fa2f4ff; this does not establish the installed desktop build's SHA.

Investigation

The affected PR's GitHub files API returned both PNGs as added files with zero additions/deletions and no patch. The whole-diff endpoint returned ordinary binary entries, for example:

diff --git a/figures/example.png b/figures/example.png
new file mode 100644
index 0000000..e7f9ad7
Binary files /dev/null and b/figures/example.png differ

Replaying this shape through the installed @pierre/diffs/utils/parsePatchFiles produces a file entry with type: "new", hunks: [], zero split/unified line counts, and empty addition/deletion arrays.

PullRequestCodeTab.tsx feeds parsed files into StyledDiffCodeView; no image-rendering branch was found on this path. apps/web/src/lib/diffFileContents.ts supplies text contents for diff context expansion, and the GitHub adapter's file-content reader rejects binary content. This explains the header-only result at the data/parser boundary. The Mac UI was not independently reproduced during this investigation; the visible symptom and animation were reported by the user.

Related reports

Workaround

View the changed images on GitHub.

Report prepared with GPT-6.1 Sol through the Codex harness.

Activity

  1. jacobcorbett commented on Nov 10, 2026

    @jacobcorbett
    ContributorAuthor

    I think expanding an image file in the PR Code tab should show an inline preview rather than a blank row. I’d be happy to implement this if maintainers approve the direction and scope.

    My proposed first pass would be:

    • Load the image only when its file row is expanded, using the exact PR revision rather than the local working tree.
    • Show the new image for added files, the old image for deleted files, and labelled before/after previews for modified files.
    • Start with PNG, JPEG, GIF and WebP, using authenticated server-side delivery so private repositories and remote connections work.
    • Include loading, error and unsupported-binary states so a file never silently expands to nothing.
    • Target the web/desktop PR Code tab initially, with an explicit fallback for mobile and unsupported Git hosts.

    I’d keep the PR focused on this issue, include relevant regression coverage and a real-client verification pass, and attach matched before/after screenshots as required by the contribution guide.

    Would this be an acceptable scope, or would you prefer a smaller first step?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions