Skip to content

Preserve authored classes and flex layout on anchor buttons #830

Description

@chubes4

Problem

Anchor elements converted to core/button can lose their authored source class, so class-owned flex layout and child sizing no longer apply.

In immutable fixture 20-switchback-woocommerce-extra-hard, four .seasonal-product-row anchors should render with display:flex, align-items:center, gap:16px, padding/background/radius, and .seasonal-product-row__name { flex:1 }. The candidate emits generated blocks-engine-control-* button classes but drops .seasonal-product-row; only background/radius/padding survive.

Measured mismatch clusters occur around x=868..1256, y=3915..4175.

Acceptance

  • Preserve safe authored anchor classes on emitted core/button link markup and block attributes.
  • Authored parent flex and child selector semantics continue matching after native block lowering.
  • Generated control classes compose with, rather than replace, source classes.
  • Unsafe classes remain filtered under existing policy.
  • Runtime links and normal buttons retain current behavior.
  • Add generic class/flex/child-selector contracts and verify fixture 20 regions without fixture changes.

AI assistance

OpenAI gpt-5.6-terra via OpenCode and a general OpenCode subagent compared immutable source/candidate geometry and isolated class loss during anchor-to-button lowering. Chris Huber directed the investigation and remains responsible for the issue and resulting change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions