Skip to content

fix(php-transformer): apply the native lightbox to gallery card triggers - #1853

Merged
chubes4 merged 1 commit into
trunkfrom
fix/lightbox-card-link-galleries
Sep 16, 2026
Merged

chubes4 merged 1 commit into
trunkfrom
fix/lightbox-card-link-galleries

Conversation

@chubes4

@chubes4 chubes4 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1848, which only reached a bare <a><img></a>.

A real gallery thumbnail wraps the image and a caption overlay:

<a href="/uploads/img-1631_orig.jpeg" rel="lightbox[gallery...]" class="w-fancybox">
  <img src="/media/img-1631.jpeg" class="galleryImage">
  <div class="galleryCaptionHolder">…</div>
</a>

Because the anchor has mixed content it is handled as a card-link wrapper, so #1848's check never ran and the href was propagated onto the image — leaving a thumbnail that navigates away to the full-size file.

Recognize the trigger on the wrapper as well, and opt its unlinked images into core's native lightbox instead of propagating the link.

Caught by measuring the re-imported page after #1848 landed: all 12 About Me figures still rendered an anchor and none had lightbox markup.

Test plan

  • php php-transformer/tests/unit/image-lightbox-link-projection.php (14 assertions, including an ordinary card link that must keep propagating its destination)
  • image-carrier-hidden-label, button-link-dispatcher, media-text-pattern, cover-pattern
  • php php-transformer/tests/contract/run.php
  • Annie About Me: 12 gallery thumbnails open in place

AI assistance: grok-4.6 via OpenCode. Caught by verifying the re-imported page rather than trusting the unit fixture.

A gallery thumbnail's trigger usually wraps the image and a caption
overlay, so it is handled as a card-link wrapper and never reached the
bare image-link path. The href was propagated onto the image, leaving a
thumbnail that navigates away to the full-size file.

Recognize the trigger on the wrapper too and opt its images into core's
native lightbox instead of propagating the link.
@chubes4
chubes4 merged commit 90889f4 into trunk Sep 16, 2026
10 checks passed
@chubes4
chubes4 deleted the fix/lightbox-card-link-galleries branch September 16, 2026 20:39
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