feat(trustlab): add image lightbox preview to HorizontalGallery#1432
feat(trustlab): add image lightbox preview to HorizontalGallery#1432koechkevin wants to merge 8 commits intomainfrom
Conversation
…nd payload structure
Adds a full-screen lightbox preview when clicking images in the HorizontalGallery component. - New ImageLightbox component built on MUI Modal with previous/next navigation buttons, image counter, and keyboard support (Arrow keys + Escape) - Clicking any gallery image opens the lightbox at the correct index, calculated from chunk position - Gallery thumbnails now show a subtle scale + shadow hover effect and a pointer cursor to signal interactivity - Full test suite for ImageLightbox covering open/close state, navigation bounds, counter visibility, keyboard events, and backdrop click
|
|
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
👍🏽
It seems there is an invisible div around the image. The Lightbox closes only when I click outside this invisible div.
Lets also make the lightbox slightly darker so the image is more easily distinguishable from the background content on the page.
From Claude:
Issues
Bug — Invalid MUI sx background value (OpportunityList.js:149)
background: "common.white" is not a valid MUI sx shorthand. MUI theme tokens work with bgcolor (shorthand) or
backgroundColor, not background. This will render as a literal CSS string "common.white" instead of the theme color.
Should be:
sx={{ bgcolor: "common.white", px: { xs: 2.5, md: 0 } }}
Accessibility — aria-labelledby has no matching element (ImageLightbox.js:65)
<Modal aria-labelledby="image-lightbox" ...>
There's no element in the component with id="image-lightbox". This breaks the ARIA association. Either add an id to a
title element (e.g. a visually-hidden heading), or switch to aria-label:
<Modal aria-label="Image lightbox" ...>
Minor — Redundant backdrop close logic
The Modal already calls onClose on outside-click via its built-in backdrop. The inner Box also has handleBackdropClick
doing the same check. This results in onClose being called twice on backdrop click (harmless since it just sets state
to false, but worth cleaning up).
…improved user experience
…nd adjust styling for better responsiveness
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4c69a39c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| caption: doc.caption, | ||
| location: doc.location, | ||
| date: doc.createdAt ? formatDate(doc.createdAt, "dd-MM-yyyy") : null, | ||
| date: doc.date ? formatDate(doc.date, "dd-MM-yyyy") : null, |
There was a problem hiding this comment.
Align opportunity filters with the new event date field
This change switches the card date source to doc.date, but the year/month predicates in getOpportunities still filter on createdAt (the where.and conditions above), so results are now inconsistent whenever event date and record creation date differ. In practice, users can select a month/year and get opportunities whose displayed dates fall outside that filter window. The filter conditions should use the same date field now used for rendering.
Useful? React with 👍 / 👎.
| : { | ||
| href: orgData.website?.url ?? null, | ||
| ...orgData.website, | ||
| href: orgData?.link?.href ?? null, |
There was a problem hiding this comment.
Preserve legacy organization links during field rename
The mapper now reads only orgData.link?.href for non-card variants, but the schema previously stored this under website and this commit also renames that field without a migration. Existing organization records will therefore resolve to null links and render non-clickable chips/cards until every record is manually backfilled. Keep a backward-compatible fallback (e.g. legacy website value) or add a migration before removing the old path.
Useful? React with 👍 / 👎.
|
@claude review |
|
Claude finished @kilemensi's task in 2m 45s —— View job Code Review
Overall this is a well-structured PR with good test coverage for Bugs1. Image cut-off in lightbox (
|
No, not editable on CMS. They're programatically computed from 2020 to current year @kilemensi |
I think they should be editable in the CMS... if we're computing, we should compute them in such a way that they contain years with actual barazas. What is the point of showing 2020 - 2025 if there is no data for them? |
…dimensions for better responsiveness




Description
This PR covers three related bug fixes and feature enhancements to the TrustLab app's opportunities and gallery
UX.
HorizontalGallery
backdrop click, and fallback to src when url is absent
event date
the filter bar
CMS
Test plan
correct image
correct date
on the front end
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Screenshots
Checklist: