-
-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: feat: comments #1376
base: feature/liveblocks-v2
Are you sure you want to change the base?
wip: feat: comments #1376
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@dmonad I'm working on a POC for comments here. You can see:
Two questions about this:
|
Even that is edgy… There are several parts of Yjs that could be exploited to sneak-in changes, even if you check
That is actually a more realistic approach. You could check each struct / delete whether it applies changes to only the children of a certain other type. This approach is also more memory efficient (no need to fork a document). However, you need to understand the Yjs internals to pull this off. Ideally, comments are stored in a separate Yjs document with different permissions. If that is not possible, I recommend that read-only users are only able to add comments through an HTTP request (no manipulations on the Yjs document). |
I agree, read-only users should probably always use an HTTP request. However, for other users (with write access), I think we should also be able to validate changes. For example, a user should only be able to edit comments they created themselves. So I'm interested if / how we can validate this. Can also discuss this over a call, might be easier :) |
|
||
renderHTML({ HTMLAttributes }: { HTMLAttributes: Record<string, any> }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on if you want to support copy-paste of comments, maybe parseHTML?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
I think copy paste will need to be tested extensively :) for example, you could paste a comment that's not in the store, etc
First POC of native comments in BlockNote.
Providers
YjsThreadStore
We store thread / comment information directly in yjs so it can be easily integrate with existing sync / storage mechanisms. The downside of this is that comments require a more advanced permission model than text documents; so we need to provide a workaround for this and clearly explain the pros / cons. Of course, users can always implement their own (e.g.: REST-based) ThreadStore with more advanced permissions built-in.
TODO:
LiveBlocks
The UI Components are roughly based on the LiveBlocks open source components. LiveBlocks users will have two different ways to use LiveBlocks:
TODO:
TipTap
We can probably integrate directly with the TiptapCollabProvider
TODO:
UX TODOs
Misc
TODO: