Skip to content

Preserve resolved grid layout semantics#621

Merged
chubes4 merged 1 commit into
trunkfrom
fix/620-preserve-resolved-grid-layouts
Jul 18, 2026
Merged

Preserve resolved grid layout semantics#621
chubes4 merged 1 commit into
trunkfrom
fix/620-preserve-resolved-grid-layouts

Conversation

@chubes4

@chubes4 chubes4 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep resolved CSS grid containers out of flex-based core/columns conversion
  • preserve source grid classes and direct-child geometry through core/group
  • cover both inline resolved grid CSS and linked artifact CSS while retaining horizontal flex-to-columns behavior

Fixes #620.

Root cause

ColumnsPattern::looksLikeSplitLayout() accepted generic split-layout names such as hero-inner without accounting for the resolved display mode. ColumnsPattern::match() then emitted core/columns and core/column wrappers. Gutenberg rendered that block as flex, replacing source grid tracks and centered alignment.

In the SSI 15-saas evidence linked from #620, this expanded the hero by 118.45px and shifted every following section. With this change, the preserved fixture source compiles the hero as core/group, not core/columns, with zero fallbacks.

Backwards compatibility

This intentionally changes serialized block shape for source elements that both resolve to display:grid and match a Columns class/structure heuristic: they now emit core/group with directly converted children instead of core/columns with added core/column wrappers. This preserves source CSS grid semantics and direct-child selectors. Existing wp-block-columns markup remains Columns, and horizontal flex rows continue to emit Columns. Consumers that explicitly depended on inferred Columns wrappers for CSS grid source markup should review this behavior change.

How to test

  1. From a fresh checkout, run cd php-transformer && composer install --no-interaction.
  2. Run composer test.
  3. Confirm all canonical, unit, packaging, and 236 parity fixture checks pass.
  4. Inspect html-resolved-split-grid-stays-group and confirm the resolved split grid emits core/group without core/columns.
  5. Inspect artifact-linked-css-layout-wrapper-style-signals and confirm linked .hero-grid CSS emits a semantic section Group while the flex card wrapper remains unchanged.
  6. Run or inspect html-horizontal-flex-stays-columns and confirm genuine horizontal flex still emits core/columns.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode with OpenAI gpt-5.6-sol
  • Used for: Root-cause analysis, implementation, regression fixtures, and verification.

@chubes4
chubes4 merged commit 593028e into trunk Jul 18, 2026
1 check passed
@chubes4
chubes4 deleted the fix/620-preserve-resolved-grid-layouts branch July 18, 2026 03:57
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.

Preserve resolved CSS grid layouts instead of emitting flex Columns blocks

1 participant