Skip to content

Render: honor the documented nullable default when writing props to Figma #274

Description

@nathanacurtis

Subissue of #204.

ADR-065 documents what an absent nullable means on a prop:

  • true for StringProp, NumberProp, SlotProp, ImageProp — open value sets
  • false for EnumPropenum enumerates every accepted value

figma-from-specs/src/Props does not consult nullable at all today. Rendering a spec back onto the Figma canvas therefore cannot distinguish a prop that accepts an empty value from one that always carries a value.

Scope

  • Apply the per-type default when reading a prop's nullability, rather than testing for an explicit true
  • Decide what an explicit nullable: false should mean at render time — in particular whether a prop asserting a value should ever be written with an empty default
  • Round-trip check: a spec written to Figma and read back should preserve nullable (present or absent) rather than gaining or losing it

Depends on

Schema side ships in @directededges/specs-schema 0.29.0 (PR #273).

Metadata

Metadata

Assignees

No one assigned

    Labels

    generatorspecs-from-figma processing engine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions