code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

Preserve code-connect blocks for detached "composite" components

Open andreiduca opened this issue 1 year ago • 1 comments

When detaching a component, Figma keeps track of the detachment history (unless manually cleared by the user).

Screenshot 2024-10-02 at 4 43 21 PM

Even detached, I can still compare the changes between the detached component and the main component.

Screenshot 2024-10-02 at 4 43 50 PM

However, I cannot open in playground (obviously, since the component is detached, so props don't exist anymore; tho the button is still there), but I also don't see the code example that the original component used to have.

Screenshot 2024-10-02 at 4 55 26 PM

Is it possible to preserve the code-connect example in this case?

This would be helpful for composite components, which we want our designers to detach so that they can edit their contents freely. Best examples would be modals, or checkbox and radio groups, or anything that could be a composite of other small components, or components accepting arbitrary children.

andreiduca avatar Oct 02 '24 23:10 andreiduca

Hey @andreiduca, thanks for reporting this and adding the example use cases - this is really helpful! We don't currently preserve code connect for detached components, but wanted to let you know that it's something we're considering and thinking about. Will keep you posted on this

karlpetersson avatar Oct 04 '24 13:10 karlpetersson