Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Safe preview modifies Pluto file even if no edits were done

Open ederag opened this issue 1 year ago • 6 comments

The new safe preview is real nice because it allows inspection before running code, but it is not "safe" for the file itself, which can be modified even before "Run notebook code" is clicked.

For instance, opening a notebook starting with

### A Pluto.jl notebook ###
# v0.19.27

e.g. Pluto_lost_disabled_23803aa.zip

results in this diff:

-# v0.19.27
+# v0.19.30

even if still in "safe preview mode": Screenshot_20231023_122536

I'd prefer the file to stay pristine while in safe preview mode, to allow copy/paste from an old notebook without touching the underlying git repo.

ederag avatar Oct 23 '23 10:10 ederag

Thanks! Just to be clear, safe preview should let you modify the file, but it is a nice suggestion to not touch the file if no edits were done.

fonsp avatar Oct 27 '23 14:10 fonsp

Indeed it's important to be able to fix the notebook before running it.

About the title edit: I also see comment blocks being removed and code being moved around at least for one notebook (not just the Pluto number changes).

ederag avatar Oct 28 '23 08:10 ederag

Dear Plutonians and Julians, I understand "Safe preview" is something new. I am relatively new to Julia. At the moment, this new feature broke my otherwise working Pluto notebook, i.e. certain parts do not render anymore even after clicking "run the notebook". Is there anything I can do to remedy this? Downgrade Pluto, or something better? I am confident my notebook is safe for me to run. I am attaching a screenshot with a minimal (non-) working example. The 4 cells for the grid are each working individually, but not this div grid. I would be very greatful for any helping pointers to fix my notebook again. The cell not working in the div is an embedded Youtube video, but the same problem also applies for my sidebar (not shown in screenshot).

image

EDIT: Pinning Pluto to version 0.19.27 did solve my problem with "safe preview". Hoping for a better solution so that I can take part of all the latest exciting development in the excellent Pluto.jl package soon again.

klwlevy avatar Oct 28 '23 11:10 klwlevy

@klwlevy It is probably unrelated to the "safe preview" modifying files. Please file your own issues rather than hijacking others, to reduce noise, and make it easier for developers to keep track. Thanks and welcome !

ederag avatar Oct 28 '23 16:10 ederag

I find it very unlikely that my problem is unrelated to the safe preview feature (but you are right, probably unrelated to this feature modifying files). I am sorry if you feel hijacked. I posted here as it was the only information I could find relating to safe preview (probably due to my limited experience). I'll make a new issue next time.

klwlevy avatar Oct 28 '23 21:10 klwlevy

@klwlevy Thanks for the report, fixed in #2689 !

fonsp avatar Oct 30 '23 15:10 fonsp