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

Add descriptions to tokens in Figma #350

Closed
mkernohanbc opened this issue May 17, 2024 · 4 comments
Closed

Add descriptions to tokens in Figma #350

mkernohanbc opened this issue May 17, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@mkernohanbc
Copy link
Contributor

mkernohanbc commented May 17, 2024

Currently, we don't use the description field for Figma variables in the design tokens library. Tokens Studio does support a description field for each token, meaning we can create and manage variable descriptions at source.

A user has identified this as a refinement that would make it easier to understand the intended usage and scope of a given token, increasing their confidence level that they're using tokens 'correctly'.

This is likely to be a moderate lift, but is not a breaking change. Earmarking for a potential 3.0.1 or 3.1 release.

@mkernohanbc
Copy link
Contributor Author

@Philip-Cheung I'm happy to take this on, adding you for visibility.

@Philip-Cheung
Copy link

Philip-Cheung commented Jul 29, 2024

Currently blocked from accessing TS (same issue of TS asking me for credentials to continue). Will need @ty2k to remove the access token for me to access TS

CC @mkernohanbc

@ty2k
Copy link
Contributor

ty2k commented Jul 30, 2024

Philip was blocked by the "Couldn't load tokens stored on GitHub" error as seen in the screenshot below after opening Tokens Studio:

Couldn't load tokens stored on GitHub
Unable to fetch tokens from remote storage, if you haven't added credentials yet add them in the next step. Otherwise make sure the file exists and you have access to it.
(Enter credentials)

Tokens Studio - Couldn't load tokens stored on GitHub

How we resolved this

  1. Working in the "Tokens 3.0.1" branch in Tokens Studio plugin in Figma, I set up a new Sync Provider that points to bcgov/design-system using a new GitHub fine-grained personal access token (PAT) that I generated. The GitHub PAT only has access to read from this repo. This means it can read the existing JSON tokens data stored in the repo, which should be sufficient to unblock Philip's work. When it comes to adding changes to the JSON tokens data in the repo, I intend to do it by either:
    • Making a new branch in bcgov/design-system where I will manually commit the new JSON data (copy/paste from the TS plugin).
    • Making a new branch on a forked personal repo ty2k/design-system where my GitHub PAT has write access (the plugin itself will push a commit to a branch in my personal repo, no copy/paste)

This is what the sync provider settings look like:

  • Name can be anything
  • Personal Access Token is one generated by me that has at least read access to bcgov/design-system
  • Repository (owner/repo) is bcgov/design-system
  • Branch needs to refer to an existing branch, which in this case I cut from main and pushed just before this
  • File Path needs to point to packages/design-tokens/input/tokens.json which needs to exist (though it doesn't need existing data in it - if the target file path does have valid tokens JSON, that will over-write any changes in the Figma file as we have experienced in the past)
  • Base URL should be left blank
Sync provider details
  1. After the sync provider details are entered, hitting "Save" brings up a new dialog asking if we would like to pull the existing tokens data from GitHub:

Pull from GitHub?
Your repo already contains tokens, do you want to pull these now?
(Cancel) (Yes)

Note that this is a destructive action! If you select "Yes", you will be overwriting any existing token data in the file with the JSON data that's at your File Path in your sync provider.

Pull from GitHub dialog

I answered "Yes" since our File Path target contains the most recent tokens data (v3.0.0 right now) and that is what I would like to start with.

  1. Now the Settings screen in the Tokens Studio plugin looks like the screenshot below. Note the addition of the "bcgov/design-system" sync provider.
Sync providers with bcgov/design-system

At this point, Philip still has no access. I click the "Apply" button next to "Local document" in an effort to apply the data from the File Path target to the local file.

  1. Another modal pops up asking if we want to "set to document storage":

Set to document storage?
You can always go back to remote storage.
(Cancel) (Yes, set to local)

I click "Yes, set to local".

  1. At this point, our sync provider is set to "Local document" using the data from our File Path target. This is the point where Philip has access again:
Sync provider set to local document

@mkernohanbc
Copy link
Contributor Author

Completed with 3.1.1 update, rolling out today/tomorrow.

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

No branches or pull requests

3 participants