figma-plugin
figma-plugin copied to clipboard
Refactor Duplicate token to not duplicate the same set and improve UX
We implemented the Duplicate token
feature in a way where it also lets users duplicate into another set in the same go as the regular Duplicate operation.
I'd say let's move Duplicate to other set
to its own operation.
To do:
- Remove the
Set
input from the Duplicate token form - Add a
Duplicate to other set
option to the right click menu of tokens - Introduce this to token groups as well
- When clicked, show a dialog that shows the user the same input we show today, letting them pick token sets. By default, nothing is selected.
- In that dialog, do not show the current set and let users not pick from the current set
- Allow users to select multiple sets in this dialog still
Original issue description
Describe the bug When duplicating a token, even though the current set is deselected and the intended set is selected for duplication, the plugin still duplicates a token within the active (deselected) set.
To Reproduce Steps to reproduce the behavior:
- Edit token
- Deselect current set
- Select set to duplicate token in
- Duplicate token
- See error 'token is also duplicated in the current set'
Expected behavior The plugin should only duplicate the token into the selected set.
Screenshots or Screencasts https://github.com/tokens-studio/figma-plugin/assets/93133012/1da1362b-edb9-4a2d-a531-f88ec52c81a0
One additional thing -- it is not allowing me name it the same in another set (possibly because it is duplicated in the same set)
Linking #2165 , that is showing the issue mentioned in the comments by @alexkovachevic
I want to be sure that we can still duplicate in the same set with a new name if we choose. For example, I want to duplicate a group of color tokens for "primary" and change the name to "secondary" then quickly change the values.