Skip to content

Feat:Implement lightweight collaboration session (Phase 1)#855

Open
Gautam-Bharadwaj wants to merge 3 commits intodrawdb-io:mainfrom
Gautam-Bharadwaj:feat/collaboration-session
Open

Feat:Implement lightweight collaboration session (Phase 1)#855
Gautam-Bharadwaj wants to merge 3 commits intodrawdb-io:mainfrom
Gautam-Bharadwaj:feat/collaboration-session

Conversation

@Gautam-Bharadwaj
Copy link

** Overview**

This PR implements Phase 1 of the "Collaboration Session" feature as discussed in issue #813. It introduces a manual "Push/Pull" synchronization mechanism, allowing multiple users to collaborate on the same diagram via a shared session ID without the complexity of real-time CRDTs or WebSockets.

** Motivation**

Currently, users are required to manually export and import JSON files to collaborate with others. This manual session-based sync provides a significant UX improvement by allowing teams to quickly push their changes to a cloud store and pull updates from their collaborators with a single click.

** Key Features**

  • Session Management: Users can "Create" a new session which generates a unique ID and a shareable link.
  • Manual Sync:
    • Push My Changes: Overwrites the cloud-hosted diagram with the local diagram state.
    • Pull Latest: Fetches the remote diagram and hydrates the current workspace (includes a confirmation prompt to prevent data loss).
  • Deep Linking: Shared links (e.g., ?session=<ID>) automatically fetch and load the diagram on application startup.
  • Responsive UI: Integrated a "Collab" dashboard into the editor header using the Semi-UI design system.

** Technical Implementation**

  1. Sync Engine (src/api/collaboration.js): A lightweight API service that interacts with a JSON blob store for persistence.
  2. Collaboration Modal: A new component (Collaboration.jsx) that manages UI states for session creation, joining, and syncing.
  3. Workspace Hydration: Updated Workspace.jsx to support deep-linking via query parameters, bypasses local storage when a session is active.
  4. State Integration: Tight integration with DiagramContext ensures that syncing updates tables, relationships, notes, and areas in one atomic operation.

** Steps to Test**

  1. Open the editor and click the "Collab" button in the header.
  2. Click "Create Session" to generate a session link.
  3. Open the link in a separate tab or browser.
  4. Edit in Window A: Move a table or add a note, then click "Push My Changes".
  5. Update in Window B: Click "Pull Latest". Confirm the prompt.
  6. The diagram in Window B should now match Window A.

Fixes #813

Gautam-Bharadwaj and others added 3 commits January 29, 2026 00:19
- Added sanitizeSQL utility to strip comments and unsupported meta-commands (SET, SELECT, CREATE EXTENSION)
- Integrated sanitization in Import Modal to fix crashes with pg_dump files
- Preserved strings containing comment-like characters
@vercel
Copy link

vercel bot commented Jan 30, 2026

@Gautam-Bharadwaj is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Feature: Session-Based Collaboration (Phase 1 MVP — manual push/pull session)

1 participant