Skip to content
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: rewrite collab element reconciliation to fix z-index issues #4076

Merged
merged 7 commits into from
Oct 27, 2021

Conversation

dwelle
Copy link
Member

@dwelle dwelle commented Oct 21, 2021

fix #1376

This is a port from E+. The algo isn't super well written (there are several array reindexing), but it's fast enough — in worst cases (syncing ~1500+ elements) it's a couple of ms.

It works by annotating synced elements with their "parents" so that we know where in the array we should insert them.

Unclear how the algo will hold up in 3+ user rooms.

@vercel
Copy link

vercel bot commented Oct 21, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/C6XmK9yCUj4W3V2K3D2i4aNkWDFH
✅ Preview: https://excalidraw-git-rewritereconciler-excalidraw.vercel.app

Copy link
Member

@ad1992 ad1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and tests are super helpful 💯

src/excalidraw-app/collab/reconciliation.ts Show resolved Hide resolved
src/excalidraw-app/collab/reconciliation.ts Show resolved Hide resolved
src/tests/reconciliation.test.ts Show resolved Hide resolved
@dwelle dwelle merged commit d89fb33 into master Oct 27, 2021
@dwelle dwelle deleted the rewrite_reconciler branch October 27, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Z-index syncing broken
2 participants