Skip to content

[codex] support media srcset for lightbox - #164

Merged
haltakov merged 2 commits into
mainfrom
codex/media-srcset-lightbox
Jun 25, 2026
Merged

[codex] support media srcset for lightbox#164
haltakov merged 2 commits into
mainfrom
codex/media-srcset-lightbox

Conversation

@haltakov

@haltakov haltakov commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a direct optional srcset field to media entries in the gallery schema and passes it through resolved theme data as image.srcset. Themes then emit that value as data-pswp-srcset, allowing PhotoSwipe to choose an appropriately sized full-size image instead of always loading the original.

This keeps responsive lightbox image data as a sibling of thumbnail on each media item, rather than introducing a separate nested lightbox schema.

Companion app PR: https://github.com/SimplePhotoGallery/app/pull/189

Impact

  • Gallery JSON can now include media-level srcset strings.
  • Core theme rendering supports responsive PhotoSwipe image candidates.
  • New custom themes generated from the base template include the same attribute.
  • Configuration docs now document the media-level srcset field.

Validation

  • yarn workspace @simple-photo-gallery/common compile
  • yarn workspace simple-photo-gallery compile
  • yarn workspace simple-photo-gallery test lightbox-srcset.test.ts --runInBand
  • yarn workspace simple-photo-gallery test smoke.test.ts --runInBand

@haltakov
haltakov marked this pull request as ready for review June 25, 2026 13:52
@haltakov
haltakov merged commit 2d5f072 into main Jun 25, 2026
1 check passed
@haltakov
haltakov deleted the codex/media-srcset-lightbox branch June 25, 2026 14:02
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