Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default Token Format for Studio sync as DTCG #3264

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akshay-gupta7
Copy link
Contributor

@akshay-gupta7 akshay-gupta7 commented Feb 13, 2025

Why does this PR exist?

Resolves #3259

What does this pull request do?

Currently, if the local storage or previous sync provider had tokens set in Legacy format, while switching to Tokens Studio Sync provider, it was being set to Leagcy as well, inspite of the tokens beign received from studio in DTCD format.
also, hides the badge of Legacy/DTCG in studio sync storage type as the default will always be DTCG

Testing this change

  • Create a sync provider in the plugin from studio
  • Switch to Local Storage, change format to legacy
  • Switch back to Tokens Studio storage and it should be set to DTCG by default again

Additional Notes (if any)

Screenshot 2025-02-14 at 11 03 29 AM

@akshay-gupta7 akshay-gupta7 self-assigned this Feb 13, 2025
Copy link

changeset-bot bot commented Feb 13, 2025

⚠️ No Changeset found

Latest commit: c81c237

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

Copy link
Contributor

github-actions bot commented Feb 13, 2025

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

Copy link
Contributor

github-actions bot commented Feb 13, 2025

Commit SHA:9ff392dd2973ef884e517a5a409739c18c617131

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: fix-studio-sync-format 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 67 (-0.01) 58.01 (0.01) 63.89 (0) 67.38 (-0.01)
🟢 packages/tokens-studio-for-figma/src/app/components/StorageItem.tsx 93.1 (0) 66.66 (5.13) 100 (0) 92.85 (0)
🔴 packages/tokens-studio-for-figma/src/app/store/remoteTokens.tsx 75.91 (-0.63) 60.43 (0) 80 (0) 76.03 (-0.63)

@akshay-gupta7 akshay-gupta7 requested a review from six7 February 13, 2025 18:39
Copy link
Contributor

Commit SHA:9ff392dd2973ef884e517a5a409739c18c617131
Current PR reduces the test coverage percentage by 1 for some tests

Copy link
Collaborator

@six7 six7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this issue will be obsolote once you complete https://github.com/tokens-studio/studio-app/issues/2152 which will return them as DTCG

@akshay-gupta7
Copy link
Contributor Author

I think this issue will be obsolote once you complete tokens-studio/studio-app#2152 which will return them as DTCG

This issue does not appear to be particularly from studio sync, rather the tokenFormat persists the tokenFormat of the previous sync provider(or local), and if the previous one is legacy and then they choose studio sync, it sets to legacy regardless of the format it is receiving the tokens in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The tokens studio sync provider shows legacy tokens label
2 participants