Skip to content

Commit afc2334

Browse files
authored
fix(web): prevent image thumbnails from warping during repaints (#26308)
1 parent cafdcda commit afc2334

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/components/chat/GuestMessageAttachments.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ export function GuestMessageAttachments(props: {
4343
aria-label={`Preview ${image.name}`}
4444
onClick={() => props.onOpenImage(image)}
4545
>
46+
{/* Isolate the thumbnail raster from nearby activity repaints in Chromium. */}
4647
<AttachmentImage
4748
name={image.name}
4849
mimeType={image.mimeType}
4950
src={src}
5051
alt={image.name}
5152
decoding="async"
52-
className="block size-full object-cover"
53+
className="block size-full transform-gpu object-cover"
5354
/>
5455
</button>
5556
) : (

‎apps/web/src/components/chat/TimelineUserMessageRow.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,14 +524,15 @@ function UserTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "message"
524524
ctx.onImageExpand(preview);
525525
}}
526526
>
527+
{/* Isolate the thumbnail raster from nearby activity repaints in Chromium. */}
527528
<AttachmentImage
528529
name={image.name}
529530
mimeType={image.mimeType}
530531
src={image.previewUrl}
531532
alt={image.name}
532533
decoding="async"
533534
loading="lazy"
534-
className="block size-full object-cover"
535+
className="block size-full transform-gpu object-cover"
535536
/>
536537
</button>
537538
) : (

0 commit comments

Comments
 (0)