Skip to content

feat(event): show a class's photos as a masonry grid, lightbox on Radix Dialog - #530

Merged
Ardnived merged 9 commits into
mainfrom
feat/event-image-grid
Nov 27, 2026
Merged

Ardnived merged 9 commits into
mainfrom
feat/event-image-grid

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A class's photos show as a two-column CSS masonry of rounded tiles instead of an autoplaying carousel.
  • Tapping a tile still opens a full-screen lightbox, now on Radix Dialog; Swiper and yet-another-react-lightbox are removed.

Change outline

Components — the event page's images

The carousel and its lazy YARL lightbox become one component that takes the event's images directly.

 EventDetails                                       src/components/organisms/EventDetails/EventDetails.tsx
-  slides = useMemo(images → {src, alt, caption})
-  <div -mx-gutter>  ImageCarousel(slides)          # full-bleed, flush to the bottom
+  ImageGallery(images=event.images)                # inside the gutter, normal bottom padding
-ImageCarousel + lightbox.tsx                       src/components/molecules/ImageCarousel/
-  Swiper (autoplay, loop, pagination) + pause/play toggle
-  lazy(YARL Lightbox) + useFrozenPageScroll
+ImageGallery(images)                               src/components/molecules/ImageGallery/ImageGallery.tsx
+  images without a url → skipped; none left → null
+  div.columns-2 (one image → no columns)
+    button[data-vaul-no-drag].rounded-lg.break-inside-avoid → open at index
+      img width/height (reserves the tile's box), loading=lazy
+  Radix Dialog, portaled to overlayContainer(), useOpenerRestore for focus return
+    opens focused on the dialog; title "Photo 2 of 5"
+    close ×, Esc, prev/next buttons, ←/→ keys, touch swipe — direction from i18n.dir()
+    figcaption = alt text; the image itself alt=""

Types — event images

The event read now selects the stored file's dimensions so tiles hold their box before load.

 getEvent  populate.images                          src/config/api/fetch.ts
-  { url, filename, alt }
+  { url, filename, alt, width, height }
 EventImageSchema                                   src/types/event.ts
+  width, height: number | null | undefined

Files — removed dependencies and styling

 package.json
-  swiper, yet-another-react-lightbox
 src/styles/globals.css
-  @import swiper/css, swiper/css/a11y, swiper/css/pagination
 src/styles/base.css
-  .sy-carousel pagination theming
 scripts/assert-css-scoped.mjs
-  allow font-family swiper-icons; allow var(--swiper-*), var(--yarl__*)
 src/config/a11y/*.json  (event.a11y)
-  pause_slideshow
+  photo_position, previous_photo, next_photo, close_photo          # machine-translated, all 18 locales

Preview

  • Event with four images: the CI pr-<n> preview, path /1591 ("Meditation at Perth").
  • Component: the Ladle story Molecules / Image Gallery on the playground preview.

Test results

  • Lean gate --full (lint, typecheck, 2722 unit specs, build, CSS gate, bundle size): ✓
  • Browser lane: 26 passed
  • New specs: gallery SSR (layout, sizing, labels, vaul opt-out, url-less images) and a jsdom lightbox suite (open, step, wrap, keys, RTL, swipe, close, Esc, single image, caption/alt)

Manual verification

  1. Open /1591 on a phone width: two-column grid with rounded corners at the bottom of the class page.
  2. Tap a photo: full-screen view; swipe and arrows step through; the × or Esc closes it, returning to the class page.

Notes for reviewer

  • The lightbox no longer zooms or shows a thumbnail strip (YARL features); browser pinch-zoom remains. Agreed with the owner up front.
  • A local adversarial review ran before opening: its RTL, duplicate-alt, stale-doc and layout-shift findings are fixed in this PR; its swipe-guard finding went away with closing on a backdrop tap, which the old lightbox never did either. Its suggestion to rename the Swiper selector fixtures in scripts/postcss-scope-widget* was declined: they document the nesting shapes that motivated the scoping check, and still test it.
Detail
  • CSS columns fill top to bottom, so with five photos the left column holds 1–3 and the right 4–5; the lightbox steps in that same order.
  • translations.en.json still carries the CMS-side event.actions.pause_slideshow; it was already on RETIRING_KEYS (refactor(translations): no global declares a screen-reader-only string SahajCloud#1246) and leaves with that sync.
  • Security review (triggered by src/types/event, EventDetails, src/styles, package.json): no findings.

🤖 Generated with Claude Code

Ardnived and others added 8 commits November 26, 2026 18:05
…ix Dialog

The carousel becomes ImageGallery: a two-column CSS masonry of rounded
tiles, each opening a full-screen lightbox at itself. The lightbox is a
Radix Dialog (prev/next, arrow keys, swipe, Esc, click-outside), so
Swiper and yet-another-react-lightbox both leave the bundle, along with
the slideshow's pause control, its a11y string, the Swiper pagination
theming and the CSS gate's allowances for both libraries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 12:52Z review-pr · attempt 3 · session · done
  • 12:52Z review-pr · attempt 3 · session
  • 03:22Z review-pr · attempt 2 · session · timed out
  • 03:22Z review-pr · attempt 2 · session
  • 01:20Z review-pr · attempt 1 · session · timed out

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 27, 2026
ImageGallery takes the event's images directly and skips any without a
file, so EventDetails no longer maps them into slides. The lightbox moves
into the same file (its own module existed only to lazy-load YARL), the
alt text is the one caption, the image stays silent beside it, and the
title is always "Photo n of m", which drops the separate `photo` string.
Closing on a backdrop tap goes, and the swipe guard with it: the old
lightbox never closed that way, and Esc and the close button remain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 42c70cd Nov 27 2026, 01:40 AM

@Ardnived
Ardnived merged commit 5a49497 into main Nov 27, 2026
16 checks passed
@Ardnived
Ardnived deleted the feat/event-image-grid branch November 27, 2026 01:45
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Done in SYDevelopers Technical Roadmap Nov 27, 2026
Ardnived added a commit that referenced this pull request Nov 27, 2026
Brings in #500–#530. Resolutions:
- CompactEmbedView stays deleted; its #529 label change and changelog line are moot.
- DrawerStack keeps the inline arm (`canCollapse` reads `sheeted`) on main's dismiss,
  showResults, sheetTall and dimmed scrim, beside "Close map".
- LocatorProvider wraps MapProviders, so the inline map and its filters share one
  locator, and the expanded map gets its own.
- Registration, Share and the form take `form-column` over main's new markup.
- The panel stays 384px; the EventActions story previews 336px and 272px.
- Translations take main's production snapshot; the two keys #466 wires leave PENDING_KEYS.
- The story harness gains `expanded`, so the sticky-Register story shows the sheet.
- embed.spec picks the expanded dialog first: the panel inside now reads the same name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher sydevs-dispatcher Bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@Ardnived Ardnived removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant