Skip to content

Conversation

@shrvansudhakara
Copy link
Contributor

🗒️ Description

This PR adds support for displaying featured images in work experience entries with an interactive lightbox gallery. Users can now showcase visual highlights from their roles (project screenshots, team photos, etc.).

Fixes #8

📝 Changes

Modified Files

  • src/content.config.ts - Added images field to job collection schema
  • src/components/ui/WorkExperience.astro - Added image thumbnail display and lightbox integration
  • src/content/jobs/ - Reorganized into subdirectories (each job in its own folder)

New Files

  • src/components/ui/ImageLightbox.tsx - React component for full-screen image gallery with navigation
  • src/content/jobs/reboot-studio/index.mdx - Restructured with example images
  • src/content/jobs/reboot-studio/image-*.jpg - Example featured images

🚀 Features

  • Featured images: Work experience entries can now include multiple images
  • Thumbnail gallery: Images display as clickable thumbnails below job descriptions
  • Lightbox viewer: Click any image to open full-screen gallery view
  • Navigation: On-screen arrows and dot indicators for browsing images
  • Responsive design: Works seamlessly on desktop and mobile
  • Optional feature: Images are optional - jobs without images display normally

🔧 Implementation Details

Schema update:

images: z.array(image()).optional()

Directory structure:

src/content/jobs/
├── reboot-studio/
│   ├── index.mdx
│   ├── image-1.jpg
│   ├── image-2.jpg
│   └── ...
└── sofia/
    └── index.mdx

Lightbox features:

  • Full-screen overlay with dark backdrop
  • Image navigation (prev/next arrows)
  • Dot indicators for multi-image galleries
  • Click outside or X button to close
  • Keyboard navigation support

✅ Testing

  • Images display as thumbnails below job description
  • Clicking thumbnail opens lightbox
  • Navigation arrows work (prev/next)
  • Dot indicators switch between images
  • Close button (X) closes lightbox
  • Click outside image closes lightbox
  • Experiences without images display normally
  • Multiple experiences with images work independently
  • No console errors in development mode
  • Build succeeds without errors

📸 Screenshots

Thumbnail Gallery:
thumbnail-gallery

Lightbox View:
light-box-view-1
light-box-view-2
light-box-view-3
light-box-view-4

🎥 Demo

demo.mp4

🔗 Related



Note: Feature is optional and won't affect experiences without image(s).

Add support for displaying featured images in work experience entries with lightbox gallery view.

Closes coderdiaz#8
@shrvansudhakara
Copy link
Contributor Author

@coderdiaz, Pls review the PR.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds image gallery functionality to work experience entries, allowing job entries to display thumbnail images that open in a lightbox viewer when clicked.

  • Adds optional images field to job collection schema
  • Creates a new React-based ImageLightbox component with navigation controls
  • Integrates image thumbnails and lightbox functionality into the WorkExperience component

Reviewed Changes

Copilot reviewed 4 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/content.config.ts Updates job collection schema to support optional image arrays
src/content/jobs/reboot-studio/index.mdx Adds sample image paths to demonstrate new image gallery feature
src/content/jobs/sofia/index.mdx Minor formatting fix (adds line number to trailing content)
src/components/ui/WorkExperience.astro Adds image thumbnail rendering and lightbox initialization script
src/components/ui/ImageLightbox.tsx New React component implementing image lightbox with navigation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderdiaz
Copy link
Owner

@shrvansudhakara Could you check the Copilot review? Thanks 🙏

shrvansudhakara and others added 5 commits October 30, 2025 13:45
- Removed `document.addEventListener('DOMContentLoaded', ...)` wrapper
- Script now executes immediately when the component renders
- Compatible with Astro's client-side navigation and view transitions

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Remove unnecessary Promise.all from image mapping
- Use stable keys for React list items
- Implement event delegation to prevent memory leaks
- Add accessibility attributes (role, aria-modal, aria-label)
- Add keyboard navigation support (Escape, Arrow keys)
- Fix top-level return error in Astro script by wrapping logic in if block
- Implement Framer Motion for smooth lightbox animations
- Preserve aspect ratio for vertical and horizontal images
- Add fade and scale transitions matching reference design
- Add body scroll lock when lightbox is open
@shrvansudhakara
Copy link
Contributor Author

@coderdiaz, Pls review the revisions

Copy link
Owner

@coderdiaz coderdiaz left a comment

Choose a reason for hiding this comment

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

Works amazing! Great job!

@coderdiaz
Copy link
Owner

:shipit:

@coderdiaz coderdiaz merged commit bb2f3b5 into coderdiaz:main Oct 31, 2025
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.

Show featured images into workexperience

2 participants