Skip to content

Gallery: Improve mobile lightbox with animated swiping - #79114

Open
jasmussen wants to merge 2 commits into
trunkfrom
try/sliding-lightbox-galleries
Open

Gallery: Improve mobile lightbox with animated swiping#79114
jasmussen wants to merge 2 commits into
trunkfrom
try/sliding-lightbox-galleries

Conversation

@jasmussen

Copy link
Copy Markdown
Contributor

What?

Followup to #62906. Adds animation to the swiping gesture for mobile galleries:
animate galleries

Why?

When you have a gallery set to lightbox ("expand on click"), no mobile you can open it and use a swipe gesture to advance between images. However there is no visual feedgback that this is possible. This PR adds that.

Testing Instructions

Create a gallery, set to expand on click, then test on mobile, or using the web-inspector set to device emulation. Test swiping images to advance.

Use of AI Tools

Claude Opus 4.7.

@jasmussen jasmussen self-assigned this Jun 11, 2026
@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Block] Gallery Affects the Gallery Block - used to display groups of images labels Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: fcoveram <fcoveram@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 11, 2026
jasmussen added a commit that referenced this pull request Jun 11, 2026
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Size Change: +1.32 kB (+0.02%)

Total Size: 7.76 MB

📦 View Changed
Filename Size Change
build/modules/block-library/image/view.min.js 3.08 kB +432 B (+16.34%) ⚠️
build/styles/block-library/image/style-rtl.css 3.07 kB +119 B (+4.03%)
build/styles/block-library/image/style-rtl.min.css 1.97 kB +104 B (+5.57%) 🔍
build/styles/block-library/image/style.css 3.08 kB +121 B (+4.09%)
build/styles/block-library/image/style.min.css 1.97 kB +106 B (+5.7%) 🔍
build/styles/block-library/style-rtl.css 22.5 kB +111 B (+0.5%)
build/styles/block-library/style-rtl.min.css 19 kB +107 B (+0.57%)
build/styles/block-library/style.css 22.7 kB +116 B (+0.51%)
build/styles/block-library/style.min.css 19 kB +103 B (+0.55%)

compressed-size-action

jasmussen added a commit that referenced this pull request Jul 27, 2026
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jasmussen
jasmussen force-pushed the try/sliding-lightbox-galleries branch from c6eca7d to 022d8e4 Compare July 27, 2026 13:18
@jasmussen

Copy link
Copy Markdown
Contributor Author

Rebased, and worked in some small improvements.

@jasmussen
jasmussen requested a review from a team July 27, 2026 13:19
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 022d8e4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30269701069
📝 Reported issues:

@jasmussen
jasmussen force-pushed the try/sliding-lightbox-galleries branch from 022d8e4 to 0b51fe4 Compare July 28, 2026 07:47
@fcoveram

Copy link
Copy Markdown
Contributor

It works well for me. It would be nicer if, after a certain number of pixels of swiping, the next/prev image is revealed to make the transition smoother and reinforce the swipe direction. Right now, the new image shows up slightly abruptly.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Right now, the new image shows up slightly abruptly.

I agree. When I worked on that, this aspect was a bit of a larger undertaking, so in the hopes of making this a small iterative improvement, I chose this simpler approach. But it should be possible to upgrade it with a second PR. Curious if we can get a developer instinct on this, happy either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Gallery Affects the Gallery Block - used to display groups of images [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants