Automattic / Automattic/blocks-engine

Preserve inherited anchor paint on native button promotion

Open
#765 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
14
Forks
2
Avg merge
2h 10m
Merged PRs (30d)
561

Description

## Problem

When a source anchor is promoted to native `core/button`, WordPress button defaults can replace inherited source foreground and text alignment even when the author did not declare either property on the anchor. Geometry and editable content remain correct, but brand text paint and glyph placement change.

## Evidence

Fixture 89 round 12, transformer `bf3845f650df0054135ba3c867fe2ae6f2c4fd6d`, WP Codebox `68f920d8019bfb3352a32ba0bd2a6e234484231c`. Evidence: `/tmp/fixture-89-combined-v0184-round12/artifacts`.

The page is exactly aligned at `1280x8067`, with 170/170 native blocks, zero `core/html`, and 340/340 editor validation observations. Of 877 strict mismatch pixels:

- Header brand label: 514 pixels because source inherits `#f8fff9`, candidate button link computes `#fff`.
- Header brand mark: 24 pixels because source inherits `text-align:start`, candidate computes `center`.
- Footer brand mark: 54 pixels from the same alignment replacement.

Source and candidate anchor boxes are identical. The mismatch is deterministic computed-style replacement, not anti-aliasing or geometry drift.

## Direction

Preserve effective inherited foreground and text alignment when promoting source anchors to native button links. Keep explicit authored anchor values authoritative and avoid product/class-specific behavior.

## Acceptance

- A promoted anchor under a colored ancestor retains the source effective foreground when the anchor has no authored color.
- A promoted anchor retains inherited start/end alignment instead of acquiring WordPress button centering.
- Explicit anchor color/alignment declarations still win.
- Native `core/button` output remains editor-valid with no HTML fallback.
- Add computed-style or rendered parity coverage for header and footer brand variants.

## AI assistance

OpenAI GPT-5.6 Sol using OpenCode analyzed complete source/candidate DOM and screenshot evidence and drafted this issue. Chris reviewed the scope and remains responsible for implementation decisions.

Contributor guide

Open the contributing guide

Research direction

Locate the transformer entry point that promotes source anchors to native core/button blocks, then inspect how inherited computed color and text alignment are handled. Use the header and footer brand variants from fixture 89 as parity cases and verify editor-valid native output, preserved inheritance, and explicit anchor declarations taking precedence.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.