Skip to content

fix: rewrite collab element reconciliation to fix z-index issues#4076

Merged
dwelle merged 7 commits into
masterfrom
rewrite_reconciler
Oct 27, 2021
Merged

fix: rewrite collab element reconciliation to fix z-index issues#4076
dwelle merged 7 commits into
masterfrom
rewrite_reconciler

Conversation

@dwelle
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread src/excalidraw-app/collab/CollabWrapper.tsx Outdated
Comment thread src/excalidraw-app/collab/reconciliation.ts Outdated
Comment thread src/excalidraw-app/collab/reconciliation.ts
Copy link
Copy Markdown
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 💯

Comment thread src/excalidraw-app/collab/reconciliation.ts
Comment thread src/excalidraw-app/collab/reconciliation.ts
Comment thread src/tests/reconciliation.test.ts
@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