Determine type of update in the panel update method

I’m running into a case where I’d really need to support undo or redo OR show the history of events. Because I’m writing to pluginData there’s things that can easily break when the user uses undo or redo.

I might be able to minimize the issue if I can get and display the history events.

For example, I’d like to produce a history panel because right now if the user undos a few times they might revert from important changes.

Basically, I want to do this:

History panel:

Create rectangle
Resize rectangle
Change border
Group
Property change description in my plugin ← important
Property change description in my plugin ← important
Move group
Move group
Move group
Move group
Move group
Move group
Add rectangle
Change border

If the user undoes a bunch of times, in the example, let’s say he is undoing his design work, he might accidentally undo the plugin work as I have done many times.

I can see two feature requests.

  • The full history API
  • A smaller one that simply provides and array of history descriptions and their index so I can provide a basic history panel using the update method and then warn users if they are undoing the plugin changes they just made.

Even, more basic, an option to display notifications of what is being undone or redone when you use undo or redo.

I understand that it might not be possible in live editing mode. In a full API it could be a property and generate an error if called. In a basic API getting the changes shouldn’t affect anything. In fact it could have an additional property with the user name, “Bob resized rectangle”.