Stage 2: fold geometry-neutral single-child wrappers by restating their consumed class and id on the child
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 12/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- PHP
- Estrellas
- 31
- Forks
- 7
- Merge medio
- 3 h 40 min
- PR fusionados (30 d)
- 813
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Automattic/blocks-engine
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Automattic/blocks-engine#4943 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Automattic/blocks-engine#4942 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Automattic/blocks-engine#4921 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Automattic/blocks-engine#775 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Automattic/blocks-engine#7482 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de Automattic/blocks-engine
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
phpstan/phpstan-phpunit#361 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
HE-Arc/le-panier-du-coin#49 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
15.0
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
LinkNacional/woo-rede#367 ·