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.33k stars 191 forks source link

2643 20 dtcg icon does not update when switching requires relaunch #2826

Closed robinhoodie0823 closed 1 month ago

robinhoodie0823 commented 1 month ago

Why does this PR exist?

Current plugin does not change the dtcg icon when switching branches which have different token format.

Closes #2643

What does this pull request do?

Added a new state function to update token format when switching branches.

Testing this change

Additional Notes (if any)

https://github.com/tokens-studio/figma-plugin/assets/103296157/d11e774c-fb44-4f39-9963-b5b183839d78

changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: 6251d17967ef6e5d2c9799433f7d8ad655c2d762

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

robinhoodie0823 commented 1 month ago

Why not just call setTokenFormat when pulling?

Because the setTokenFormat function needs TokenFormatOptions as parameter.

six7 commented 1 month ago

Why not just call setTokenFormat when pulling?

Because the setTokenFormat function needs TokenFormatOptions as parameter.

But so does the setPulledTokenFormat? its calling setTokenFormat in state - cant we directly call it and not introduce this new function? It feels like somewhere that setTokenFormat call is missing where it should be there?

(I'm just hesitant to add new state calls for when we might just be missing the right one)