-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
In the current version b484ff2 undo is implemented on GUI side. Whenever the user insert, deletes or changes items new undo commands are created. However, there are no undo commands created on updates from the backend side.
This currently puts the backend under the restriction that it may not interfere with updates, e.g. create or delete objects on its own on the first level or change position, #inputs of existing objects. Otherwise the history will corrupt.
[Since there is no undo for created objects, they may collide with items that may be moved under it with an undo command created before the insertion]
I see two alternative solutions here:
- Alternative A: Move the undo stack into the backend. We would push the actions to the backend (e.g. as changes in metadata instead of lambdas). Then the backend would handle the complete history, also adding undo commands from internal changes. Also this seems to be the best option for a multi-user environment, if we ever want to go there, since both see the same stack.
- Alternative B: Also create undo actions on updates from the backend on GUI side, to keep the history consistent. This has the advantage, that the current infrastructure can stay. However, currently the GUI has not enough information to do so. It is related to the issue, that updates are reported back:
[Let's say the user moved an object from X to Y, which is nicely reported to the backend. The backend reports back the change and an undo action is created, that is all fine. The problem starts, when the user executes the undo action. The undo action executes and moves object from Y back to X. It also reports the backend that the object is now on X. The back reports, however a while later and that is the problem here, that the object is now at position X. Now the GUI has no other option to create another undo action, because it doesn't know whether this change came from him or the backend. (Imagine the situation the backend rejected the change.) Creating an undo action at this point destroys the redo action (since there is only a linear history of changes). This makes the whole undo system pointless, as the user can never go back to the original state, where the object was at position Y.]
Metadata
Metadata
Assignees
Labels
No labels