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

👀 Safe preview: Open notebooks without running #2563

Merged
merged 56 commits into from
Oct 22, 2023
Merged

👀 Safe preview: Open notebooks without running #2563

merged 56 commits into from
Oct 22, 2023

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented May 15, 2023

After this PR, you can open a notebook without running it! You can even make edits (change code, add/delete cells) that are saved to the file.

When you Shift+Enter, cells still won't run: you need to click the big "Start notebook", and then it will be as if you just started the notebook in old Pluto: Pkg initializes and all cells will run.

Schermopname.2023-09-19.om.15.27.12.mov

Implement #259

TODO

  • Open notebook without running
  • Also disable Pkg instantiate/etc without permission
  • New Pkg popup message
  • Check all Dynamic.jl entry points
  • See changes when editing md-only cells
  • Make it more clear that you need to run the notebook
  • Move warning when opening from url to the run button
  • Opening a URL, then closing the session, then starting the session does not show a warning.
  • Configuration to disable warning (for binder etc)
  • Should the notebook stay in your session? Maybe reword the "shutdown?" prompt in the main menu.
    • Keep the prompt because you are used to press enter.
  • What happens when you add/remove packages while waiting for permission?
    • Adding packages works
    • If you add Pkg.activate() statically, then start the notebook, you immediately get a "Restart required"
    • If you remove a package import statically, then start the notebook, you immediately get a "Restart recommended" message
  • Remove old config run_notebook_on_load or rename to run_all_cells_on_start or sth
  • Tests
  • Fix existing tests
  • Disable scripts (and more? maybe sanitize HTML)
  • Switch to DOMPurify: Fix #233 mozilla/sanitizer-polyfill#234 (comment)
  • "Start notebook in background" no longer working
  • Test notebookupload
  • Test modifying in Safe mode
  • Test fallback samples
  • Test "start notebook in background" for risky source
  • What should happen to the "run in background" buttons?
  • Make cells with hidden code more visible.

FUTURE TODO

  • From URL: offer to run with Binder/JuliaHub instead?
  • Review: walk through all non-md cells one by one?
  • Try to preserve the cell order that was used in the saved file?

@fonsp fonsp added enhancement New feature or request frontend Concerning the HTML editor backend Concerning the julia server and runtime wide audience This affects a wide audience of Pluto users and future Pluto users labels May 15, 2023
@github-actions
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="wait-to-run")
julia> using Pluto

@fonsp
Copy link
Owner Author

fonsp commented May 18, 2023

Opening a notebook from a URL:

Schermopname.2023-05-18.om.14.05.32.mov

@BioTurboNick
Copy link
Contributor

This feature looks great! A little encouragement to finish it, and also offer help if possible :-)

@fonsp fonsp marked this pull request as draft September 18, 2023 18:43
@fonsp fonsp marked this pull request as ready for review October 22, 2023 12:39
@fonsp fonsp linked an issue Oct 22, 2023 that may be closed by this pull request
@fonsp fonsp merged commit 5df9cc5 into main Oct 22, 2023
16 checks passed
@fonsp fonsp deleted the wait-to-run branch October 22, 2023 13:41
@fonsp fonsp changed the title 👀 Open notebooks without running 👀 Safe preview: Open notebooks without running Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime enhancement New feature or request frontend Concerning the HTML editor wide audience This affects a wide audience of Pluto users and future Pluto users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delay running the notebook when it starts
2 participants