Repository navigation
UI Consistency: 1 issue found
apps/web/src/components/ChatMarkdown.tsx(lines 2194-2207): the two new GitHub-attachment branches render the image without forwarding the remainingimgprops, unlike theDirectbranch immediately above. GitHub emits attachments as<img width="..." height="..." alt="..." src="https://github.com/user-attachments/assets/...">and the sanitize schema keepswidth/height/align, so these images previously reserved their intrinsic box; now they render unsized (layout shift when a lazily loaded PR-body screenshot arrives) andalignis ignored. Smallest fix: accept optionalwidth/heightonChatMarkdownAssetImage/ChatMarkdownDirectAttachmentImageand pass them from both call sites.
The prior run's finding (direct-attachment path losing the shared CHAT_MARKDOWN_WORKSPACE_IMAGE_CLASS_NAME treatment and the ChatMarkdownImageFallback chip) is resolved by commit 42a2295 and was not re-reported.
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/ui-consistency.md
More information about how Check Run Agents work can be found in our Help Center.
Scope reviewed: apps/web/src/components/ChatMarkdown.tsx and apps/web/src/components/pullRequest/pullRequestMarkdown.logic.ts (the only in-scope changed files); packages/client-runtime/src/markdownImages.ts, packages/contracts/src/assets.ts, and the server/mobile changes were read as context only.
Checks performed:
- Environment routing:
ChatMarkdownresolvesenvironmentIdfromthreadRef?.environmentId ?? explicitEnvironmentId ?? nullwith no active-environment fallback; everyPullRequestMarkdown/PullRequestMarkdownEditor/ timeline call site threads an explicitenvironmentId, and the no-environment case suppresses the proxy rather than guessing. No finding. - Shared primitives and Tailwind ownership: the new components reuse
CHAT_MARKDOWN_WORKSPACE_IMAGE_CLASS_NAMEandChatMarkdownImageFallback; no primitive overrides or new global CSS. - Loading/failure states:
Loadingkeeps the existing skeleton; signed-URL failure falls through tofallbackUrland then to the standard unavailable chip, matching the previous workspace-image behavior. - Atom identity:
useAssetUrlStatekeys by JSON of{environmentId, input}, so passing a freshresourceliteral per render does not re-issue reads. isGitHubUserAttachmentUrlreplaces the localGITHUB_ASSET_PATTERNinpullRequestMarkdown.logic.tswith the same anchored pattern (plus trimming), so attachment-card splitting is unchanged.
🔍 Agent activity — 10 tool calls
💭 I want to check whether the earlier finding about ChatMarkdown.tsx was actually addressed at the current commit. Looking at the diff, the no-environment branch now renders the direct attachment image component with the proper class name and an onError fallback, which suggests the issue was fixed—I should confirm by viewing the file directly.
1. browse_code — apps/web/src/components/ChatMarkdown.tsx
2. git_tools — 8f49132..95ab746
💭 That earlier finding was fixed in 42a2295, so now I want to check the other changed web files for remaining issues. I'm looking at the ChatMarkdown call site around line 2194 to see how environmentId is derived there — specifically whether it falls back to the globally active environment, since that matters for environment routing in shared renderers.
3. git_tools — environmentId
💭 I'm confused by a discrepancy—the grep output still shows the old ChatMarkdownWorkspaceImage component with the threadRef.environmentId workspace-file reference at lines 1071-1077, even though the earlier view of that same range showed it renamed to ChatMarkdownAssetImage. I need to re-check which revision I'm actually looking at.
4. git_tools — ChatMarkdownAssetImage|ChatMarkdownDirectAttachmentImage|ChatMarkdownWorkspaceImage
💭 I'm checking how environmentId flows for GitHubAttachment, tracing whether the PR panel call site passes it through to ChatMarkdown, and confirming it's included in the useMemo dependency list for components. Looking for UI consistency issues next: the failed-URL state array looks fine, and the fallback logic for Failure states on workspace images matches prior behavior. But I notice the resource object is created inline at the call site each render inside a memoized component -- since it's no longer a primitive like before, memo's shallow comparison will fail every time, causing unnecessary re-renders. This could also make useAssetUrlState refire if it depends on object identity, so I want to check that implementation.
5. browse_code — Show the implementation of useAssetUrlState in the web app (apps/web/src). Does it memoize on the resource object identity (e.g. useEffect dependency on the resource object) or serialize it? Include the full source.
💭 The memo shallow-compare issue on the object literal doesn't seem worth reporting since it doesn't cause a visual bug, just an unnecessary re-render. I should check the pull request panel call sites now—specifically whether ChatMarkdown receives environmentId when rendering PR body markdown, since pullRequestMarkdown.logic.ts is in scope for this fix.
6. git_tools — ChatMarkdown|environmentId
💭 Now I'm looking at the remaining changed files, ChatMarkdown.tsx and pullRequestMarkdown.logic.ts, where the local GitHub asset pattern was replaced with the shared isGitHubUserAttachmentUrl helper that trims URLs. I'm tracing how PR body parsing turns bare GitHub asset links into attachment cards, and how ChatMarkdown handles image tags pointing to GitHub attachments. I'm checking that the failure/loading/success states for asset images still behave consistently, confirming lazy loading and fallback chip logic match prior behavior, and verifying the memoization dependencies include environmentId. I'm also considering whether ChatMarkdownDirectAttachmentImage might be duplicating logic already present in ChatMarkdownAssetImage. I want to compare how GitHub attachment images versus direct images render their classNames to check for a styling mismatch between workspace-block images and direct images.
7. browse_code — apps/web/src/components/ChatMarkdown.tsx
💭 I'm noticing that the GitHubAttachment branches drop the spread props that the Direct branch used to forward, like width, height, and className from markdown image attributes. This means an image tag with explicit width like GitHub PR bodies commonly have would previously get those size attributes applied through Direct, but now routes through ChatMarkdownAssetImage which ignores them entirely, likely causing sizing regressions. But then I'm questioning whether that's actually a regression—since the Tailwind classes use w-auto and h-auto with object-contain, those already override any width/height presentational attributes in the CSS cascade, so the real impact might just be losing the intrinsic aspect-ratio hint browsers use for layout stability during lazy loading rather than actual visual sizing. I'm weighing whether this dropped-attributes behavior is a genuine bug versus intentional: GitHub-attachment images in PR bodies often carry width/height hints from GitHub's editor, so losing them could cause layout shift, but the new block-style treatment matching workspace images might be exactly what the PR intends. I'm trying to figure out if there's a cleaner way to validate this. This confirms it: after the change, width, height, style, and className get dropped for GitHub attachment images, causing real layout shift since dimensions are no longer reserved during lazy loading. It's a legitimate regression worth flagging, and the fix is straightforward—thread the intrinsic width/height and className through to the new image components. For the proxy path a skeleton does reserve space while the signed URL loads, then swaps to an img with unknown height, so there's still some shift but less severe; the direct path has no skeleton and no dimensions at all. This feels like a legitimate but moderate finding — losing intrinsic dimension attributes causes a concrete layout shift on changed lines, which fits the rules' emphasis on visual/layout preservation. There's also a minor secondary issue: dropping the spread props removes the ability to pass className through. I want to double check whether classifyMarkdownImageSource actually gets invoked here. Now I need to confirm that HTML img tags in markdown (like ones in PR bodies) render correctly — this depends on rehype-raw being enabled in ChatMarkdown's plugin setup, otherwise raw HTML img tags wouldn't render at all and their width/height attributes would be irrelevant. Let me check ChatMarkdown's plugin configuration.
8. git_tools — rehypeRaw|rehype-raw|remarkPlugins|rehypePlugins
💭 I need to check whether rehypeRaw is enabled based on parseRawHtml, what its default value is in PullRequestMarkdown, and whether the sanitize schema allows img width/height attributes.
9. git_tools — parseRawHtml|CHAT_MARKDOWN_SANITIZE_SCHEMA
💭 I'm confirming that rehype-sanitize's default schema permits width/height/align on img tags, so those attributes from GitHub PR bodies used to pass through via the Direct branch's prop spreading. This reveals the bug: the new GitHubAttachment branches no longer spread those props, so they're silently dropping the author's original image sizing. This seems worth flagging as a single inline comment, suggesting the smallest fix is to forward the remaining props (width/height/align/className) into the new components rather than dropping them. I'm also checking that the fallback logic in ChatMarkdownAssetImage handles the failedUrls check correctly via closure, which looks fine, and noting that the Direct branch's shift from inline-block to block+border styling is likely intentional per the PR, so I'll keep my comment focused on the dropped attributes issue rather than the styling change. I'm now pinning down the exact diff line numbers to anchor the comment—targeting the new GitHubAttachment branch around lines 2194-2207 in the added hunk, likely using start_line 2194 through line 2205 to cover the relevant block. I'm drafting the comment text noting that both new GitHub-attachment branches drop
{...props}, unlike the Direct branch above, and want to reference how GitHub's editor actually writes these attachment image tags with explicit width/height/alt/src attributes. Since the sanitize schema preserves width, height, and align attributes, these images previously rendered with reserved intrinsic dimensions—now that's lost, causing layout shift on lazy load and ignoring alignment. I'm considering suggesting a fix: threading intrinsic size through by adding optional width/height or an imgProps parameter to spread onto the img tag. Since this touches two components and two call sites, a single diff won't cleanly represent it, so I'll skip proposing exact code and just flag it as a review comment, leaning toward treating this as a moderate regression finding rather than an outright failure. That confirms width/height props pass through to the component and are spread directly in that branch. I'm confident in this finding now, so I'll finalize and post it.
10. modify_pr — One finding on the new GitHub-attachment image branches in apps/web/src/components/ChatMarkdown.tsx: the author's intrinsic width/height (and align) attributes that the Direct branch still forwards are now dropped for these images.
Agent Credits: 204 credits
Token usage: 36 uncached input · 887,479 cache-read input · 186,845 cache-write input · 13,180 output
Agent Credits may also include non-token charges from external tools such as web research.