fix: preserve aspect ratio for URL image previews#40399
fix: preserve aspect ratio for URL image previews#40399TasfinMahmud wants to merge 1 commit intoRocketChat:developfrom
Conversation
Images shared via URL previews (e.g., Giphy GIFs) were being stretched to fill the Box dimensions independently, causing distorted aspect ratios. Added object-fit: contain and width: auto to MessageGenericPreviewImage so images scale proportionally within the maxHeight constraint. Closes RocketChat#40289
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 73f3993 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (2)📚 Learning: 2026-03-16T21:50:37.589ZApplied to files:
📚 Learning: 2026-03-27T14:52:56.865ZApplied to files:
🔇 Additional comments (2)
WalkthroughA patch release for ChangesImage Aspect Ratio Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Fixes #40289
Images shared via URL previews (e.g., Giphy GIFs) were being stretched to fill the Box dimensions independently, causing distorted aspect ratios.
Added
object-fit: containandwidth: autotoMessageGenericPreviewImageso images scale proportionally within themaxHeightconstraint.Changes
styleprop ofMessageGenericPreviewImageinUrlImagePreview.tsxto maintain aspect ratios.maxHeightboundary provided byuseOembedLayout().Checklist
[NEW],[IMPROVE],[FIX],[BREAK],[CHORE],[DOC].Summary by CodeRabbit