newcat / baklavajs

Graph / node editor in the browser using VueJS
http://baklava.tech
MIT License
1.47k stars 107 forks source link

Undo/redo only partially working in the demo #397

Open stefnotch opened 4 months ago

stefnotch commented 4 months ago

I tried out the demo at https://codesandbox.io/s/baklavajs-v2-example-zpfkec?file=/src/App.vue , and edited the graph a little bit. I

And then I tried to undo those actions. (Ctrl+Z) However, only adding/removing nodes and connections seems to work. The values remain unchanged, and the same goes for the node names.

newcat commented 4 months ago

Yes, this is (kind of) intentional. Unfortunately, it is very difficult to determine, whether a user action changed the value of an interface or whether it was the result of e.g. the applyResults method or any other programmatic change. In the first case, we would want to add that to the history, in the second case we don't. However, node renaming is something that should be easy to track, so I am planning to add that to the history feature.