variables-converter-figma-plugin icon indicating copy to clipboard operation
variables-converter-figma-plugin copied to clipboard

✨ mode selector

Open adrianjost opened this issue 1 year ago • 6 comments

I don't know how far I will go with this so I'm already starting a draft PR to show the progress for anyone interested to continue working on this.

It implements the basic idea of #5, making the variable modes toggelable.

Currently looks like this:

https://github.com/lauthieb/variables-converter-figma-plugin/assets/22987140/284f91fb-c873-442a-be05-6ff7d24de248

ToDo

  • [x] code cleanup
  • [x] ~split into more reviewable PRs~ not perfect but good enough I guess.
  • [x] allow grouping by mode name, so that multiple modes with the same name can all be selected at once.
  • [x] ~prettify UI~ good enough

adrianjost avatar Feb 28 '24 16:02 adrianjost

Thank you @adrianjost for beginning this! I hope someone in the community will be able to help you. Sorry, on my side I don't have such time in this period to work on this plugin. Thank you again! 🙌

lauthieb avatar Feb 28 '24 19:02 lauthieb

@lauthieb The code is now working as expected and ready for review. Please let me know what you think.

And sorry if the PR is not as focused as it could be. I've included a couple of small cleanups that felt like they would improve the pr readabilty.

https://github.com/lauthieb/variables-converter-figma-plugin/assets/22987140/ed5b61a9-f505-432a-b798-0176c6cd345d

adrianjost avatar Mar 01 '24 13:03 adrianjost

Wow thank you @adrianjost! I'll review it soon!

lauthieb avatar Mar 02 '24 08:03 lauthieb

Hello @adrianjost,

Thanks for adjusting the code following my review.

I still feel uncomfortable with the idea of having only one select that mixes the concept of "All collections" and modes: CleanShot 2024-05-03 at 00 40 52

As you can see, the plugin always show all collections. But the feature of choosing all collections or only a specific collection is a great idea! What do you think about having two select instead of one?

The first for choosing between "All collections" or a specific collection (by listing current file's variable collections) The second for choosing the mode (by listing current modes for the current collection(s) selected).

Thank you again for this contribution! 🙌

lauthieb avatar May 02 '24 22:05 lauthieb

Hi @lauthieb, I absolutely agree with your take:

Maybe instead of adding "All", it could be better to have 2 select, one for selecting the collection and the other for selecting the mode. What do you think?

I just haven't had time to implement something like that yet. My priorities at work have shifted in the last months so I couldn't commit enough time for continue working on it. I might do in the future, but I can't make promises when that would be. But if anybody want's to continue on my work, feel free to do so.

adrianjost avatar May 03 '24 07:05 adrianjost

@lauthieb I've made the requested change. It is now a breaking change, because the "All variables" mode that showed the default value for all collections now does not exist anymore in this version.

But I would argue that is not necessary and the collection scoped export is the more desired behaviour. At least that what turned out most useful for us. I've initially implemented the All Collections mode because I thought we need it, but being forced to only export specific collections turned out much more useful and easier to use.

In the future, it can still be extended to multi-collection selects and showing only modes that are available in all selected collections but I personally have no use-case for it and would wait until demand from somebody is there.

Let me know what you think. 💚

https://github.com/lauthieb/variables-converter-figma-plugin/assets/22987140/f7fbb057-8b84-4063-948d-84f164466a72

adrianjost avatar May 27 '24 08:05 adrianjost