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

Prevent extra brackets{ } and whitespaces being added on token name searches (mentions) #2902

Closed
cuserox opened this issue Jun 21, 2024 · 4 comments
Assignees
Labels

Comments

@cuserox
Copy link
Contributor

cuserox commented Jun 21, 2024

Describe the bug
Tweaking the extra space when token search is used (#2789) the way that search results are populated has been slightly broken!

To Reproduce
Steps to reproduce the behavior:

  1. Edit a token to reference an alias
  2. Select an alias
  3. Edit the alias manually by searching
  4. Click on any result, see the bracket {} added randomly on the input

Expected behavior
No extra bracket nor spaces should be added when a token name is clicked on after searching.

Screenshots or Screencasts
https://github.com/tokens-studio/figma-plugin/assets/114073780/335dd67b-6bf2-484f-b528-03733e1a3d50

@cuserox cuserox added bug Something isn't working plugin v2 variables, UI, WTCG format, Bitbucket labels Jun 21, 2024
@cuserox cuserox self-assigned this Jun 21, 2024
@cuserox cuserox moved this to 📤 Ready for dev in Tokens Studio for Figma Roadmap Jun 21, 2024
@six7
Copy link
Collaborator

six7 commented Jun 22, 2024

@cuserox I have a fix for this available in six7/fix-mentions. It turns out a recent change we did to mentions was causing this. Removing this again makes everything work, except that the extra space at the end of the input is added. It's the split="" that was the issue.

Perhaps we could adjust this so after applying it strips out the extra space?

For example if you have a token like {fontsize-small}rem and you replace fontsize-small with something else, it adds an extra space. But it no longer adds the } after, which is a great improvement but the space is a bit of an issue (which we attempted to solve with that split="" but the sideeffects are worse with that.

@cuserox cuserox changed the title Preven brackets{ } being added on token name searches Prevent extra brackets{ } being added on token name searches Jun 24, 2024
@cuserox cuserox changed the title Prevent extra brackets{ } being added on token name searches Prevent extra brackets{ } and _spaces_ being added on token name searches (mentions) Jun 24, 2024
@cuserox cuserox changed the title Prevent extra brackets{ } and _spaces_ being added on token name searches (mentions) Prevent extra brackets{ } and whitespaces being added on token name searches (mentions) Jun 24, 2024
@cuserox
Copy link
Contributor Author

cuserox commented Jun 24, 2024

@cuserox I have a fix for this available in six7/fix-mentions. It turns out a recent change we did to mentions was causing this. Removing this again makes everything work, except that the extra space at the end of the input is added. It's the split="" that was the issue.

Perhaps we could adjust this so after applying it strips out the extra space?

For example if you have a token like {fontsize-small}rem and you replace fontsize-small with something else, it adds an extra space. But it no longer adds the } after, which is a great improvement but the space is a bit of an issue (which we attempted to solve with that split="" but the sideeffects are worse with that.

@six7 makes sense. All in all, this fix should be for no side effects to occur when a user searches tokens 🔨

@cuserox cuserox moved this from 📤 Ready for dev to 🕜 In Progress in Tokens Studio for Figma Roadmap Jun 24, 2024
@cuserox cuserox moved this from 🕜 In Progress to 📤 Ready for dev in Tokens Studio for Figma Roadmap Jun 27, 2024
@cuserox
Copy link
Contributor Author

cuserox commented Jun 27, 2024

@six7 @macintoshhelper @robinhoodie0823

I have created a Draft MR here, merely because it needs more testing. I believe it works well with my fix, but I wouldn't want to merge it and cause more trouble for V2 (and I'm off this Friday & Monday) 😇

Therefore if it's a pressing fix that needs to go out, please feel free to tweak, test & merge if needed!

@cuserox cuserox moved this from 📤 Ready for dev to 👀 Needs review in Tokens Studio for Figma Roadmap Jun 27, 2024
@cuserox cuserox moved this from 👀 Needs review to 📋 Changes requested in Tokens Studio for Figma Roadmap Jul 2, 2024
@cuserox cuserox removed the plugin v2 variables, UI, WTCG format, Bitbucket label Jul 2, 2024
@six7
Copy link
Collaborator

six7 commented Aug 5, 2024

We'll tackle this with #2998

@six7 six7 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
@github-project-automation github-project-automation bot moved this from 📋 Changes requested to ✅ Done in Tokens Studio for Figma Roadmap Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants