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

Broken color variable references #3212

Open
danielius-tvarijonas opened this issue Nov 27, 2024 · 6 comments
Open

Broken color variable references #3212

danielius-tvarijonas opened this issue Nov 27, 2024 · 6 comments
Assignees

Comments

@danielius-tvarijonas
Copy link

danielius-tvarijonas commented Nov 27, 2024

Describe the bug
After exporting the variables (which include three collections: primitives, semantic, and mode), the referenced color variables in the semantic and mode collections appear as broken or ghost variables (see the image below). However, when I export the variables a second time, it resolves the issue, replacing the broken references with the correct variables. The question mark indicators are replaced with color swatches as expected.

Expected behavior
Referenced variables should display correctly immediately after the initial export, without requiring a second export to fix them.

Screenshots or Screencasts
broken variables

@keeganedwin
Copy link
Collaborator

@danielius-tvarijonas, could you perhaps share the steps to reproduce this? I have heard this issue before where the variables are only relinked on the 2nd export.

@danielius-tvarijonas
Copy link
Author

@danielius-tvarijonas, could you perhaps share the steps to reproduce this? I have heard this issue before where the variables are only relinked on the 2nd export.

@keeganedwin It happens randomly when exporting variables from the themes (as shown in the attached screenshot) using the standard method without any additional steps.

Screenshot 2024-12-02 at 13 15 42

Screenshot 2024-12-02 at 13 12 17

@danielius-tvarijonas
Copy link
Author

danielius-tvarijonas commented Dec 17, 2024

@keeganedwin I think I found what was causing the issue. After removing the lines related to token attachment to variables and styles, as well as the collection and mode IDs, all the variables are now being exported correctly on the first attempt.

However, I noticed that after the variables are exported, the plugin indicates there are new theme configuration changes that can be pushed to the GitHub repo. When I check the themes, all the token attachments to variables and styles reappear—even though I hadn’t manually attached them (I had manually removed all the relevant lines of code just before exporting the variables).

Is this intended behavior? If so, is there a way to disable the automatic token attachment to variables and styles?

Additionally, I’ve noticed that when I remove the token attachments to variables and styles via the plugin, some of the related code remains in the JSON file. As a result, I have to export the tokens into the JSON file, manually remove those lines, and then re-import it—which is quite cumbersome.

@keeganedwin
Copy link
Collaborator

@keeganedwin I think I found what was causing the issue. After removing the lines related to token attachment to variables and styles, as well as the collection and mode IDs, all the variables are now being exported correctly on the first attempt.

However, I noticed that after the variables are exported, the plugin indicates there are new theme configuration changes that can be pushed to the GitHub repo. When I check the themes, all the token attachments to variables and styles reappear—even though I hadn’t manually attached them (I had manually removed all the relevant lines of code just before exporting the variables).

Is this intended behavior? If so, is there a way to disable the automatic token attachment to variables and styles?

Additionally, I’ve noticed that when I remove the token attachments to variables and styles via the plugin, some of the related code remains in the JSON file. As a result, I have to export the tokens into the JSON file, manually remove those lines, and then re-import it—which is quite cumbersome.

First off, glad to hear that your initial issue is resolved! I think the reason they were appearing as ghost variables is because they were out of sync with the plugin. This could be for various reasons that I can't outline since I don't know the history of the file. However, as the first troubleshooting option, re-exporting variables should usually just fix the ghost variables issue.

  1. The plugin does not automatically attach tokens to variables and styles until unless instructed to. If you've re-exported styles & variables for all themes and or attached them manually, the plugin will display the attached IDs.

Are you a part of our slack community? If yes I would like to see a recording of this behaviour, as I want to make sure I'm understanding your issue correctly.

@danielius-tvarijonas
Copy link
Author

@keeganedwin I think I found what was causing the issue. After removing the lines related to token attachment to variables and styles, as well as the collection and mode IDs, all the variables are now being exported correctly on the first attempt.
However, I noticed that after the variables are exported, the plugin indicates there are new theme configuration changes that can be pushed to the GitHub repo. When I check the themes, all the token attachments to variables and styles reappear—even though I hadn’t manually attached them (I had manually removed all the relevant lines of code just before exporting the variables).
Is this intended behavior? If so, is there a way to disable the automatic token attachment to variables and styles?
Additionally, I’ve noticed that when I remove the token attachments to variables and styles via the plugin, some of the related code remains in the JSON file. As a result, I have to export the tokens into the JSON file, manually remove those lines, and then re-import it—which is quite cumbersome.

First off, glad to hear that your initial issue is resolved! I think the reason they were appearing as ghost variables is because they were out of sync with the plugin. This could be for various reasons that I can't outline since I don't know the history of the file. However, as the first troubleshooting option, re-exporting variables should usually just fix the ghost variables issue.

I think something might be wrong with the lines related to the attachment of tokens, as I’ve started noticing even more strange behavior. In addition to ghost variables, the plugin fails to generate some of the variable modes (themes), and the order of collections and modes is incorrect as well. But again, the issue was resolved by manually removing those lines.

  1. The plugin does not automatically attach tokens to variables and styles until unless instructed to. If you've re-exported styles & variables for all themes and or attached them manually, the plugin will display the attached IDs.

It's happening on my end automatically, after I export the variables and go to the theme settings, tokens and styles are re-attached again without me doing anything. I will try to record and share it.

Are you a part of our slack community? If yes I would like to see a recording of this behaviour , as I want to make sure I'm understanding your issue correctly.

No.

@keeganedwin
Copy link
Collaborator

@danielius-tvarijonas, you can share the recording with my email keegan@hyma.io if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📥 Triage
Development

No branches or pull requests

3 participants