fix(pr): GitCafe attachments render in pull request bodies#31741
Problem
GitCafe writes uploaded screenshots into PR bodies as root-relative links: . In the PR panel, web classified the path as a file on the server's machine, and mobile rejected it for not being http(s). Both showed "Image unavailable" for every GitCafe attachment, for example on #31251.
Change
- New
resolveChangeRequestMediaUrlin client-runtime: a root-relative URL in a change request body means the forge's origin, never a local path. It ignores protocol-relative URLs (//,/\) and leaves workspace-relative paths alone. - Web: a remark plugin, added to the per-repository PR markdown plugin list, rewrites
imageanddefinitionURLs against the repository URL. Markdown offsets are unchanged, so checkbox write-back still works. - Mobile:
PullRequestMarkdownRepositorypasses the change request URL down. Image render, press-to-preview and the gallery resolve hrefs the same way.
Attachments on private GitCafe repos would still need an authenticated fetchMedia in the GitCafe driver, as GitHub has. Not done here; public attachments load directly.
Verification
vp run check:changed: all pass. New regression rows inpullRequestMarkdown.test.ts.- Web dev server, PR panel on #31251:
| Before | After |
|---|---|
| Before: every image cell shows Image unavailable | After: the before, after and diff screenshots render |
Mobile was not run on a device. It shares the resolver and only changes which href it passes.
Opus 5.5 via Claude Code in T3 Code.
🤖 Generated with Claude Code
Checks
Failing1
- CodeRabbitGitHubCancelled
Added 1 commit
- fix(pr): GitCafe attachments render in pull request bodiesa66ab42
Approvability
Verdict: Approved at a66ab42
Macroscope's review found this PR approvable — Root-relative PR attachments now resolve against the forge origin on web and mobile instead of being treated as local paths. The change is limited to markdown rendering and previews, with no data, permission, or product-default changes.
You can add or adjust custom eligibility rules. Learn more.