Skip to content

[Bug]: Git LFS images in pull request diffs show as pointer text #41558

Open

Description

@Ernest0-Production

Before submitting

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

Area

apps/web

Steps to reproduce

  1. Open a pull request or GitLab merge request whose Code tab includes a PNG, JPEG, GIF, or WebP tracked by Git LFS.
  2. Expand that file in the Code tab (web or desktop).

Expected behavior

The expanded row shows the image at that revision, the same way a normal PNG with no patch already does.

Actual behavior

The row is a three-line text hunk:

version https://git-lfs.github.com/spec/v1
oid sha256:…
size …

PullRequestCodeTab only builds an image preview when fileDiff.hunks.length === 0 and the provider implements rawFileUrl (apps/web/src/components/pullRequest/PullRequestCodeTab.tsx, imagePreviewUrl). An LFS-tracked image is stored as that pointer, so the host sends a text patch and the preview path never runs. GitLab has no rawFileUrl at all.

The working counterpart is the same Code tab for a non-LFS image with no patch, which already renders the file at the revision. GitHub pull request descriptions already load the LFS object instead of the pointer; the Code tab still shows the pointer.

Impact

Major degradation or frequent failure

Version or commit

main @ 7182abe

Environment

Web and desktop. Reproduced conceptually on GitHub.com and self-hosted GitLab (LFS-tracked artwork in the MR). Same Code tab path on both; GitLab never takes the image-preview branch.

Logs or stack traces

None needed. The pointer text is the file content the diff already has.

Workaround

Open the file on the host website, or check it out locally outside T3 Code.

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