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

Carry-over-token-descriptions-to-variable-descriptions #2330

Merged

Conversation

robinhoodie0823
Copy link
Contributor

@robinhoodie0823 robinhoodie0823 commented Oct 17, 2023

20231017_152626.mp4

Closes #2081

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2023

🦋 Changeset detected

Latest commit: de30344

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

PR Analysis

  • 🎯 Main theme: Carry over token descriptions to variable descriptions
  • 📝 PR summary: This PR aims to carry over token descriptions to variable descriptions. It modifies two files, EditTokenForm.tsx and setValuesOnVariable.ts, to add the description of the token to the variable when the variable is created or edited.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 2, because the changes are straightforward and limited to two files. However, the absence of tests might require some additional time for manual verification.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: It would be beneficial to add tests to verify the new functionality. This would ensure that the token descriptions are correctly carried over to the variable descriptions and would prevent potential regressions in the future.

  • 🤖 Code feedback:

    • relevant file: src/app/components/EditTokenForm.tsx
      suggestion: Consider checking if 'internalEditToken' is not null before using it. This would prevent potential null reference errors. [important]
      relevant line: '+ editToken.description = internalEditToken.description;'

    • relevant file: src/plugin/setValuesOnVariable.ts
      suggestion: It would be good to handle the case where 't.description' is null or undefined. Currently, if 't.description' is null, it would be set as an empty string which might not be the intended behavior. [medium]
      relevant line: "+ variable.description = t.description ?? '';"

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

Commit SHA:faa59ab83ab0ad6d9f2fe062dc2d7c7dba96972a

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: 2081-carry-over-token-descriptions-to-variable-descriptions 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 71.07 (0.06) 61.41 (0.03) 69.29 (0.03) 71.33 (0.07)

() => resolvedTokens
.filter((t) => t.internal__Parent === activeTokenSet)
.find((t) => t.name === internalEditToken?.name),
() => {
Copy link
Member

Choose a reason for hiding this comment

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

Looks great, can we just add a changeset for this?

@SorsOps SorsOps merged commit 1e5beac into main Oct 20, 2023
7 checks passed
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.

Carry over token descriptions to variable descriptions
2 participants