Skip to content

feat(dsoc): cap project gallery at 5, show as a slider#46

Merged
ZeeshanAdilButt merged 1 commit into
mainfrom
dsoc-gallery-slider
May 29, 2026
Merged

feat(dsoc): cap project gallery at 5, show as a slider#46
ZeeshanAdilButt merged 1 commit into
mainfrom
dsoc-gallery-slider

Conversation

@ZeeshanAdilButt

Copy link
Copy Markdown
Collaborator

Summary

Two changes on top of the existing gallery feature:

  • Cap at 5 images: both admin create + edit forms enforce a max of 5. Label shows `n/5`, picker disables at the cap, over-limit selections trim cleanly with a clear message.
  • Slider on the public project page: replaces the thumbnail grid with a Swiper slider (navigation arrows, pagination dots, keyboard arrow support, loops when >1 image). Click-to-zoom lightbox still works on each slide.

Reuses the existing `swiper` dependency (already used on the blog page) so no new deps.

Test plan

  • Admin: try to upload 7 images at once → 5 added, message explains the cap
  • Admin: with 5 already in gallery, picker is disabled
  • Admin: remove one via X → picker enables again
  • Public project page with 2+ images → arrows, dots, keyboard, loop all work
  • Click a slide → lightbox opens, X or click-outside closes
  • Project page with 0 or 1 image renders without errors

🤖 Generated with Claude Code

- Admin create + edit forms cap gallery at 5 images. The picker is
  disabled at the limit, the label shows the n/5 count, and selecting
  more than the remaining quota in one go silently trims to the
  remainder with a clear message about what was dropped.
- Project detail page renders the gallery as a Swiper slider
  (navigation arrows, clickable pagination dots, keyboard arrow
  support, loop when there's more than one image) instead of the
  earlier thumbnail grid. Clicking a slide still opens the lightbox.
- Slider styled to match the neo-brutalist DSOC theme.

No schema change. The 5-image cap is enforced client-side in the only
two places that write to gallery (both admin forms); existing projects
with >5 entries continue to render fine.
@ZeeshanAdilButt ZeeshanAdilButt merged commit 14957a4 into main May 29, 2026
2 checks passed
@ZeeshanAdilButt ZeeshanAdilButt deleted the dsoc-gallery-slider branch May 29, 2026 08:43
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