DWilliames / google-sheets-sync-figma

82 stars 8 forks source link

Text not synced when variant is changed? #145

Open peteruithoven opened 1 year ago

peteruithoven commented 1 year ago

Describe the bug The plugins handles a lot of cases, but I ran into one edge case when using variants.

When the variant of a component is changed in an instance of it's parent component the text content isn't synced.

I'm creating a table where cells and rows are made using components. My Cell component has a variant for the header. The Row component has a couple of these cells. Because this Row component is also used as the table header the Cell's variant is set to Header. The textfield layers in the row are renamed to # + the data column. For the body I create an instance of this Row component, which I put it in a @# named frame with auto layout.

Now when I sync things work great.

But when I change the variant of the cells in the Row instances suddenly the text isn't synced anymore. The amount of rows is still correctly synced.

Not sure if this matters but the textfield in both variants is linked to the same property.

To Reproduce Steps to reproduce the behavior: (include a screen recording if possible) and link to Figma file and Google Sheet file

  1. Create a "Cell" Component with a text field and connect the content of the field to a property.
  2. Create a "Header" variant of the component where you for example use a different text style.
  3. Put one or more of these Header variant cells in a "Row" component
  4. In this row component, rename names of the textfield layers in the cells to # + the name of the column in the data.
  5. Create one instance of the "Row"
  6. Put that instance in a auto layout frame named "@#"
  7. Change the variant of the cells in the row instance to the "Default" instead of "Header" variant. (This is where the sync breaks)
  8. Sync sheet.

Examples in Figma: https://www.figma.com/file/ec0tP47tCoq1QPzxmE6vqe/Google-sheets-sync-variant-issue?node-id=0%3A1&t=o9mLzc3XBR1olTRr-1 Example spreadsheet: https://docs.google.com/spreadsheets/d/1kFq1gcTIv0eygdaMn8EeIqRv5c55FHBPLWu28pTd1KM/edit?usp=sharing

Expected behavior Changing variants doesn't break text syncing.

Additional context Add any other context about the problem here.