Skip to content

⚡ Bolt: Optimize ProjectsView Images and Fix Astro Integration - #161

Open
fysp11 wants to merge 1 commit into
mainfrom
bolt-projectsview-image-optimization-14895692531077196425
Open

⚡ Bolt: Optimize ProjectsView Images and Fix Astro Integration#161
fysp11 wants to merge 1 commit into
mainfrom
bolt-projectsview-image-optimization-14895692531077196425

Conversation

@fysp11

@fysp11 fysp11 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

💡 What:

  • Removed the unsupported Astro <Image /> component from ProjectsView.tsx which was silently failing or rendering unoptimized.
  • Pre-computed optimal WebP image urls using import.meta.glob and Astro's getImage function within projects/index.astro.
  • Added conditional logic in React to apply fetchPriority="high" and loading="eager" only to the first few images (above the fold), defaulting to lazy for the rest.
  • Fixed React attribute console warnings.

🎯 Why:

  • The original code was using unsupported imports (astro:assets inside React).
  • Relying entirely on raw unoptimized assets resulted in large image payloads (e.g. loading a 1.8MB 3D project image for an 80x80 list thumbnail).
  • Using standard <img> tags with optimal dimensions generated via getImage() restores the build-time optimizations safely while ensuring LCP isn't blocked by fetching a dozen eager images.

📊 Impact:

  • Drastically reduces image payload size in List view (fetching 80x80 instead of original source).
  • Better Main Thread performance by correctly using decoding="async" combined with conditional lazy loading for below-the-fold images.
  • Removes hydration warnings.

🔬 Measurement:

  • Run pnpm run build and observe in the .dist folder that optimized 80x80 and 800x600 WebP versions of the project images are correctly generated and referenced by the frontend payload.

PR created automatically by Jules for task 14895692531077196425 started by @fysp11

…act component

- Replaced invalid Astro `<Image />` import inside React with standard `<img>` tags.
- Hooked into `import.meta.glob` and `getImage` server-side to restore build-time WebP conversions and precise dimensions.
- Corrected React hydration warnings (`class` to `className` and `fetchpriority` to `fetchPriority`).
- Configured LCP image optimization using index-based `loading="eager"` (for first 2/4 items) and `lazy` for below-the-fold content.

Co-authored-by: fysp11 <13081700+fysp11@users.noreply.github.com>
@kinsta

kinsta Bot commented Jul 31, 2026

Copy link
Copy Markdown

Preview deployments for fysp11.github.io ⚡️

Status Branch preview Commit preview
✅ Ready Visit preview Visit preview

Commit: 6cfc7a57e94c89b0591805f94d1231d88067262a

Deployment ID: 87a20085-a7bd-4b8c-9a4d-be159036b258

Static site name: fysp11githubio-cleb3

@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.

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