DWilliames / google-sheets-sync-figma

80 stars 8 forks source link

Invalid component selected if components share property names #206

Open lmapii opened 6 months ago

lmapii commented 6 months ago

Describe the bug I am using two components CostSection and CostSectionCopy where the variant is selected using the property SectionTrend. Both components thus use the same property name.

In my spreadsheet, I am selecting the variant using a column with the name CostSection. In Figma, I have an instance of the CostSection component with the name #CostSection.

I'd not expect the plugin to change the component type of my instance since I'm only specifying its properties, but somehow this seems to be convoluted. The plugin changes my instance to the component type CostSectionCopy.

image

Before the sync:

image

After the sync:

image

The column in the spreadsheet definitely has the correct name:

image

Only if I give the CostSectionCopy a unique property name, the component is correct. I've also tried to specify the actual component name in the input spreadsheet, e.g., CostSection SectionTrend=Up, but then the element would no longer sync properly. How can I prevent the plugin from swapping out the component type if I'm only specifying its properties?

To Reproduce See above, creating two components with the same property names should be sufficient.

Expected behavior When specifying properties for a component, I'd expect that the plugin doesn't swap the actual component but only applies the selected properties.

This is pretty crucial for larger datasets since components may easily have the same property names that I'd like to control via the spreadsheet.