Skip to content

MVP: Capture a nested instance's non-default slot fill when generating a composed spec #672

Description

@nathanacurtis

Problem

When a composed spec is generated, content filling a non-default slot on a nested instance is dropped. Figma holds the fill; the generated spec has no record of it, and nothing warns.

Observed on a host whose default-slot fill contains an instance with a second, non-default slot filled two levels below the host root. The fetched payload carries it:

INSTANCE 'twoSlots'
  SLOT 'children' → TEXT 'aChild'     ← captured
  SLOT 'aside'    → TEXT 'Aside'      ← dropped

The generated spec contains no aside entry, no $slotContent reference, and no $nested path. Only the default slot survives, so a composition loses any content a designer placed in a sibling slot.

ADR-099 narrowed only the single-default-slot case and left the explicit reference mechanism in place for every other slot — so the reference should still be emitted here, anchored on the instance that holds the fill.

Potential solution(s)

  • Capture a nested instance's non-default slot fills and emit the explicit slot-content reference for each, anchored on the instance now holding it rather than as a path on the level above
  • Where a fill genuinely cannot be represented, warn rather than drop it silently

Acceptance criteria

  • A nested instance with both a default and a non-default slot filled emits both fills
  • The non-default fill is referenced from the instance that holds it, not as a $nested path on the level above
  • The fill survives at composition depth, two or more levels below the host root
  • A fill that cannot be captured produces a warning naming the slot and node id

Case data

  • Fixture: Slot Non Default Nested (1660:441)
  • Workspace: specs-testing — TEST New Layout Test Cases page
  • Territory: specs-from-figma
  • Size: m

Notes

Found while verifying the #656 fixtures. Render has a matching gap on the write side — PropConfigurations.apply skips every object-valued config, including $slotContent — so a round trip currently loses the fill in both directions.


Implementation details are tracked internally.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

clispecs-cli commandsspecs-from-figmaTransformer from Figma into specs

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions