anaconda / nbpresent

next generation slides for Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
161 stars 23 forks source link

Undo functionality #74

Open bollwyvl opened 8 years ago

bollwyvl commented 8 years ago

A number of users have complained of not having undo.

Baobabjs supports undo, so it should be relatively easy to add undo, though redo is harder.

Some research is needed to determine the different user activities that would would be undoable steps, as the atomic changes are too small for a user to usefully use.

jbednar commented 8 years ago

This is sorely needed before I would entrust a real project to nbpresent. Undo without redo is better than nothing, but still a bit scary, as it's then easy to accidentally undo important work and not be able to get it back. And I don't suppose redo can just be treated as undoing an undo, i.e. to save the state before undoing so that it can be restored after some other change?

bollwyvl commented 8 years ago

Right, it's just not natively handled. Here's the (closed) issue. No new library has been forthcoming, but then, I haven't pushed on it either.

I can see a few ways to do it. The simplest is to indeed just have a series of snapshots, managed in another tree (or even something simpler), that I can whole-cloth drop onto the data-at-rest (what gets stored in the metadata).

Of course, I am not about to bite off global undo for the notebook, so it's certainly possible that one could undo to a state to where the notebook cells doesn't support what your slides expect. Luckily, for the most part, you probably just won't see some slide content, rather than anything breaking, as this is a state that a user could, themselves, get to.