Replies: 3 comments 1 reply
-
If I understand you correctly, the solution with undo/redo in the |
Beta Was this translation helpful? Give feedback.
-
|
sounds good with the idea of moving single user undo/redo logic into the core and allowing to overwrite this undo/redo management by plugin (since we want |
Beta Was this translation helpful? Give feedback.
-
|
Implemented here #145 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem statement
Undo/redo stack is currently implemented within Collaboration Manager. It sounded logical at the start — manager is responsible for creation and transformation of the operations on the model. Undo is basically applying a reverse operation. However, this brings a major issue — the core functionality is being handled essentially by a plugin.
Proposed solution
To support undo/redo stack core only needs to know how to inverse an operation and then apply it back on the model. It doesn't need to know about remote operations, their transformation and so on.
I see two options:
a. Core would receive operations from the model and handle operations inversion and undo/redo stack
b. Collaboration Manager would receive operations from the model and handle their transformations and communication with the OT server
I believe the second option is better as changing the model events interface would require massive refactoring. Moreover, within the core we don't need to create an operation entity, it only needs to be able to store undo stack, inverse the update and apply it back.
In both cases, when undo operation is applied on the model, Collaboration Manager would just receive a regular model update and create a new operation.
Let's discuss
Beta Was this translation helpful? Give feedback.
All reactions