Saving custom preview screenshot no longer works without slice simulator
Versions
- slice-machine-ui: v0.4.2
- node: v16.13.0
Steps to reproduce
- Create a new slice
- Click the "Custom screenshot" button
- 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.
I have a PR up for fixing this, can someone please take a look? #551
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 🎉
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.
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
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.
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 🙏
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"
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 😄.
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 :)
This bug fix is deployed to Production.