Skip to content

Slot elements round-trip as plain containers #291

Description

@nathanacurtis

A slot comes back typed container, and the children binding that made it a slot is dropped.

Evidence

FormGroupHeading:

path baseline round-trip
anatomy.children.type "slot" "container"
default.elements.children.children {$binding: "#/props/children"} (absent)

AvatarGroup:

path baseline round-trip
anatomy.items.type "slot" "container"

Note props.items does survive with type: slot and maxChildren: 4 intact, so the slot property itself is being created — it is the anatomy type and the element binding that are lost. That internal inconsistency (a spec where props.items.type is slot but anatomy.items.type is container) is part of what to fix.

Explicitly out of scope

props.*.anyOfpreferredValues is a documented deferral in SlotElement.slotSettingsOptions (it needs published-library keys, unavailable for local components). Leave it deferred; do not widen this issue to cover it.

Where

packages/figma-from-specs/src/Elements/SlotElement.ts (promote, bind, configure) and Component.ts (materializeSlots). Whether the loss is on the render or the read side is undetermined — establish that first, since props.items surviving suggests promotion partly works.

Fixtures

  • FormGroupHeading — slot plus dropped children binding
  • AvatarGroup — slot with surviving props.items, the internal-inconsistency case

Verification

Round-trip both. anatomy.children.type / anatomy.items.type come back as slot, and anatomy agrees with props on every slot in the spec.

Part of #281.

Metadata

Metadata

Assignees

No one assigned

    Labels

    generatorspecs-from-figma processing engine

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions