WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Plan to Eliminate CLS on Home Page

  • Analyze the Partners-home section component causing CLS
  • Implement skeleton/placeholder for partner images to reserve space
  • Test the changes with development server
  • Verify no layout shift occurs during image loading
  • Take screenshots to demonstrate the fix

Changes Made

Fixed Cumulative Layout Shift (CLS) in Partners Section

Root Cause:
The LazyPartnerImage component was returning null while images were loading, causing no space to be reserved. When images loaded, they caused the layout to shift.

Solution:

  • Modified LazyPartnerImage to render a placeholder div with exact image dimensions while loading
  • Added corresponding CSS styling for the placeholder to match image margins
  • This reserves space before images load, preventing layout shift

Files Modified:

  1. src/sections/Home/Partners-home/index.js - Added placeholder div with dimensions
  2. src/sections/Home/Partners-home/partnerSection.style.js - Added CSS for placeholder
Original prompt

This section details on the original issue you should resolve

<issue_title>Eliminate Cumulative Layout Shift (CLS) on home page</issue_title>
<issue_description>### Current Behavior
The attached screenshot has an example of unwanted behavior in which content is displayed to halfway while it is only partially rendered.

Desired Situation

Ideally content is fully rented before is displayed so as to avoid a negative CLS effect. Appropriately sized placeholders can be used as one of the techniques to prevent unwanted shifting.

Screenshot

Image

Contributor Resources and Handbook

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

Join the Layer5 Community by submitting your community member form.
</issue_description>

<agent_instructions>Split each improvement into it's own pull request.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@leecalcote leecalcote marked this pull request as ready for review December 8, 2025 22:55
@l5io
Copy link
Contributor

l5io commented Dec 9, 2025

🚀 Preview for commit 65e8a97 at: https://69383b2a8c93ba093ec38476--layer5.netlify.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminate Cumulative Layout Shift (CLS) on home page

3 participants