Skip to content
TypeScript

fix(web): prevent image thumbnails from warping during repaints (#26308)

Yash Singhafc233492d83
diff --git a/apps/web/src/components/chat/GuestMessageAttachments.tsx b/apps/web/src/components/chat/GuestMessageAttachments.tsx
index e66fefb7d27..6d420d9a670 100644
--- a/apps/web/src/components/chat/GuestMessageAttachments.tsx
+++ b/apps/web/src/components/chat/GuestMessageAttachments.tsx
@@ -43,13 +43,14 @@ export function GuestMessageAttachments(props: {
aria-label={`Preview ${image.name}`}
onClick={() => props.onOpenImage(image)}
>
+ {/* Isolate the thumbnail raster from nearby activity repaints in Chromium. */}
<AttachmentImage
name={image.name}
mimeType={image.mimeType}
src={src}
alt={image.name}
decoding="async"
- className="block size-full object-cover"
+ className="block size-full transform-gpu object-cover"
/>
</button>
) : (
diff --git a/apps/web/src/components/chat/TimelineUserMessageRow.tsx b/apps/web/src/components/chat/TimelineUserMessageRow.tsx
index 897685a849f..2b231f6ddfe 100644
--- a/apps/web/src/components/chat/TimelineUserMessageRow.tsx
+++ b/apps/web/src/components/chat/TimelineUserMessageRow.tsx
@@ -524,6 +524,7 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
ctx.onImageExpand(preview);
}}
>
+ {/* Isolate the thumbnail raster from nearby activity repaints in Chromium. */}
<AttachmentImage
name={image.name}
mimeType={image.mimeType}
@@ -531,7 +532,7 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
alt={image.name}
decoding="async"
loading="lazy"
- className="block size-full object-cover"
+ className="block size-full transform-gpu object-cover"
/>
</button>
) : (