tokens-studio / figma-plugin

Official repository of the plugin 'Tokens Studio for Figma' (Figma Tokens)
https://www.figma.com/community/plugin/843461159747178978
MIT License
1.37k stars 197 forks source link

Unusual Remapping (Renaming) Behaviour #2338

Open keeganedwin opened 1 year ago

keeganedwin commented 1 year ago

Describe the bug When remapping (changing path name) certain tokens, they usually get added to other token-types. I was editing my Font type tokens, deleting and remapping to typography. When I checked the inspect tab to double check the tokens applied, the font+typography naming where prefixed with the padding tokens.

Here is the used-case of a user facing the same issue:

For example, in the dimension tokens of a component I had the tokens: idm-comp.table-header.item.inset.sm idm-comp.table-header.item.inset.md I subgrouped the group "item" again by adding .screen-lg. Now - idm-comp.table-header.screen-lg.item.inset.sm After that this, the new subgroup was added to some mapping-links like color and borderwidth, borderradius, and not in the token names itself but in the mapping link which I can see in the inspect view. So I had to remove the screen-lg in this mapping-links to correct it.

Expected behavior Plugin shouldn't remap tokens into other token-types.

Screenshots or Screencasts I have annotated the groups and the incorrect prefixed token names in Red

CleanShot 2023-10-27 at 13 08 33@2x

User screenshots: Screenshot 2023-10-27 at 10 28 34 AM Screenshot 2023-10-27 at 10 33 17 AM

User Recording: User renames one group from Utrecht to Todo, but upon confirming the remap process all other tokens are renamed as well https://github.com/tokens-studio/figma-plugin/assets/93133012/e70e95d2-275e-43ef-b073-b4f1db7efee5

keeganedwin commented 7 months ago

This bug seems to be back. If via the JSON editor I:

  1. Rename the group from utrecht. to todo..
  2. Save json
  3. Apply to page to update the references
  4. See error

In the inspect panel I can see they haven't remapped and that I have to manually remap them from utrecht. to todo.

https://github.com/tokens-studio/figma-plugin/assets/93133012/b26616fa-8aec-4ccc-b49d-9db624a0ccb1

Test file

keeganedwin commented 4 months ago

This is reproducible as of rc10

keeganedwin commented 1 week ago

@six7 still present in 2.2.1.