site: thumbnails are upscaled 2-4x in the cards view and on the entry strip, and the entry strip image is lazy-loaded although it is the LCP element
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/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ệ
- javascript
- Lĩnh vực
- frontend, performance
Hướng nghiên cứu
Start with site/lib/cards.mjs:33, site/lib/entry-page.mjs:107-108, and the card sizing rules at site/public/styles.css:1797-1798; compare how thumbnails are rendered in list, cards, and entry views. Check site/thumbs.mjs for source selection and lib.test.mjs for relevant coverage. Done means thumbnails stay within 1.5× their natural width, entry images above the fold load eagerly, and tests cover small thumbnails and the eager option.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why it matters
The view toggle is the headline of the site refresh. Switching a list-default category (Audio, Fonts, Tools, Video) to Cards turns small publisher images into a blurry smear, which reads as a broken site rather than a licence-gated preview. On the 192 entry pages with a preview, that image is the largest element above the fold and loading="lazy" makes the browser wait for layout before requesting it, the classic LCP regression.
Evidence (at 69387df, local build served at 375x667 and 1440x900)
- Cards upscaling: on
/category/audio/at 375 px, list view renders the first thumb at 56x56 from a 160x120 source; after clicking Cards the same<img>renders at 341x213 CSS px (682x426 device px at DPR 2).site/lib/cards.mjs:33emits one<img width height loading="lazy">for both views;site/public/styles.css:1797-1798forcesaspect-ratio: 16 / 10. About 15 stored thumbs are under 400 px wide. - Entry strip: on
/entry/kenney/, the LCP candidate isIMG.entry-thumb-img; its request starts only afterstyles.cssfinishes, and the element hasloading === "lazy".site/lib/entry-page.mjs:107-108reusesthumbHtml()fromcards.mjs:33, which hard-codesloading="lazy" decoding="async". The 600x300 source is laid out 870 CSS px wide at 375 px (DPR 2), nearly 3x upscaled.
Suggested approach
In cards.mjs, treat t.width < 400 as "small": render the card thumb with object-fit: contain on the surface colour (the list style) or fall back to the typographic placeholder in cards view only. Give thumbHtml an { eager } option used by the entry strip (loading="eager" fetchpriority="high") and add <link rel="preload" as="image"> to the entry head. Cap the strip at twice its natural width with object-fit: contain. In site/thumbs.mjs, prefer the larger of og:image and twitter:image when the chosen one is under 400 px.
Done when
No thumb is drawn above 1.5x its natural width; no entry page has a lazy image above the fold; lib.test.mjs covers the small-thumb branch and the eager option.
- Ngôn ngữ chính
- JavaScript
- Star
- 58
- Fork
- 15
- Merge trung bình
- 18 giờ 42 phút
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/Free-Game-Dev-Assets
-
community marketing priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TMHSDigital/Free-Game-Dev-Assets#151 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Free-Game-Dev-Assets#72 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
TMHSDigital/Free-Game-Dev-Assets#3 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
correction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 57/100
TMHSDigital/Free-Game-Dev-Assets#162 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
marketing priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
TMHSDigital/Free-Game-Dev-Assets#152 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/Free-Game-Dev-Assets
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
swc-project/swc-next#1165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nhsuk/nhsuk-prototype-kit-package#439 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: &TV LogoĐang mởcheck:passed logos:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
-
BUG: Appointment time renders blank and PM appointment slots miscalculate vertical position in CalendarScreenCó thể đã có người làm @aryanpatil-07 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/BabyNest#297 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Onboarding form: instructor radio never pre-selected "Yes" (permission vs permissions typo)Có thể đã có người làm @ThakuraAnki đã nhận hôm nay. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
WikiEducationFoundation/WikiEduDashboard#7235 ·
Maintainer thường phản hồi trong vòng 1 ngày