Bug: UIKit PreviewBlock cover image tiles repeatedly and stretches across viewport when zoomed out

Đang mở Phù hợp với người mới
#1,480 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@swarnendusahu10-dotcom đang làm issue này rồi.

Từ ngày 1/12/2026.

  • #1481 của @swarnendusahu10-dotcom — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
css, javascript, react
Lĩnh vực
frontend

Hướng nghiên cứu

Tìm các component MessageGenericPreview và MessageGenericPreviewCoverImage, rồi đọc cách chúng đặt chiều rộng của thẻ xem trước và kiểu của ảnh bìa. Đặt chiều rộng tối đa của thẻ là 368px và để ảnh bìa hiển thị một lần, căn giữa và được co giãn để phủ kín khu vực. Xác minh rằng phần xem trước vẫn gọn và ảnh không lặp thành ô trên viewport rộng hoặc khi giảm mức thu phóng của trình duyệt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

When a message contains a UIKit preview block (for example, a GitHub PR/issue link preview generated by a Rocket.Chat App), EmbeddedChat renders the preview card across the full width of the chat and repeats/tiles the cover image both horizontally and vertically—especially noticeable on wide viewports or when zooming out (e.g., 50% or 25% browser zoom).

Steps to Reproduce
  1. Open EmbeddedChat in a channel containing a GitHub PR/issue preview block (e.g., #community-chat-any-topic).
  2. View the message on a wide screen or zoom the browser out to 50% / 25%.
  3. Observe the link preview image.
Expected Behavior

The preview card should remain a compact card (max-width: 368px, matching Rocket.Chat's UI) and the cover image should render once, scaled cleanly (background-repeat: no-repeat, background-size: cover, background-position: center).

Actual Behavior
  • MessageGenericPreview has no max-width constraint, causing the card to stretch to the full message container width.
  • MessageGenericPreviewCoverImage sets background-image: url(...) without background-repeat: no-repeat, background-size: cover, or background-position: center, causing the image to tile repeatedly across the expanded container.
Screen Recording / Screenshots

https://github.com/user-attachments/assets/2ba85987-9b37-4908-97e6-471cec17d512

Ngôn ngữ chính
JavaScript
Star
171
Fork
421
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RocketChat/EmbeddedChat

Tất cả issue của RocketChat/EmbeddedChat

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.