Emit core 7.1 grid child placement instead of carrying grid and positioned layout as CSS
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start by reading the core layout handling in wp-includes/block-supports/layout.php and wp_get_layout_child_values(). Examine the transformer's InlineGeometry classification in the php-transformer/src directory to understand current carrier CSS logic. The goal is to modify the transformer to emit style.layout attributes for grid children and remove corresponding CSS carriers. Test with explicit grid placements and responsive overrides, ensuring output passes Gutenberg block validation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
WordPress 7.1 core stores grid-item placement natively on any block: style.layout.{columnStart,columnSpan,rowStart,rowSpan} on children of a layout.type: grid container, with per-viewport overrides under style["@tablet"].layout / style["@mobile"].layout (see wp_get_layout_child_values() and the viewport child-layout loop in wp-includes/block-supports/layout.php; breakpoints come from settings.viewport via WP_Theme_JSON::get_viewport_media_queries()).
The PHP transformer does not emit any of these fields. InlineGeometry still classifies grid-area, grid-column* and grid-row* as geometry that "converted native blocks cannot retain in their saved markup", so source grid placement travels through positioning/geometry carriers (generated CSS) instead of editor-owned block attributes. columnStart/rowStart appear nowhere in php-transformer/src.
Consequences:
- Explicitly placed grid items are only faithful while carrier CSS wins; the editor's grid controls show unplaced children and the first user edit can collapse the composition.
- Responsive re-placement (different spans/rows per breakpoint) is not representable as native data.
- Positioned compositions (collages, overlapping hero art, offset cards) have no native target at all and fall back to carriers or lose geometry (#668).
Proposal
Emit core 7.1 grid child placement as the native target, in two scoped steps.
- Source-authored grid placement. When a
display: gridcontainer's children declaregrid-column/grid-row/grid-areawith resolvable integer lines or spans, write them to the child block'sstyle.layoutand drop the equivalent carrier declarations. Media-query variants that map onto the destination's@tablet/@mobileviewports go tostyle[<viewport>].layout. Unresolvable forms (named lines,grid-template-areaswithout a line mapping,auto-fillinteractions, subgrid) stay on carriers with a typed diagnostic. - Positioned compositions to grid placement. For containers already classified as positioned/freeform (absolute children, overlap, z-index stacking; the Figma path's
StackingContextPolicyreasons are the model), project child boxes onto an explicit grid with per-viewport placement when every child snaps within tolerance. Overlap is legal in CSS grid with explicit placement. Anything that still needsz-index, rotation, or sub-cell offsets stays on carriers and is reported, so the remaining gap is measured rather than assumed.
Acceptance
- Contract coverage: explicit
grid-column/grid-rowspans,grid-areawith numeric lines, one responsive override, and an unresolvable named-line case that keeps its carrier plus diagnostic. - Output passes Gutenberg block validation with no invalid-content warnings; placements are visible and editable in the core grid UI after save/reload.
- Carrier CSS for converted placement properties is removed, not duplicated.
- Visual parity on 2–3 positioned/collage fixtures (including the #668 collage) is no worse than the current carrier baseline, and the positioned-composition step reports how many children it could not place natively.
- Viewport overrides are emitted only when the destination declares matching
settings.viewportbreakpoints; otherwise the base placement stands and a diagnostic records the dropped variant.
Why this matters
It turns layout that is currently CSS-carried into data the WordPress editor owns, for every block type, with no plugin dependency. It also creates a single interoperable placement format that visual layout editors building on core grid (for example Automattic/canvas) could read directly.
Related: #668, #1743, #733.
AI assistance
- AI assistance: Yes
- Model: Claude (Anthropic)
- Tool: OpenCode
- Contribution: Investigated core 7.1 layout support and the transformer's current grid/positioning handling, and drafted this issue; reviewed by the requester before filing.
- Ngôn ngữ chính
- PHP
- Star
- 20
- Fork
- 2
- Merge trung bình
- 5 giờ 1 phút
- Pull request đã merge (30 ngày)
- 702
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Automattic/blocks-engine
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Automattic/blocks-engine#2161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Automattic/blocks-engine#2061 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Automattic/blocks-engine#1701 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Automattic/blocks-engine#775 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Automattic/blocks-engine#2685 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Automattic/blocks-engine
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codeigniter4/CodeIgniter4#10616 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug code quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SemanticMediaWiki/SemanticMediaWiki#7149 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
google/site-kit-wp#13825 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Made by AI module: MCP type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày