Skip to content

Fix LFS README image assets#113

Merged
stylessh merged 1 commit intostylessh:mainfrom
premsathisha:codex/fix-lfs-readme-screenshots
Apr 14, 2026
Merged

Fix LFS README image assets#113
stylessh merged 1 commit intostylessh:mainfrom
premsathisha:codex/fix-lfs-readme-screenshots

Conversation

@premsathisha
Copy link
Copy Markdown
Contributor

Summary

Fix README image rendering for repository assets stored with Git LFS. The previous resolver pointed relative README images directly at raw.githubusercontent.com, which returns the LFS pointer text for LFS-backed files instead of the actual image. Using GitHub's /raw/ route lets GitHub redirect normal files to raw.githubusercontent.com and LFS files to media.githubusercontent.com.

Changes

  • Update repository markdown asset URLs to use github.com/{owner}/{repo}/raw/{ref}/...
  • Keep absolute URLs, protocol-relative URLs, and anchors unchanged
  • Add focused coverage for the penso/arbor LFS screenshot case and existing relative path behavior

Test Plan

  • pnpm --filter dashboard exec vitest run src/components/repo/repo-markdown-files.test.ts
  • pnpm --filter dashboard check-types
  • pnpm exec biome check apps/dashboard/src/components/repo/repo-markdown-files.tsx apps/dashboard/src/components/repo/repo-markdown-files.test.ts
  • pnpm --filter dashboard build
  • Verified https://github.com/penso/arbor/raw/main/assets/screenshot.png redirects to media.githubusercontent.com
  • Verified a normal DiffKit asset redirects to raw.githubusercontent.com

Screenshots

No UI layout change; this only changes how relative README image asset URLs are resolved.

@premsathisha premsathisha marked this pull request as ready for review April 14, 2026 03:02
}

const rootUrl = `https://raw.githubusercontent.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${encodePath(ref)}/`;
const rootUrl = `https://github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/raw/${encodePath(ref)}/`;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this support all the other images urls?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@stylessh stylessh merged commit d67f6f7 into stylessh:main Apr 14, 2026
3 checks passed
@premsathisha premsathisha deleted the codex/fix-lfs-readme-screenshots branch April 14, 2026 23:47
stylessh pushed a commit that referenced this pull request Apr 18, 2026
Co-authored-by: Prem Sathisha Etagi <premsathisha@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants