Skip to content

Commit 764b840

Browse files
fix(connect): stop cropping agent intro artwork
The intro slides used a fixed height + objectFit:cover, so when the box was narrower than the image's aspect ratio (e.g. the 460px About Agent modal) the sides were cropped — clipping the edge labels like "Your AI agent". Scale to the container width at the image's natural aspect ratio (height:auto) so the whole artwork always shows; imageHeight now caps the height on wide containers and only letterboxes if that cap engages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 57445fb commit 764b840

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

frontend/components/AgentIntroduction/IntroductionStep.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ const AnimatedImage = ({ imgSrc, alt, imageHeight }: AnimatedImageProps) => (
4545
width={0}
4646
height={0}
4747
sizes="100vw"
48-
// Fixed height keeps slide heights consistent; `cover` preserves the
49-
// aspect ratio (a bare min-height stretched images whose natural
50-
// height at the container width fell short of it).
48+
// Scale to the container width at the image's natural aspect ratio so
49+
// the whole artwork shows — it has labels at the edges, so a fixed
50+
// height + `cover` clipped them whenever the box was narrower than the
51+
// image's aspect ratio (e.g. the 460px About Agent modal). `imageHeight`
52+
// caps the height on wide containers; `contain` only letterboxes if that
53+
// cap engages.
5154
style={{
5255
width: '100%',
53-
height: imageHeight ?? 416,
54-
objectFit: 'cover',
56+
height: 'auto',
57+
maxHeight: imageHeight ?? 416,
58+
objectFit: 'contain',
5559
}}
5660
/>
5761
</motion.div>

0 commit comments

Comments
 (0)