-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix nested editors in collab #2781
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thx @trueadm, just tested on https://lexical-playground-git-fix-collab-nested-editors-fbopensource.vercel.app/split/index.html?isCollab=true The sticky notes content are synced, but the equation do not sync for me. |
The image caption is also synced. These changes looks to correctly address the nested editor case, but the equation editor is another case that does not use the nested editor. A general question for me is "What are the requirements to make a Decorator node syncable?" |
Decorator nodes should sync automatically. If you use the Lexical primitive values, it should "just work". I'll take a look at the equation editor, but it's likely a regression in that plugin somewhere along the lines too. Update: was a simple bug in the equation node logic, it wasn't updating the React state with the value on the node. Added the fix to the same PR. |
Do we have any tests around this? Might be nice to add that so this doesn't regress again. |
Thx. I will dig more into the code to better understand the logic and hopefully come with a PR with some documentation on that.
Equation are now synced in the playground. Thx. |
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.
Looks great, completely missed that we've used main
as collab indicator for plugins
|
||
const [editor] = useLexicalComposerContext(); | ||
|
||
const {yjsDocMap} = context; | ||
context.isCollabActive = true; |
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.
Should this have useEffect
to unset isCollabActive
on onmount?
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. Mind taking over this PR? I won’t be able to work on it again till I’m back in a few weeks.
67c644e
to
9024838
Compare
9024838
to
f30d945
Compare
f30d945
to
255e0ee
Compare
255e0ee
to
0359ef2
Compare
0359ef2
to
82e2f64
Compare
* Fix nested editors in collab * Better fix * Better fix * Fix equations * Reset is-collab flag when root-level collab plugin unmounts Co-authored-by: fantactuka <fantactuka@gmail.com>
Fixes #2779. We now use a boolean flag to determine if collab is ready and active.