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

Figma Code Connect ☂️ #16273

Open
17 of 54 tasks
alisonjoseph opened this issue Apr 26, 2024 · 8 comments
Open
17 of 54 tasks

Figma Code Connect ☂️ #16273

alisonjoseph opened this issue Apr 26, 2024 · 8 comments
Assignees
Labels
planning: umbrella Umbrella issues, surfaced in Projects views role: dev 🤖

Comments

@alisonjoseph
Copy link
Member

alisonjoseph commented Apr 26, 2024

Research and test feasibility of using Figma Code Connect to link Carbon Figma and Carbon React for AI readiness.

Demo video https://www.youtube.com/watch?v=5GVNfbltrQg
Demo repo https://github.com/jake-figma/code-connect-demo

Tasks

  1. role: dev 🤖
    alisonjoseph
  2. alisonjoseph
  3. alisonjoseph
  4. role: dev 🤖
  5. alisonjoseph
  6. role: dev 🤖
    alisonjoseph

Audit/connect all components

Connect / attempt to connect all components.
Document mismatch between Figma / code & create issues where appropriate.
Followup with Figma / create issues on needed functionality.

Components

  1. area: code connect role: dev 🤖
  2. area: code connect role: dev 🤖
  3. area: code connect role: dev 🤖
  4. area: code connect role: dev 🤖
  5. area: code connect role: dev 🤖
  6. area: code connect role: dev 🤖
  7. area: code connect role: dev 🤖
  8. area: code connect role: dev 🤖
  9. area: code connect role: dev 🤖
  10. area: code connect role: dev 🤖
  11. area: code connect role: dev 🤖
  12. area: code connect role: dev 🤖
    alisonjoseph
  13. area: code connect role: dev 🤖
  14. area: code connect role: dev 🤖
  15. area: code connect role: dev 🤖
  16. area: code connect role: dev 🤖
    alisonjoseph
  17. area: code connect role: dev 🤖
    alisonjoseph
  18. area: code connect role: dev 🤖
    alisonjoseph
  19. area: code connect role: dev 🤖
  20. area: code connect role: dev 🤖
  21. area: code connect role: dev 🤖
  22. area: code connect role: dev 🤖
  23. area: code connect role: dev 🤖
  24. area: code connect role: dev 🤖
  25. area: code connect role: dev 🤖
    alisonjoseph
  26. area: code connect role: dev 🤖
  27. area: code connect role: dev 🤖
  28. area: code connect role: dev 🤖
  29. area: code connect role: dev 🤖
  30. area: code connect role: dev 🤖 status: blocked 🙅‍♀️
  31. area: code connect role: dev 🤖
@alisonjoseph
Copy link
Member Author

alisonjoseph commented Apr 30, 2024

Need to be able to access nested component properties - figma/code-connect#11

Variable modes aren't currently supported. (we aren't using them in Figma currently, something to keep in mind) figma/code-connect#6

Components with no issues 🥳

  • Button
  • Link

Components tested with issues/bugs 🐞

Dropdown / DropdownSkeleton

Accordion / AccordionItem / AccordionSkeleton

Tabs

  • TabPanel doesn't exist in Figma
  • Similar to above, many props in Figma exist on Tabs items when in code they are set on Tabs.
  • secondaryLabel isn't a property in Figma, just text. - on roadmap Can you target "Text" layers as "children"? figma/code-connect#30
  • TabsSkeleton in code refers to an entire component, in Figma it is a state on Tabs items so can't be mapped.
  • IconTab nesting bugs in dev mode in Figma

Notification

DataTable

  • Data table header doesn't exist in code
  • Size properties don't match. Figma has 'XL / LG / MD' or 'SM / XS' where code has xs ,sm, md, lg, xl. Figma requires you set the size properties on different components vs. code.
  • WIP....
  • .. coming back to this one later

Breadcrumb / BreadcrumbItem

  • noTrailingSlash is set on parent Breadcrumb in code, in Figma it is set as current property on individual breadcrumb item component(s).
  • Skeleton state in Figma is set on individual Breadcrumb items vs. in code it is the entire Breadcrumb component.
  • OverflowMenu doesn't appear to be a child of BreadcrumbItem in Figma, so can't directly pull into dev mode code.
  • Variant restriction nesting bug

Checkbox / CheckboxGroup

  • indented in Figma doesn't exist in code, has to be added via custom styles by a dev in code.
  • label in Figma can be added to any Checkbox, although would only ever be added to the first item, in code it can only be added to a Checkbox group as legendText.
  • CheckboxGroup missing horizontal variant #16486
  • In Figma you can set the component state to warn or invalid and then hide the message, this is impossible in code, if the state is warn or invalid the icon for the message always shows up.

CodeSnippet

Inline

Single

Multiline

Skeleton

  • Singleline skeleton not available in Figma

Toggle

@juanencalada

This comment was marked as resolved.

@alisonjoseph

This comment was marked as resolved.

@alisonjoseph
Copy link
Member Author

@juanencalada I'm still pretty new to Figma, but was looking at seeing if there was a way to bring nested properties from children into their parent and found this. https://forum.figma.com/t/add-a-forward-props-property-on-parent-component-inherit-props-from-a-selected-child-component/27875/2 Would this work with the way things are built in Carbon?

@juanencalada
Copy link

Hey @alisonjoseph, yes this is possible and something we do in several components already. However, it happens for each nested component, so we don't do it in cases where we have lots of nested components like in an accordion or dropdown because it would make the properties panel really long and harder to navigate. Unfortunately, there's currently also no control over which nested props we want to surface, so it's all or nothing. Meaning, we might expose properties we don't want to expose. If for example we have an accordion with left aligned, and we exposed the props of all accordion items, the right align prop would be visible there too which would just be noise.

@alisonjoseph
Copy link
Member Author

@juanencalada hmm, for Accordion specifically I think we would want most of the properties exposed. I suppose the ones that would be weird/confusing would be the state or titleText since those need to be set on the individual item. There should never be an instance where someone is right and left aligning items within the same Accordion.

@alisonjoseph alisonjoseph changed the title Research Figma's Code Connect Figma Code Connect ☂️ May 7, 2024
@alisonjoseph alisonjoseph added the planning: umbrella Umbrella issues, surfaced in Projects views label May 7, 2024
@alisonjoseph
Copy link
Member Author

@juanencalada another thing to keep in mind is that anything that changes or gets renamed in Figma will break Code Connect. It looks like sometime in the last few days Dropdown changed "Label text" to "Label" and that completely broke publishing. I was able to fix the error, however my sample Figma file with dropdown didn't update and code connect stopped working with an error that Label didn't exist when swapping to dev mode. Not sure how often changes like this happen?

@juanencalada
Copy link

Hey Alison, that makes sense and thanks for highlighting this! I don't think this happens too often. Most common would be around times when there are new feature releases or a component is getting updated for some reason.

This one in particular I had noticed the other day that the naming of the props wasn't matching how we name similar props in other components so that's probably what changed here.

I think something we could do is a full audit of the component props to ensure we have the consistency we want at least within Figma to minimize any breaking changes, as well communicate around release schedules to ensure component props are aligned across design and dev.

Something that comes to mind is I wonder if good feedback for Figma might be having some alias associated with the props so that if a prop name changes it's not entirely dependent on that to make a connection from the Figma side. Just a thought but might not be much there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
planning: umbrella Umbrella issues, surfaced in Projects views role: dev 🤖
Projects
Status: 🏗 In Progress
Status: 🏗 In Progress
Development

No branches or pull requests

2 participants