ADR 0005 slice 4: collapse neutral boxes on engine-styled routes

Open
#6,239 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
40/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
backend, testing

Research direction

Read ADR 0005 (#6160), then inspect HtmlCompilation and how it consumes the classifier's per-node disposition on engine-styled routes. Check the slice 3 result and the box-tree v2 dependency (#6238) before changing the emission path. Done means a neutral chain collapses, a painting sibling remains, the reported group counts and depth metrics meet acceptance, and desktop/mobile parity has no regression.

Written by the indexing model from the issue text.

Description

Slice 4 of ADR 0005 (#6160). Depends on slice 3 (#6233, PR #6236) and box-tree v2 (#6238).

Goal: on routes where the engine owns the styles, a source box classified as neutral (equal-child-geometry: same border box as its only child at every captured viewport, no paint, clip, multi-child layout, containing block, semantics or interaction) emits no block. Its child takes its place in the parent.

Design:

  • Decide in HtmlCompilation before the wrapper turns into a core/group. The classifier's per-node disposition is the only authority; the existing WrapperCoalescer selector-survival heuristic doesn't apply on evidence routes, because no author selectors ship.
  • The child keeps its own engine rule. The removed box's rule is dropped, since its geometry equals the child's by construction.
  • Routes without evidence are untouched.

Acceptance (sdnunca Lab capture):

  • Emitted core/group count per route drops by at least the neutral structural boxes the classifier reports (Home 109, About 44 on trunk today).
  • Report max group depth and groups per leaf, measured on emitted blocks.
  • Desktop and mobile parity against the slice 3 result shows no regression.
  • One contract test: a fixture with a neutral chain collapses, and a sibling that paints is kept.

AI disclosure: written by Franklin (Claude Opus via Pi, Roadie).

Dominant language
PHP
Stars
28
Forks
5
Avg merge
2h 59m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.