Skip to content

fix: optimize hero image and migrate to next/image#346

Open
van456-dot wants to merge 2 commits intoAOSSIE-Org:mainfrom
van456-dot:fix/image-optimization
Open

fix: optimize hero image and migrate to next/image#346
van456-dot wants to merge 2 commits intoAOSSIE-Org:mainfrom
van456-dot:fix/image-optimization

Conversation

@van456-dot
Copy link

@van456-dot van456-dot commented Mar 22, 2026

Description

This PR improves image performance and loading behavior across the website by optimizing assets and using Next.js best practices.

Fixes #344

Changes made:

  • Converted large hero image (resonate_app.png) to WebP format (~144KB)

  • Migrated multiple components from <img> to next/image:

    • Features
    • TechStack
    • About
    • NavBar
    • DownloadApp
  • Ensured compatibility with static export by retaining images.unoptimized: true in next.config.js

Motivation & Context:

The project currently uses static export (output: 'export'), which disables Next.js Image Optimization API.
However, using next/image still provides benefits like responsive loading and better layout handling.

Additionally, existing PNG images were relatively large (>200KB) and already showed pixelation on zoom. Converting them to WebP reduces size significantly without noticeable quality loss in normal usage.


Type of change

  • UI/UX update (design changes, interface improvements)
  • Refactor (does not change functionality, e.g. code style improvements, linting)

How Has This Been Tested?

  • Ran the application locally using npm run dev
  • Verified all updated components render correctly
  • Compared PNG vs WebP images visually in browser (normal usage)
  • Confirmed no layout shifts or UI breakage after switching to next/image
  • Checked that static export works without runtime errors

Screenshots:
(Add before/after screenshots here if possible)


Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (not required)
  • My changes generate no new warnings
  • I have added tests (not applicable for UI change)
  • New and existing unit tests pass locally (not applicable)
  • Any dependent changes have been merged (not applicable)
  • I have checked my code and corrected any misspellings

Maintainer Checklist

Summary by CodeRabbit

  • Refactor

    • Migrated image rendering across multiple components to the Next.js Image component.
    • Switched the hero artwork from PNG to WebP and added responsive sizing for feature visuals.
    • Added explicit dimensions for several app images (e.g., QR and logo displays).
  • Style

    • Minor navigation styling refinements and whitespace cleanup in related CSS.

@van456-dot van456-dot requested a review from a team as a code owner March 22, 2026 14:14
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e8f4b02-0792-428a-8caa-c3056eeaaefb

📥 Commits

Reviewing files that changed from the base of the PR and between fcc04b7 and 2ac9ba5.

📒 Files selected for processing (2)
  • app/components/Layout/NavBar/Navbar.css
  • app/components/Layout/NavBar/index.jsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/components/Layout/NavBar/index.jsx
  • app/components/Layout/NavBar/Navbar.css

📝 Walkthrough

Walkthrough

Converted native HTML <img> elements to Next.js Image components across several UI components; hero image switched from PNG to WebP; minor CSS change removed .logo-icon height declaration. No exported APIs or component signatures were changed.

Changes

Cohort / File(s) Summary
Generic Image Migration
app/components/About/About.jsx, app/components/DownloadApp/DownloadApp.jsx, app/components/TechStack/TechStack.jsx, app/components/Layout/NavBar/index.jsx
Replaced native <img> with next/image Image, passed imported image modules as src, preserved alt/class names, and added explicit width/height where present (DownloadApp QR and NavBar logo).
Responsive Feature Images
app/components/Features/Features.jsx
Switched feature visuals to next/image, updated source usage from feature.image.srcfeature.image, removed fixed width/height and added sizes plus responsive inline sizing.
Hero Asset Conversion
app/components/Hero/Hero.jsx
Swapped hero import from PNG to WebP (resonate_app.pngresonate_app.webp) and used that asset with next/image.
CSS Adjustment
app/components/Layout/NavBar/Navbar.css
Removed .logo-icon height: 24px; declaration and made whitespace/keyframe formatting tweaks only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement, design-migration

Suggested reviewers

  • M4dhav

Poem

🐰 I hopped through JSX, light on my paws,

Swapped tags for Image, obeying new laws,
WebP for the hero, QR snug and neat,
Pixels compressed — my carrot's a treat! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #344: it migrates components to next/image and converts the hero image to WebP, but does not enable built-in image optimization (unoptimized: true remains unchanged in next.config.js). Address the incomplete implementation of issue #344: document the decision to keep unoptimized: true due to static export constraints, or remove this setting and test static export compatibility to fully enable Next.js image optimization.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: hero image optimization (conversion to WebP) and migration to next/image across multiple components.
Out of Scope Changes check ✅ Passed CSS changes to Navbar.css (removing .logo-icon height declaration and formatting adjustments) are in-scope for aligning logo sizing with next/image migration; all other changes directly address the linked issue objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/Layout/NavBar/Navbar.css`:
- Around line 33-35: Remove the hardcoded CSS dimensions in Navbar.css (the
width: 13.48px and height: 24px rules) that conflict with the JSX Image props;
instead let the Image's width/height props control size and/or apply a matching
CSS class that does not override those props. Then update the Image in the
NavBar component (the Image element in app/components/Layout/NavBar/index.jsx)
so its width and height props match the intended display size (choose and set
either width={13} height={24} or width={40} height={40} consistently) and ensure
no other CSS selector in Navbar.css forces different dimensions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a2bb7f6-2d57-4b4c-ba9b-1611f43c87f3

📥 Commits

Reviewing files that changed from the base of the PR and between ee40ec9 and fcc04b7.

⛔ Files ignored due to path filters (1)
  • app/assets/resonate_app.png is excluded by !**/*.png
📒 Files selected for processing (8)
  • app/assets/resonate_app.webp
  • app/components/About/About.jsx
  • app/components/DownloadApp/DownloadApp.jsx
  • app/components/Features/Features.jsx
  • app/components/Hero/Hero.jsx
  • app/components/Layout/NavBar/Navbar.css
  • app/components/Layout/NavBar/index.jsx
  • app/components/TechStack/TechStack.jsx

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.

perf: enable Next.js image optimization and compress images

1 participant