S
Speakly.PRO

Real-time Collaboration

Co-edit lessons in real-time with other teachers using Y.js-powered collaboration.

The Lex Editor supports real-time collaborative editing, allowing multiple teachers to work on the same lesson simultaneously. Changes sync instantly, and you can see exactly where others are editing.

How Collaboration Works

The collaboration system is built on Y.js, a conflict-free replicated data type (CRDT) framework. This means:

  • All changes merge automatically. There are no merge conflicts -- simultaneous edits are resolved deterministically.
  • Changes sync instantly. When one teacher types a word, it appears on the other teacher's screen within milliseconds.
  • Offline resilience. If a teacher loses connection, their changes sync when they reconnect.

The collaboration server runs on a WebSocket connection, separate from the main application server.

Starting a Collaboration Session

Open the Lesson

Navigate to the lesson you want to co-edit. The editor loads with collaboration enabled by default.

Invite Collaborators

Share the lesson URL with other teachers who have access to the course. When they open the same lesson, the collaboration session begins automatically.

See Who Is Editing

The collaboration panel in the sidebar (or top-right corner) shows:

  • Names and avatars of all active editors
  • Colored indicators for each person

Live Cursors

Each collaborator has a colored cursor visible to all other editors. As they type, you can see their cursor position and the text they are entering in real time.

  • Each person gets a unique color
  • The cursor shows the collaborator's name
  • Selections are highlighted in the collaborator's color

This gives you full awareness of who is editing what, preventing two people from accidentally working on the same section.

Conflict Resolution

Because Y.js uses CRDTs, conflicts are resolved automatically:

  • If two people type at the same position simultaneously, both edits are preserved in document order
  • If one person deletes text while another edits it, the deletion takes precedence
  • Block-level changes (reordering, deleting blocks) are handled consistently across all clients

You never need to manually resolve conflicts. The system guarantees that all editors see the same final state.

Presence and Awareness

Beyond cursors, the collaboration system provides awareness features:

  • Online status -- see who is currently viewing the lesson
  • Activity indicators -- see who is actively typing vs. idle
  • Chat -- a separate real-time chat channel is available for communicating with collaborators during editing

Frequently Asked Questions

How many people can collaborate at once?

There is no hard limit, but the experience is best with 2-4 editors working simultaneously. More editors increase the visual complexity of tracking cursors and changes.

Can students see my edits in real time?

Students viewing a published lesson see the last saved version, not live edits. Collaboration is between teachers only.

What happens if I close my browser during collaboration?

Your changes are saved. When you reopen the lesson, you will see the latest state including changes made by other collaborators while you were away.

Can I see the version history of collaborative edits?

Yes. The version history shows all saved versions with timestamps and editor names. You can preview any version and restore it if needed.