Skip to content

refactor(php-transformer): move empty visual spacer lowering into Elements/EmptyVisualSpacerLowering - #5283

Open
chubes4 wants to merge 1 commit into
simplify/wrapper-conventionsfrom
simplify/empty-visual-spacer
Open

chubes4 wants to merge 1 commit into
simplify/wrapper-conventionsfrom
simplify/empty-visual-spacer

Conversation

@chubes4

@chubes4 chubes4 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Part of #4368 (slice 2ab). Stacked on #5280.

What

  • New owner, Elements/EmptyVisualSpacerLowering. Moves emptyVisualSpacerBlock, emptyVisualElementAttributes and hasEmptyGridTrackDescendant verbatim out of HtmlCompilation, along with the two private flex-item class constants. It lowers an empty source element that still occupies visual space into a spacer, or an empty group that keeps its box.
  • Mechanical substitutions only:
    • SourceDom::childElementCount and SourceDom::mergeClassNames replace the trait forwards.
    • $this->blocks->createBlock.
    • $this->tree->children() for the one recursion.
    • The public EMPTY_VISUAL_GROUP_CLASS and EMPTY_RUNTIME_TARGET_CLASS stay where they are. The moved code reads them through HtmlTransformer::, as NavigationStyleProjector already does.

HtmlCompilation: 6776 → 6661 lines.

Verification


AI disclosure: Claude Opus (Anthropic) via Pi/Roadie moved the code with a mechanical mover script, ran the Lab gate and A/B, and wrote this PR for Chris Huber.

…ments/EmptyVisualSpacerLowering

Moves emptyVisualSpacerBlock, emptyVisualElementAttributes and
hasEmptyGridTrackDescendant, with the two private flex-item class
constants, out of HtmlCompilation verbatim. The public empty-group class
names are read through HtmlTransformer, as the style projectors already
do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant