Stage 2: fold geometry-neutral single-child wrappers by restating their consumed class and id on the child
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
Direzione di ricerca
Start with the WrapperDecision stage in the php-transformer conversion layer and the existing wrapper dispositions, then read php-transformer/docs/wrapper-decisions.md. Use tools/import-loop/structure.php to measure single-child core/group counts on squarespace-bedford and sdnunca. Done means a new named fold reason that keeps every emitted CSS selector matching the same elements, with unit tests and no visual regressions in import-loop/corpus.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Part of #7471 (stage 2: retire wrapper heuristics one PR at a time, each A/B'd on the corpus). Stage 1 is done: every conversion-layer wrapper decision now goes through WrapperDecision (#7472, #7474, #7479, #7488, #7495, #7502).
Evidence: what the surviving single-child groups are
Trunk c35c3acf, real imports of the 8 corpus captures. For each core/group with exactly one block child, I recorded its attributes and the child's block name:
| site | single-child groups | top shape |
|---|---|---|
| squarespace-bedford | 497 of 750 groups | class-only group > core/group: 159; same with anchor: 132; with anchor,metadata: 41 |
| sdnunca (Wix) | 225 of 369 | class-only group > core/group: 50; with anchor: 37 |
| base44-imb | 214 of 600 | colored group > core/image: 66; class-only group > core/group: 32 |
The class-only group > group wrappers on bedford are mostly layout scaffolding: sqs-col sqs-col-N span-N (64), row sqs-row (21), sqs-layout sqs-grid-N, sqs-block-content, pre-footer-inner, main-content. On sdnunca they are _backgroundLayer_* (27), _image*, builder-root, wix-presets-wrapper. These wrappers carry no style or layout attribute: they survive only because their class (sometimes their id) is consumed by emitted CSS.
An instrumented run logged every WrapperDisposition across the corpus. The largest refusals are presentation_attributes (wrapperRetention, 5,759) and the depth-budget preserves (native_group_tree_within_budget 9,127, single_wrapper_ancestry 8,848). #7420's measurement points the same way: wrappers there are refused because a consumed attribute or style lives on them, not because they paint or size anything.
Required: a restatement-backed fold for consumed-class single-child wrappers
A new, named WrapperDecision stage. For a wrapper with exactly one element child:
- Geometry and paint neutrality from evidence:
- Use the captured box-tree or computed evidence that ADR 0006 / #7420 consume. The wrapper's border box equals its child's margin box at every captured viewport.
- The wrapper paints nothing: no background, border, shadow, outline, opacity, transform, filter, clip, overflow clipping, or stacking context. It also creates no containing block or formatting context the child depends on.
- With no evidence, preserve (today's behavior).
- Restate what the wrapper carries onto the child, then fold:
- Its classes and its
id/anchor move onto the child, only when the child has noidof its own. - Every emitted CSS rule whose selector depends on the moved class or id must still match exactly the same elements after the move. A selector where the token is the subject (
.col) now matches the child. A compound that also names the child's own tokens (.col.x) is fine. A selector where the token sits on an ancestor of other matched elements (.col .block,.col > .x) must be rewritten so it matches both ways, for example.col .block, .col.block. Otherwise the wrapper is preserved. - Use the engine's existing selector projection machinery. No platform-specific class lists: the rule is generic over class and id consumption.
- Its classes and its
- Inherited text properties the wrapper declares (font, color, line-height and the like) go through the existing inherited-text restatement path. Declarations the child already wins over are dropped.
- The disposition is
foldwith a new named reason. Refusals name the failing condition, so the next slice can be read off a histogram.
Acceptance (A/B on the corpus; I verify by real import)
- Single-child groups drop on squarespace-bedford and sdnunca (measured with the scoreboard's structure metrics,
tools/import-loop/structure.phpin static-site-importer). - No visual cell regresses on any of the 8 corpus sites (
import-loop/corpuscheck). - Unit tests for each case:
- a subject rule moved;
- a descendant rule rewritten;
- a wrapper preserved when a rule can't be preserved;
- preserved without evidence;
- an
idmoved, and preserved when the child has its ownid.
- Update
php-transformer/docs/wrapper-decisions.md. - Use
Refs #7471andRefs #7420. State the before/after counts in the PR body if you measured them; otherwise say so.
Filed by Franklin (Claude Opus via Pi, Roadie).
- Lingua principale
- PHP
- Stelle
- 31
- Fork
- 7
- Merge medio
- 3h 40m
- PR unite (30g)
- 813
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Automattic/blocks-engine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#4943 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#4942 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Automattic/blocks-engine#4921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Automattic/blocks-engine#775 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
Automattic/blocks-engine#7482 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Automattic/blocks-engine
Issue simili
-
OpenRouter errors returned in a 200 body are thrown as a plain AiExceptionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
freescout-help-desk/freescout#5844 ·
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Перевод устарел
Difficoltà 2/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno