View LFS images in the Web IDE
MR: Pending
Description
MR: Pending
As a user, I want view image files in the Web IDE so that I can read Markdown documents, inspect code changes, with image updates.
-
Current behavior:
The LFS pointer files are not parsed, so the objects are not retrieved from the LFS object store
-
Expected behavior:
When a project is cloned for working in the Web IDE, it should have LFS enabled so that
git-lfs
fetches the objects -
Steps to reproduce:
- Visit a project with image files such as
.png
or.jpg
, stored as LFS files - Edit the project with the Web IDE (by pressing . or choosing Edit > Web IDE
- In the Web IDE, open an image file. You will see "An error occurred while loading the image.", instead of the image
- Click "Open file using VS Code's standard text/binary editor?" You will see LFS pointer data to the
oid sha256
- Visit a project with image files such as
-
Additional information: please include VSCode version, browser dev tool logs, etc that might be helpful to debug the issue!
-
This happens in
gitlab.com
-
An example public project where you can observe this behavior: https://gitlab.com/milohax/milosophical-me
-
The image files in this project are using LFS, as you can confirm in https://gitlab.com/milohax/milosophical-me/-/tree/src/img
-
From the Web IDE opened to this project:
-
The browser logs notify that the VSCode webview content is updated, but no further information (because this is within VSCode / git)
-
14:48:15.624 DEBUG Webview(148c26a3-b398-404e-9f13-b3c9ec4a9992): will update content log.ts:409:12
14:48:16.031 DEBUG Webview(148c26a3-b398-404e-9f13-b3c9ec4a9992): webview ready log.ts:409:12
14:48:16.513 DEBUG loadLocalResource - begin. requestUri=gitlab-web-ide:/milosophical-me/img/SoManyLies.jpg?version%3D1743652095622 log.ts:409:12
14:48:16.513 DEBUG loadLocalResource - found resource to load. requestUri=gitlab-web-ide:/milosophical-me/img/SoManyLies.jpg?version%3D1743652095622, resourceToLoad=gitlab-web-ide:/milosophical-me/img/SoManyLies.jpg?version%3D1743652095622 log.ts:409:12
14:48:16.537 DEBUG Comments: URIs of continue on comments to add to storage .
Acceptance criteria
TODO: Fill out (required)
-
[Describe what must be achieved to complete this issue.] -
[If applicable, please provide design specifications for this feature/enhancement.] -
[If applicable, please list any technical requirements (performance, security, database, etc.)]
Implementation plan
TODO: Fill out or delete (optional)
[Provide a high-level plan for implementation of this issue, including relevant technical and/or design details.]