Skip to content

Normalize block gap values in layout - #81460

Merged
tellthemachines merged 3 commits into
trunkfrom
fix/block-gap-values
Aug 12, 2026
Merged

Normalize block gap values in layout#81460
tellthemachines merged 3 commits into
trunkfrom
fix/block-gap-values

Conversation

@tellthemachines

Copy link
Copy Markdown
Contributor

What?

Closes #52099.

A little overdue cleanup to ensure block gap values are either strings or numeric zero (if gap is an array, the array should also have only those values). This will hopefully prevent PHP warnings or fatals from incorrect values.

Testing Instructions

  1. Check a few different blocks: Columns is a good one because it has axial support, and Group in its various layout types.
  2. Set different block gap values on them: units like px, vw... and numeric 0 should all work correctly in the front end.

Use of AI Tools

Used codex/gpt 5.6 sol

@tellthemachines tellthemachines self-assigned this Aug 12, 2026
@tellthemachines tellthemachines added [Type] Enhancement A suggestion for improvement. [Feature] Layout Layout block support, its UI controls, and style output. labels Aug 12, 2026

@ramonjd ramonjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working well for me. No blockers aside from the linting/backport

@github-actions

github-actions Bot commented Aug 12, 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: tellthemachines <isabel_brison@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

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

@andrewserong andrewserong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working well for me. No blockers aside from the linting/backport

Same here. Good idea adding this hardening!

@tellthemachines
tellthemachines enabled auto-merge (squash) August 12, 2026 04:14
@github-actions

Copy link
Copy Markdown

Flaky tests detected in d385ee6.
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/31562336544
📝 Reported tests:

should update the URL from the last navigation if only varies in the URL fragment in /test/e2e/specs/interactivity/router-navigate.spec.ts, passed after 1 failed attempt.
Error: expect(locator).toHaveText(expected) failed

Locator:  getByTestId('title')
Expected: "Link 1"
Received: "Main"
Timeout:  5000ms

Call log:
  - Expect "toHaveText" with timeout 5000ms
  - waiting for getByTestId('title')
    14 × locator resolved to <h2 data-testid="title">Main</h2>
       - unexpected value "Main"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigate.spec.ts:160:25

@tellthemachines
tellthemachines merged commit d90ebd7 into trunk Aug 12, 2026
44 checks passed
@tellthemachines
tellthemachines deleted the fix/block-gap-values branch August 12, 2026 04:44
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Layout Layout block support, its UI controls, and style output. [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up block gap logic in lib/block-supports/layout.php

3 participants