Skip to content

⚡ Bolt: Optimize speaker images and background#28

Open
anyulled wants to merge 2 commits intomainfrom
perf/optimize-speakers-images-14114722114599355174
Open

⚡ Bolt: Optimize speaker images and background#28
anyulled wants to merge 2 commits intomainfrom
perf/optimize-speakers-images-14114722114599355174

Conversation

@anyulled
Copy link
Copy Markdown
Owner

@anyulled anyulled commented Feb 8, 2026

💡 What: Replaced CSS background image and standard <img> tags with Next.js <Image /> components in the Speakers section.
🎯 Why: To leverage automatic image optimization, lazy loading, and responsive sizing, reducing LCP and cumulative layout shift.
📊 Impact: Expected reduction in image payload size and improved loading performance on mobile devices.
🔬 Measurement: Verified with visual regression testing and unit tests.


PR created automatically by Jules for task 14114722114599355174 started by @anyulled

Summary by CodeRabbit

  • Tests

    • Added comprehensive unit tests for component rendering, speaker information display, and image asset verification.
  • Improvements

    • Optimized image rendering and loading performance across components.

Co-authored-by: anyulled <100741+anyulled@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
devbcn Ready Ready Preview, Comment Feb 8, 2026 10:14am

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @anyulled, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the loading performance and user experience of the Speakers section by migrating image handling to Next.js's built-in Image component. This transition is expected to significantly reduce the overall image payload size and improve core web vitals, particularly benefiting mobile users through better loading times and reduced layout shifts.

Highlights

  • Image Optimization: Replaced the CSS background image with a Next.js Image component in the Speakers section to leverage automatic optimization.
  • Speaker Image Conversion: Converted standard <img> tags used for speaker profile pictures to Next.js Image components for improved performance and responsiveness.
  • Performance Enhancement: The changes aim to utilize Next.js's built-in image optimization features, including lazy loading and responsive sizing, to reduce Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS).
Changelog
  • tests/components/sections/home8/Section5.test.tsx
    • Added a new test file to verify the correct rendering of speaker information and the newly implemented Next.js Image components for both the background and speaker profile pictures.
  • components/sections/home8/section5.tsx
    • Imported the Image component from next/image.
    • Refactored the background image implementation from a CSS background-image property on a div to a Next.js Image component, configured with fill and objectFit: "cover".
    • Replaced native <img> tags used for speaker profile pictures with Next.js Image components, setting fill, sizes for responsiveness, and objectFit: "cover".
    • Adjusted parent container styles for the speaker images to include position: "relative" and aspectRatio to ensure proper sizing and positioning with the Next.js Image component.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 8, 2026

Important

Review skipped

Too many files!

This PR contains 190 files, which is 40 over the limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
📝 Walkthrough

Walkthrough

The PR adds a new test file for the Section5 component and updates the component to replace CSS background images and standard img tags with Next.js Image components for optimized image handling. Both background and speaker avatar images now use Next.js Image with appropriate sizing and positioning.

Changes

Cohort / File(s) Summary
Test Addition
__tests__/components/sections/home8/Section5.test.tsx
Adds comprehensive unit tests for Section5 component, mocking Swiper, Next.js Link, and verifying rendering of speaker names, event counts, background images, and speaker avatars.
Image Optimization
components/sections/home8/section5.tsx
Replaces CSS background-image and img tags with Next.js Image components for both background and speaker avatar images, adding proper positioning, z-index layering, and responsive sizing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Hops through images with glee,
CSS backgrounds hop-flee,
Next.js Image, optimized and bright,
Speakers parade in responsive delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is directly related to the main changeset. The PR replaces CSS background images and img tags with Next.js Image components in the speaker section for performance optimization, which is precisely what the title 'Optimize speaker images and background' describes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch perf/optimize-speakers-images-14114722114599355174

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully optimizes image handling by replacing standard <img> tags and CSS background images with the Next.js <Image> component. The changes are well-implemented and correctly leverage features like fill, sizes, and priority for better performance and reduced layout shift. The addition of unit tests is also a great step to ensure these changes are working as expected. My feedback focuses on improving maintainability by suggesting the extraction of inline styles into CSS classes.

Comment on lines +77 to +79
<div className="team8-section-rea sp1" style={{ position: "relative" }}>
<Image src="/assets/img/bg/header-bg20.png" alt="Background" fill priority={false} style={{ objectFit: "cover", zIndex: -1 }} />
<div className="container" style={{ position: "relative", zIndex: 1 }}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability and separation of concerns, consider moving these inline styles to CSS classes. This will make the component's structure cleaner and the styles easier to manage and reuse across the application.

For example, you could define classes in your stylesheet and apply them here:

CSS:

.background-container {
  position: relative;
}

.background-image {
  object-fit: cover;
  z-index: -1;
}

.content-container {
  position: relative;
  z-index: 1;
}

JSX:

<div className="team8-section-rea sp1 background-container">
  <Image ... className="background-image" />
  <div className="container content-container">
    {/* ... */}
  </div>
</div>

Comment on lines +101 to 111
<div className="img1 image-anime" style={{ position: "relative", aspectRatio: "250/307" }}>
<Link href={`/${year}/speakers/${speaker.id}`} style={{ display: "block", position: "relative", width: "100%", height: "100%" }}>
<Image
src={speaker.profilePicture || "/assets/img/all-images/team/team-img28.png"}
alt={speaker.fullName}
fill
sizes="(max-width: 575px) 100vw, (max-width: 991px) 50vw, (max-width: 1199px) 33vw, 25vw"
style={{ objectFit: "cover" }}
/>
</Link>
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the background image, the inline styles used for the speaker images and links could be extracted into dedicated CSS classes. This would improve the readability of the component and centralize styling logic, making future updates easier.

Here's an example of how you could structure this:

CSS:

.speaker-image-wrapper {
  position: relative;
  aspect-ratio: 250 / 307;
}

.speaker-image-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.speaker-image {
  object-fit: cover;
}

JSX:

<div className="img1 image-anime speaker-image-wrapper">
  <Link href={...} className="speaker-image-link">
    <Image
      ...
      className="speaker-image"
    />
  </Link>
</div>

Co-authored-by: anyulled <100741+anyulled@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant