Skip to content

[Performance & UX]: Implement Strict Image Aspect Ratios to Prevent Cumulative Layout Shift (CLS) on Dashboard #661

Description

@abhinavkdeval08-design

🧩 Problem

During initial page loads, images (like avatars, banners, or course thumbnails) render progressively without reserved dimensional space. This causes the text and UI elements to jump around the screen as images load, leading to a high Cumulative Layout Shift (CLS) score, which negatively impacts Lighthouse performance metrics and the overall user experience.

🎯 Expected Outcome

Enforce strict width, height, and aspect-ratio CSS configurations or utilize the Next.js <Image> component properly for all media assets across the main landing and dashboard pages to reserve bounding boxes before image fetching.

✅ Acceptance Criteria

  • Audit the dashboard and course listing grids for bare <img> tags.
  • Implement aspect-ratio utility classes (e.g., aspect-square, aspect-video) using TailwindCSS.
  • Verify that the Lighthouse CLS score drops closer to 0.00 on simulated slow 3G network conditions.

Labels requested: level:advanced, type:performance, type:UX

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions