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

The plugin has huge potential but needs refinements on its current stage #2

Open
MrBiscuit opened this issue Jun 23, 2020 · 14 comments

Comments

@MrBiscuit
Copy link

MrBiscuit commented Jun 23, 2020

Some bugs/issues I have found are listed below:

  1. Alignments and autolayout overrides are ignored and remain unchanged on paste.
  2. Texts remain stock(same as master) on nested symbols upon executing “paste overrides” command.
  3. In comparison mode, all selected nodes will be pasted the same regardless of which node you are currently inspecting using the “swap” function, expected more accurate pasting.

Overall this is a very stunning plugin you are working on and a great start, you have achieved much credibility thus far, this plugin will boost productivity immensely if current issues are fixed.

@CrookedGrin
Copy link
Owner

Thanks for reporting these! Very helpful. #3 is a good catch, I will definitely fix that. For #1, unfortunately I don't think Figma actually exposes alignment or autolayout as properties on the nodes, but I'll see if I can find a way around that.

For #2, can you clarify what you mean a little? Or can you share an example file with me so I can see what's not changing? Is there a different font, or just different text styles?

@MrBiscuit
Copy link
Author

https://www.figma.com/file/EzLtSHBVbfZ0Xpl89fZ8iI/Untitled?node-id=0%3A1
Here is an example file showcasing how the instance’s text remain unchanged upon pasting overrides

IMG_0680
Here is a screenshot on Figma API documentation page addressing autolayout properties, works well on instance overrides, I’ve tried :)

@CrookedGrin
Copy link
Owner

Ah, very nice. Already added them.
image
I had based my set of overridable props on another plugin, but I should probably go back through and just check the API to see if anything else is missing. Thanks again!

@MrBiscuit
Copy link
Author

Great! I’d be happy to test out your new build, And yeah plugins like “Inspector” hasn’t been keeping full track of Figma’s plugin API updates. I am still waiting on the text hyperlink API to be released. But I had to say, it’s such a graceful plugin you are putting together, enormous use cases, full appreciation to the underlying efforts, keep up the good work 🙌🏻

@CrookedGrin
Copy link
Owner

I just pushed up a new commit that fixes some of the text handling and adds a bunch of the autolayout and alignment props you were referring to, if you want to pull it down and test it out. I haven't published the fix yet because I want to fix that swapping issue first as well.

@CrookedGrin
Copy link
Owner

I have now also fixed the swapping / pasting behavior. It will now paste the overrides from right to left if you have two nodes selected, or paste to a single node if you have one selected.

Let me know if you can test the fixes out! Thanks again!

@MrBiscuit
Copy link
Author

Okay, So I’ve cloned your master branch and sadly the pasting function in this version doesn’t seem to work at all :(

@CrookedGrin
Copy link
Owner

Oops, looks like there was a race condition introduced with that swapping fix. I just pushed another update, can you try it again when you get a chance?

@MrBiscuit
Copy link
Author

Much better! Only dimension properties are left out for individual instance on pasting, everything else works great on an individual instance. That said, I have spotted other minor issues with nested instances regarding but not limited to linked fill styles, alignments, and auto-layout paddings.

I have summarised them in one Figma file here

@CrookedGrin
Copy link
Owner

Thanks so much for doing that! Super helpful for me. I'll take a look and see what I can fix.

@CrookedGrin
Copy link
Owner

Hey, @MrBiscuit - Finally had time to take a look at this again. I added support for width and height, which takes care of all the issues in your Figma file except the last one, which has something to do with the remote instances. Not sure what's going on there, so might take a bit longer to fix. I did notice that you can get it to work if you run the plugin twice in a row, so I suspect there's a timing issue when you swap out the master components for remote instances.

Anyway, please take a look and let me know if it works better for you now. I will probably publish a new release in the next few days.

@MrBiscuit
Copy link
Author

Nice, @CrookedGrin, now it works very well except for remote ones, it occurs to me that property changes are propagated prior to the completion of the master component's replacement. Maybe some multithreading logic in the recursion could help, provided Figma has a remote master replacement completion call-back closure.

@CrookedGrin
Copy link
Owner

yeah, I'm thinking I might have to make that into an async call and resolve the promise once the instance is verified somehow. But figma's API seems to imply that it's synchronous, and it usually works. So I'll need to research it a bit more.

@MrBiscuit
Copy link
Author

MrBiscuit commented Sep 1, 2020

Just came across two places that need some optimization

  1. Layer's show/hide states aren't effected on pasting overrides
  2. Enable pasting on multiple instances at once, currently, you have to paste them one at a time

Also, is it possible to add a "copy overrides" and a "paste overrides" command to the manifestation file, so users can bind them to keyboard shortcuts, for faster execution.

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

No branches or pull requests

2 participants