feat: add real-time collaboration with Supabase Realtime#13
Merged
trmquang93 merged 3 commits intomainfrom Mar 18, 2026
Merged
Conversation
Implement host/guest collaboration with room-based sessions: - ShareModal for creating and joining rooms with 6-char codes - Host broadcasts document state; guests receive via Broadcast channel - Presence-based peer tracking with role management (editor/viewer) - Remote cursor rendering in world-space with name labels - Read-only enforcement for viewer role across all components - Mid-interaction safety: queues remote updates during drag operations - Deep linking support via #/editor?room=CODE - HostLeftModal for session-ended handling - User guide updated with collaboration documentation
…oins Supabase Presence fires leave+join on every track() call, so cursor updates were causing the host to re-send full state ~20x/sec. Each state payload stripped imageData, wiping guest images in a loop. - Deduplicate presence join handler with initializedPeersRef so state is only sent once per genuinely new peer - Preserve existing imageData in applyRemotePayload when incoming screens arrive without it
Slide-out right panel showing all room participants with names, colors, and roles. Accessible by clicking the peer avatars area in the TopBar. Host can change peer roles directly from the panel dropdown. - Expose selfDisplayName/selfColor from useCollaboration hook - Replace private _presenceState reads with stable refs - Auto-close panel on room disconnect - Guard keyboard shortcuts while panel is open
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
npm run lintandnpx vite build-- no errors