Good idea. I proposed a small change here: Observable. It moves the history from an external cell to an internal property. Currently, the API to access the history and move in it is by hand and does not dispatch events. The browser History interface might be a good source of influence to design a full API to navigate in the input history
I incorporated both your suggestions. And now it is an importable with two versions.
v1: is @severo 's version, with .setValue() enabled.
v2: is @chrispahm 's version, with the redo and undo buttons as part of the viewof object
See updated:
(I’m marking this summary post as the current answer since I can’t mark both of yours as “solutions”.)
I’m not going to update them yet since I want to learn svg and d3 better first. But if anyone wants to, the framework and idea are covered in the notebooks here.