-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Reserve cover image space to prevent CLS in list view search results #12825
Copy link
Copy link
Open
Labels
Affects: ExperienceIssues relating directly to service design & patrons experienceIssues relating directly to service design & patrons experienceLead: @lokeshIssues pertaining to front-end design system [css, js, components]Issues pertaining to front-end design system [css, js, components]Needs: ResponseIssues which require feedback from leadIssues which require feedback from leadNeeds: Review AssigneePriority: 3Issues that we can consider at our leisure. [managed]Issues that we can consider at our leisure. [managed]Theme: CSSIssues related to CSS stylesheets. [managed]Issues related to CSS stylesheets. [managed]Theme: PerformanceIssues related to UI or Server performance. [managed]Issues related to UI or Server performance. [managed]Type: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]Issue describes a feature or enhancement we'd like to implement. [managed]
Description
Activity
Metadata
Metadata
Assignees
Labels
Affects: ExperienceIssues relating directly to service design & patrons experienceIssues relating directly to service design & patrons experienceLead: @lokeshIssues pertaining to front-end design system [css, js, components]Issues pertaining to front-end design system [css, js, components]Needs: ResponseIssues which require feedback from leadIssues which require feedback from leadNeeds: Review AssigneePriority: 3Issues that we can consider at our leisure. [managed]Issues that we can consider at our leisure. [managed]Theme: CSSIssues related to CSS stylesheets. [managed]Issues related to CSS stylesheets. [managed]Theme: PerformanceIssues related to UI or Server performance. [managed]Issues related to UI or Server performance. [managed]Type: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]Issue describes a feature or enhancement we'd like to implement. [managed]
Feature Request
Problem / Opportunity
List view search results shift vertically when cover images load because the browser doesn't reserve enough space for the covers. The current CSS sets width and max-height, but doesn't assign a height value that can be used to reserve space during initial layout. This affects users browsing search results for specific books or categories because the page moves as covers load.
The layout shifts may reduce user experience and produce a lower Lighthouse CLS performance score.
Under a consistent Lighthouse testing environment, CLS should be at or below 0.1. The cover image slots should remain stable while images load, and the cover images themselves should render correctly without any distortion.
Proposal
Add an aspect-ratio for search result cover images in list view so the browser can reserve space before the images load. This will reduce the layout shift on search result pages in list view, with minimal changes to the visual design and layout of the covers.
Extend the existing selector in
static\css\components\search-result-item.cssChrome Lighthouse report before changes:

Chrome Lighthouse report after changes. Cache was disabled to prevent previously loaded image sizes from being reused:

Breakdown
Implementation Details (for maintainers)
Related files
Refer to this map of common Endpoints:
*
Requirements Checklist
Checklist of requirements that need to be satisfied in order for this issue to be closed:
Stakeholders
Instructions for Contributors