Live tracking / Track changes

Hi @carlo,

The “live-tracking” feature tracks any changes live other users are editing. In the versioning demo, we are interested in the differences to the last version. This is achieved by walking through Yjs’ CRDT model and transforming it into a ProseMirror document (while reading deleted changes as if they were still part of the document). It is currently not supported to edit while tracking deletions because we need to account for position changes.

The versioning approach really is just about tracking and rendering the differences between versions. For a google-docs-like “suggestion feature” you don’t need the versioning approach. I would implement “suggestions” using decorations and relative positions. Deletions and Insertions would be represented differently:

Deletions

Deletions would simply be ProseMirror-decorations on the document. You would basically mark a range as “suggested to delete” and use ProseMirrors decoration approach to highlight them in a specific color. You could easily allow a dialog that allows you to render the associated user and a button to accept the change. Quill has a similar concept that would allow you to do this.

Insertions

Insertions would be attributed changes to the document. For an added paragraph/text-node you would assign it an attribute that associated it to the user that created it. You could maintain suggested changes even in a separate Yjs document to handle permissions more strictly.

That said, implementing this feature is definitely possible in ShareDB as well by performing OT transformations. The OT approach is not foolproof either. This is just a really complicated feature. Unfortunately, there are no Open-Source solutions for this yet.

I would love to create a suggestions-feature for Quill or ProseMirror in exchange for funding. This is how I finance the Yjs project. Let me know if this is something that you & your company are interested in.