Gallery Block: Fix equal column gallery image sizes#2534
Gallery Block: Fix equal column gallery image sizes#2534mukeshpanchal27 wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/2449-gallery-block #2534 +/- ##
==============================================================
- Coverage 69.14% 69.10% -0.05%
==============================================================
Files 90 90
Lines 7723 7742 +19
==============================================================
+ Hits 5340 5350 +10
- Misses 2383 2392 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@westonruter I'd appreciate any initial feedback you can provide on the PR when you have a chance to take a look. |
|
pr makes sense to me, it would be good to add some tests that demonstrate what it achieves. |
|
@mukeshpanchal27 How does this handle the responsive layout? If I add a Gallery with three columns I have this on desktop: But on mobile it becomes 2 columns, and the third image is twice as wide as the first two: There would seem to need to be some logic add this breakpoint in |
|
@westonruter In 46bfea1 i set two column layout for mobile explicitly. In follow-up PR will fix issue for different columns. |
| } | ||
|
|
||
| if ( 'core/gallery' === $block['blockName'] ) { | ||
| if ( wp_is_mobile() ) { |
There was a problem hiding this comment.
We can't rely on wp_is_mobile(), unfortunately. Page caching may not vary responses by device form factor. We'll need a solution that serves the same markup to all devices (the promise of responsive design).


Summary
Part of #2449
Relevant Technical Choices
Ensure that the number of images added matches the Gallery block's configured column count.
How to Test
3.3.Before
After
In follow-up PR will fix the sizes for other column settings.
Use of AI Tools
N/A