Description
TipTap has a really nice Y.js integration. @sbazerque and I discussed using this for wiki block collaboration in synchronous contexts. The main motivation is that Y.js is optimized for real-time collaborative text editing while HHS CRDTs are not. Currently wiki block editing is last write wins.
One possible implementation would give wiki block authors the ability to delegate editing abilities to currently connected peers via Y.js. Wiki block authors would still retain the authority to actually persist the changes coming from Y.js. In the case where a wiki block has multiple authors, they'd still need to be careful because the HHS persistence would still be last write wins.
In a simple UI for this implementation, wiki block authors would just automatically persist updates, but another possibility would be to implement a kind of "collaborative suggestion mode" that could be turned on to enable the Y.js collaboration and disabled by either accepting or rejecting the suggested changes.
To do:
- Test out current Yjs draft work (as of Sept. 23, 2022), peer review to understand how we can avoid race conditions between Yjs and HHS
- Specify when Yjs collaboration should be enabled/disabled and the mechanism to handle this
- maybe a manual UI for block authors to toggle "collaborative mode"?
- Basic mechanism to prevent Yjs wiki collaborators from spoofing identity #19
- Make HHS collaborator info visible and verifiable from the Yjs collaborative cursor UI