fix(mobile): iPhone chat pictures were empty gray boxes #9087
main fromrefs/pull/9087/head·opened View on GitHubWhat Changed#
Pictures in iPhone chat were empty gray boxes.
The phone was trying to open a computer file path like media/shots/poster.png as if that file already lived on the phone. It does not. So you got a blank box with the caption under it.
This change:
- Hands those pictures to the same signed-url loader the rest of the app already uses.
- Stops iOS from treating a workspace path as a download URL.
- Loads the real picture with
expo-imageinstead of hiding a React NativeImageat opacity 0 (iOS often never paints that).
Why#
A real thread looked like this:
Web can ask the T3 server for that file. The iPhone was skipping that step and drawing an empty 16:9 box.
UI Changes#
Before: chat pictures on iPhone are empty rounded gray rectangles. The caption still shows.
After: the phone asks the server for the picture, then draws it.
I could not take an after screenshot here. This machine has no iOS Simulator. The tests cover the path (media/shots/poster.png is a workspace file, and those image paragraphs stay in the rich markdown chunk the host renderer owns).
Checklist#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
- [!] I included a video for animation/interaction changes
Built with Grok 4.6 in T3 Code.
Note
Low Risk Scoped to iOS markdown image rendering and thread list refresh keys; no auth or data-model changes, with regression tests added.
Overview
Fixes empty gray image placeholders in iPhone chat when markdown uses workspace-relative paths (e.g. media/shots/poster.png) instead of direct URLs.
On iOS native markdown, renderImage is threaded from SelectableMarkdownText through NativeMarkdownBlock so the thread feed’s signed-URL renderer runs for images in lists, blockquotes, and mixed paragraphs—not only via context. The fallback Image path is restricted to http(s), data, blob, and protocol-relative URLs; other hrefs show an explicit “Image unavailable” placeholder instead of a broken 16:9 box.
In the thread feed, markdown image loading switches to expo-image (with disk cache) and drops the opacity-0 loading trick that often never painted on iOS. LegendList extraData now includes environmentId and workspaceRoot so rows refresh when workspace image resolution changes.
Tests cover workspace image paragraphs staying in rich markdown chunks and classifyMarkdownImageSource behavior for nested workspace paths vs blocked bare paths.
Note
Fix empty gray image boxes in iPhone chat by switching to expo-image and propagating renderImage#
- Replaces React Native
Imagewithexpo-imageinThreadMarkdownImageRequest(ThreadFeed.tsx), settingcachePolicyto memory-disk andcontentFitto contain. The image renders at full opacity with a loading overlay instead of being hidden during load. - Adds an optional
renderImageprop that flows throughNativeMarkdownBlock,NativeMixedParagraph,NativeList,NativeMarkdownImage, andSelectableMarkdownTextso the host can control image rendering (NativeMarkdownBlock.ios.tsx). - Introduces
DIRECT_MARKDOWN_IMAGE_HREF_PATTERNto block non-direct hrefs (anything not http(s), data, blob, or protocol-relative) in the fallbackImagepath; those now render a placeholder labeled "Image unavailable". - Risk: Images with non-direct hrefs that previously attempted (and failed) to load now render a placeholder unless a custom
renderImagehandles them.ThreadFeedaddsenvironmentIdandworkspaceRoottolistAppearanceDataextraData, so rows depending on those values re-render on change.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This is a focused iOS image bug fix, but it also propagates the host renderer into existing rich-markdown paths, activating signed workspace-asset resolution, caching, previews, and a new native image-loading path. That production behavior change is non-trivial enough to warrant human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Note
This comment is posted by Julius' dot
The second image shows loaded pictures, but the description says an after screenshot could not be captured without an iOS Simulator. Which client and PR build produced that image, and was the changed iOS rendering path exercised? Please report the focused test commands and results too, so the supplied verification can be matched to this fix.
Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one appears to have been created with an older model (
grok 4.6). If this change is really important, we recommend rebuilding the PR with a newer model if possible.maria-rcks closed this
Sign in to join this conversation.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.