Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(pr): GitCafe attachments render in pull request bodies #31741

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/31741/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Problem

GitCafe writes uploaded screenshots into PR bodies as root-relative links: ![…](/api/attachments/attach_…). 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 https://git.cafe/pingdotgg/t3code/pulls/31251.

Change

  • New resolveChangeRequestMediaUrl in 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 image and definition URLs against the repository URL. Markdown offsets are unchanged, so checkbox write-back still works.
  • Mobile: PullRequestMarkdownRepository passes 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

BeforeAfter
Before: every image cell shows Image unavailableAfter: 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

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. 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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge merged thisd929e72

    4. juliusmarminge closed this

Sign in to join this conversation.