sillydan1/graphedit

Undo does not respect closed viewmodels

Closed this issue · 3 comments

Description

The undo tree will keep remembering stuff that has happened in closed files.

Reproduction Steps

  • Open a model file
  • Do some edits
  • Save the model
  • Close the model
  • Inspect the undo tree. There are still steps.

Suggested Solution

We need to detect that when a model is being closed, that all associated undo-tree nodes are removed as well.

Another solution would be to re-open and focus on the model that has been undone?

The undo system generally need a better API / overhaul.

It should be diff-based as it is a great tool in the toolbelt

I think that the way forward is to revamp the undo system:

  • It should be a tree, not a stack
  • All undoables should be diff-based
  • Perhaps an inspector in the std plugin (not decided yet)
  • Remove the "Observable undo tree" attempt

With this refactor, We should consider:

  • Should the undoable be autodetected? or
  • Should the tools add the undoables (as they are now) or
  • Should we have a hybrid solution?