Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluding nested components from imports and code snippet #246

Open
ikochetov-mdsol opened this issue Feb 18, 2025 · 3 comments
Open

Excluding nested components from imports and code snippet #246

ikochetov-mdsol opened this issue Feb 18, 2025 · 3 comments

Comments

@ikochetov-mdsol
Copy link

  • Code Connect CLI version 1.3.0
  • Operating system macOS 14.6.1

I have a question about how CodeConnect handles the import of nested components.

I’ve noticed two different behaviors:
1. First case – I have a checkbox component that includes a CodeConnected icon inside it. The entire checkbox component is also CodeConnected, but the icon does not appear in the generated code snippet.

Image

2. Second case – I have a card component that includes the checkbox for its selected state. However, in this case, CodeConnect does include the checkbox in both the imports and the code snippet.

Image

How can I prevent the checkbox from appearing in the imports and code snippet for the second case?
I know I can detach the checkbox component, and it will fix the issue, but I would like to keep the original checkbox component.

Thank you!

@tomduncalf-figma
Copy link
Contributor

Hey @ikochetov-mdsol, could you share the Code Connect files for these two components, removing the file URLs? If you'd prefer not to share them publicly, you can contact Figma Support, mentioning this issue, and you can share any content with them in private.

@ikochetov-mdsol
Copy link
Author

Sorry for the confusion. I've found an issue with the CodeConnect code. In the card component, I was looking for all the children using figma.children (*), that's why it shows me all the component which are part of the Card.
Is there a way to exclude specific components to be imported?

@karlpetersson
Copy link

It's currently not possible to exclude specific children that are connected, so you would have to instead include the ones you want (using layer names rather than '*') - would that work in this case for you?

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

No branches or pull requests

3 participants