read-only & fiddle-only notebooks ?

I’m often wanting to work in a mode where my changes to a notebook would not be saved in that notebook.

For example:

  • testing a hypothesis I have on something, not realizing that I’m working on a notebook that’s not mine (in particular in a team).
  • using a notebook that I developed as a generic tool for datasets, and fiddling with parameters and inputs to adjust them on my current dataset’s peculiarities.
  • using a notebook that has an example dataset, and replacing it with my own data.

In these cases it might be useful to be able to “lock” a notebook in a read-only state, so that my changes to it are either just local (as when I work on someone else’s notebook not in my team), or at least force me to remember to do a fork.

I know I can always roll-back my changes, but it feels like the notebook is in a dirty state in between. Also when working in a team, it might create problems.

(Of course there’s a solution which is to fork before you start anything. But it’s not as comfortable as what happens on other people’s notebooks, where you can fiddle with the contents without consequence.)

5 Likes

You can click on “View History” in the menu in the upper right and then fiddle with the locked version there or you can navigate to the latest “version-pinned” URL https://observablehq.com/@:user/:notebook@XXXX.

A few related feature requests come to mind:

  • Could we get a keyboard shortcut for entering the history mode?
  • I wish it were easier to get the latest version number. Having to reopen the notebook in history mode to get the version number can be painful for notebooks with a lot of computationally-heavy cells (see also: Feature requests: diffs / history in safe mode). Previously I could just click on the link to the https://api.observablehq.com/@:user/:notebook.js?v=3 file, but ever since it’s been removed I’ve had to mess around with the notebook URL to get to the .js?v=3 file instead. Maybe htttps://observablehq.com/@:user/:notebook@latest could redirect to the latest version-pinned URL?
3 Likes

This may also apply to trashed notebooks: A notebook in the trash can only be viewed and edited after I restore it, even though there are no technical reasons for this limitation (I can remove the overlay and start editing, although saving produces an error message).

I’d imagine a trashed notebook should be viewable inside a sandbox, just like notebooks authored by others.

There’s definitely some tension between notebook-as-in-progress-publishable-document vs. notebook-as-playground.

I also have some notebooks where just fiddling subjectively feels lower-friction than forking or making a new notebook and importing relevant parts.

I’m not sure a no-saved-changes mode is the right solution though. It’s yet one more feature for newcomers to learn about and the platform to maintain, and the fork-fiddle-trash workaround isn’t really too onerous.

Another workaround is to open the notebook in a different (not logged in) browser or in an “incognito” window.