Skip to content

fix(web): keep chat media at a stable size while it loads - #9938

Merged
juliusmarminge merged 6 commits into
mainfrom
t3code/stabilize-chat-media-layout
Sep 5, 2026
Merged

juliusmarminge merged 6 commits into
mainfrom
t3code/stabilize-chat-media-layout

fix(web): forward sanitized image attributes to the rendered image

6d6472c
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Correctness Check succeeded Sep 5, 2026 in 1m 55s

No issues identified (3 code objects reviewed).

• Reviewed files modified since 03a9de5; other PR files not modified since then were skipped.
• Merge Base: 363cde4
• Head: 6d6472c

Details

✅ File Path U3 Bytes Comments Posted Reason
➖ apps/web/src/components/ChatMarkdown.workspace-images.test.tsx 572 Excluded by default ignore patterns
✅ apps/web/src/components/ChatMarkdown.tsx 2309 0

Billed Total: 10.00KB of diff | $0.50 (This review was charged at our per-review byte minimum of 10.00KB. Learn more here)

Filtered Issues Details

apps/web/src/components/ChatMarkdown.tsx
  • line 1461: While a standalone image is loading, the hidden <img> at this line does not receive props.imageProps. Consequently authored image attributes such as align (explicitly included in imageProps for layout) are absent from the loading frame; e.g. a standalone <img align="left"> does not float until onLoad replaces the frame with the settled image, producing incorrect alignment and an additional layout shift. [ Already posted ]
  • line 2996: When a workspace asset's signed URL is renewed after it has decoded, this new ChatMarkdownAssetImage path keeps the existing loadedSrc but passes the new non-null src. ChatMarkdownImage therefore considers it settled and immediately replaces the visible <img> source with the not-yet-loaded URL, rather than retaining the decoded bitmap while the replacement downloads. Signed-URL refreshes can consequently show a blank/broken image during loading, defeating the intended no-flicker behavior. [ Already posted ]