slice-machine icon indicating copy to clipboard operation
slice-machine copied to clipboard

Saving custom preview screenshot no longer works without slice simulator

Open Valur opened this issue 3 years ago • 1 comments

Versions

  • slice-machine-ui: v0.4.2
  • node: v16.13.0

Steps to reproduce

  1. Create a new slice
  2. Click the "Custom screenshot" button
  3. Select image

What is expected?

preview.png image should be resized and saved in the 'default' folder for the slice like it did in previous versions

What is actually happening?

Error about slice simulator not being set up

This seems like a regression from v0.4.1, don't see why the simulator should be required for this.

Valur avatar Aug 09 '22 14:08 Valur

I have a PR up for fixing this, can someone please take a look? #551

VarunBalakrishna avatar Aug 10 '22 05:08 VarunBalakrishna

Hey @Valur thanks for reporting this issue 😄. We made a PR based on yours @VarunBalakrishna and just updated it to the latest version, thank you for contributing 😊 🙏. This will be available in Slice Machine's next version.

Cheers 🎉

Heyrows avatar Aug 25 '22 14:08 Heyrows

Hi, I tried the [email protected] to fix the current issue and the upload is ok yes. My preview.png has been well generated but only one model.json has been updated (my first slice) with the the right imageUrl, other model.json have not been updated and trying to trigger an update by another change on others slices doesn't work. So locally it's ok I see my differents previews in http://localhost:9999/slices (libraries-state.json has multiple screenshotPaths) but on prismic.io, only the first slice preview is available.

webda2l avatar Aug 29 '22 13:08 webda2l

hey @webda2l. On the latest version, screenshots are not performed on save / push, you'll have to use the buttons to take them manually.

Slices screenshot (automatic or custom) can only be taken for 1 slice at a time so i'm not sure to understand what you meant when you said other model.json have not been updated

Heyrows avatar Aug 29 '22 14:08 Heyrows

hey @webda2l. On the latest version, screenshots are not performed on save / push, you'll have to use the buttons to take them manually.

Slices screenshot (automatic or custom) can only be taken for 1 slice at a time so i'm not sure to understand what you meant when you said other model.json have not been updated

Hi @Heyrows So, the manual screenshot feature that was not ok with the 0.4.2, is ok with the [email protected]. I retried and understood the problem. I updated previews of multiple slices without "Push to Prismic" after each upload, and locally on the slice itself or the slice listing pages, the render is ok. But if you go back to the slice, no changes are detected and you can't "Push to Prismic" anymore. You have to upload back again the same image and then "Push to Prismic" really just after. There is a minor issue of detecting changes on slices about screenshot.

webda2l avatar Aug 29 '22 15:08 webda2l

Oh ok, i think i see what you mean. Taking a screenshot is not considered as a change so you can't save the new changes and push it to Prismic.

Is that it @webda2l ?

  • If yes, we'll start investigating 😄
  • If no, could you post a small video of the issue thanks 🙏

Heyrows avatar Aug 29 '22 15:08 Heyrows

Oh ok, i think i see what you mean. Taking a screenshot is not considered as a change so you can't save the new changes and push it to Prismic.

Is that it @webda2l ?

* If yes, we'll start investigating smile

* If no, could you post a small video of the issue thanks pray

Yes this is kind of it :)

Taking a custom screenshot doesn't have the "Save model to filesytem" step but directly the "Push to Prismic" step, and so, if you don't "Push to Prismic" right after the screenshot and do others things (like uploading a screenshot on another slice), the screenshot will be ok locally but you'll don't have this change in the "Changes" tab to push it later from it, neither having back the "Push to Prismic" button back from the slice whose you have add a screenshot. => so you have to upload again the screenshot from the slice and don't miss the opportunity to "Push to Prismic"

webda2l avatar Aug 29 '22 15:08 webda2l

That is definitely an issue 👍 . I'll make sure it's fixed before the release. Thank you @webda2l for bringing it up, really appreciate it 😄.

Heyrows avatar Aug 29 '22 16:08 Heyrows

That is definitely an issue +1 . I'll make sure it's fixed before the release. Thank you @webda2l for bringing it up, really appreciate it smile.

You're welcome :)

webda2l avatar Aug 29 '22 16:08 webda2l

This bug fix is deployed to Production.

pavery007 avatar Oct 04 '22 13:10 pavery007