Skip to content

Emit computed layout graphs for pseudo-form roots #732

Description

@chubes4

Problem

The merged generic form-layout producer treats only literal <form> elements as layout-graph roots. formFallbackFinding() invokes it for both real forms and div-based pseudo-forms, but FormLayoutGraphBuilder::collect() returns before visiting controls when the root tag is not form. Styled pseudo-forms therefore emit generic/computed-layout-graph/v1 with nodes: [], no variants, and no diagnostic.

Work

  • Treat the bounded fallback element passed to the builder as the graph root independent of its tag name.
  • Preserve control references, wrapper parentage, computed layout, conditional variants, and existing bounds.
  • Keep form semantics separate from generic layout topology.
  • Emit explicit loss when a pseudo-form root cannot be represented.

Acceptance

  • A styled div pseudo-form emits a root layout node and source-ordered control parentage.
  • Literal form behavior remains unchanged.
  • Empty graphs cannot silently claim successful layout capture.
  • PHP transformer contract and full suites pass.

Found while reviewing merged PR #719 through GPT-5.6 Sol in OpenCode; Chris owns the issue and acceptance criteria.

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