Giter VIP home page Giter VIP logo

Comments (7)

paintedbicycle avatar paintedbicycle commented on May 23, 2024 1

Ok great. Hopefully they expose the ability to set this in the API. I will take a look this weekend. If it's possible to fix, it should be done in a few days.

from sketch-data-faker.

paintedbicycle avatar paintedbicycle commented on May 23, 2024

Thanks for reporting this. I haven't tested with layers from external libraries, so you may be right that it's a bug in Sketch Data Faker. I'll take a look.

Can you tell me one thing though - have you used regular "Sketch Data" on a layer imported from a Library? And does that work? So, if you do exactly the same thing you tried with Sketch Data Faker, but instead you choose "Data -> Sketch Data -> Names" - will that work on the same layer that Sketch Data Faker is not?

Thanks!

from sketch-data-faker.

timohofmeijer avatar timohofmeijer commented on May 23, 2024

Yes, I tested this.

  • Other ‘Sketch Data’ does work as expected when overriding library symbol instances.
  • Manual (not name based) ‘Faker Data’ overrides work neither.

from sketch-data-faker.

paintedbicycle avatar paintedbicycle commented on May 23, 2024

Hi @timohofmeijer - a quick update.

I did some debugging this weekend and recreated your issue. Two things I learned:

  1. Sketch Data Faker is not finding the layer correctly, when the layer is a from a library. I do a check here https://github.com/paintedbicycle/sketch-data-faker/blob/master/src/faker.js#L25 that currently retrieves the layer by looking up the id of either a normal layer, or, in the case of a symbol, it uses the symbol override instead. It looks like I need to add yet another check here for library instances, passing the correct id. I thought it would already be taken care of, but apparently not. I'll have to research a little more to get this working.

  2. One potential issue I see going forward is with Automatic Mode which requires changing the layer name. I'm not certain you can rename layers inside libraries that you've imported. Do you know if that's true (in general with Sketch) or are layer names locked and you need to detach from the library before you can rename them?

So I can likely get Manual Mode (the one with quick overrides) working, but it might be harder to get the full automatic mode working unless the Sketch user has the ability to edit the names of the original library layer. I'll definitely want to get this working with libraries, so it might mean a much larger plugin rewrite. Anyway, more research needs to be done...perhaps I can indeed change the layer name programatically. Just not sure yet.

I'll keep going on this next weekend.

from sketch-data-faker.

timohofmeijer avatar timohofmeijer commented on May 23, 2024

Hi Paul, grateful for your efforts! One could of course rename layers in a self managed library. With an external library (e.g. iOS) this would require a fork and is likely not desirable. I personally would prefer applying data manually even though I manage the library myself. I could fork and have a look at the code this weekend, if you could let me know if you are not already on this, so we don't spend duplicate time : )

from sketch-data-faker.

paintedbicycle avatar paintedbicycle commented on May 23, 2024

@timohofmeijer Just pushed a version live for testing. You should now be able to override the text in a library layer using Manual mode.

Automatic mode works too, but it sets the layer name on the parent. This is the only editable layer name and actually happens automatically. However, since the layer that gets the new content is only the layer that is selected, it updates the correct layer with the text.

I'll have to investigate more, but let me know what you think

from sketch-data-faker.

paintedbicycle avatar paintedbicycle commented on May 23, 2024

Hi @timohofmeijer I broke Library symbol overrides in a previous release, sorry about that. It is now fixed with 0.7.0. If you're still using it, I'd love to hear if it worked for you.

Thanks!

from sketch-data-faker.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.