Slice 1 (ADR 0006): collapse geometry-neutral wrappers from box-tree evidence, keep author CSS

オープン
#7,454 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
22/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
tooling

調査の方向性

Start with ADR 0006 and the box-tree/v2 sidecar schema, then read WrapperCoalescer to see where wrappers are currently folded and where selector survival is checked. The new evidence reader parses box-tree/<route>.json and classifies each node as neutral, inset_only or load_bearing by data-blocks-engine-node-id. Run cd php-transformer && composer test for the green baseline, and composer topology-diff to see whether tools/topology-diff/baseline.json moves; done means the contract tests plus the Wix/Squarespace A/B thresholds in the acceptance section pass.

索引モデルが issue の本文から書いたものです。

説明

Goal

Slice 1 of ADR 0006 (PR linked below): remove neutral single-child wrappers on the default path, decided from captured box-tree/v2 geometry evidence rather than selector survival. Author CSS keeps shipping.

Measured ceiling (frozen captures, from box-tree/ sidecars)

Site Visible single-child source wrappers Collapsible (neutral or constant inset) Max source depth if removed
Wix demo (sdnunca) 445 235 27–28 → 22–23
Squarespace demo (Bedford) 1071 610 17–21 → 13–15

Published trunk baseline: Wix 225 single-child groups / 369 groups / max depth 13; Squarespace 576 / 906 / 16.

Required behaviour

  1. Evidence reader. One class reads the capture's box-tree/<route>.json (schema blocks-engine/box-tree/v2) and maps nodes to source elements by data-blocks-engine-node-id. It answers, per element: neutral, inset_only or load_bearing, plus a reason. No evidence for a node means load_bearing. Capture identity attributes stay out of compiled output, as today.
  2. Neutral, at every captured viewport:
    • visible (display not none, width > 0);
    • paints nothing: transparent background-color, background-image: none, zero or none borders, box-shadow: none, outline style none, opacity: 1, and transform, filter, mask-image, clip-path, backdrop-filter all none; overflow-x and overflow-y visible;
    • position: static, or relative with top/right/bottom/left auto and no absolute or fixed descendant whose containing block is this wrapper;
    • float: none, z-index: auto, animation-name: none;
    • the single element child's border box equals the wrapper's (tolerance 0.5 px).
  3. Collapse. In WrapperCoalescer, a neutral wrapper folds into its child even when selector survival fails. Every rule whose match on a surviving descendant changes when the wrapper is removed is restated on that descendant as an engine-owned rule. Reuse #7420's identity-transfer guards: id transfer only off shells, landmarks and anchor targets; data guards only on consumed attributes; repeated siblings fold consistently. If a changed match cannot be restated (state or pseudo rules, device-gated selectors), the wrapper stays.
  4. Monotonic. Imports without box-tree/ evidence produce byte-identical output to trunk. Add one test showing this, plus one table-driven contract test covering neutral collapse and each refusal reason (paint, containing block, inset, hidden at one viewport).
  5. Topology baseline. If composer topology-diff changes, update tools/topology-diff/baseline.json and justify it in the PR body.

Acceptance

  • cd php-transformer && composer test is fully green, with no test weakened or deleted to pass.
  • A/B against trunk on the Wix and Squarespace demo captures: Squarespace single-child groups ≤ 556, Wix < 225, max depth not increased, and no new visual or editor parity blockers.
  • The PR opens as a draft and stays a draft until the requester's A/B passes.

Supersedes the approach in #7420; refs #7379, #7345.

Filed by Franklin (Claude Opus via Pi, Roadie): ceiling measured from capture sidecars, spec written from the ADR.

主要言語
PHP
スター
31
フォーク
7
平均マージ
3時間 40分
マージ済み PR(30日)
813

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/blocks-engine のほかの issue

Automattic/blocks-engine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。