Skip to content

Add collaborative editing to WordPress documents plugin#52

Merged
erseco merged 2 commits intomainfrom
claude/collaborative-documents-editing-018pU6irwZHMtBHhGgMR9epe
Nov 28, 2025
Merged

Add collaborative editing to WordPress documents plugin#52
erseco merged 2 commits intomainfrom
claude/collaborative-documents-editing-018pU6irwZHMtBHhGgMR9epe

Conversation

@erseco
Copy link
Copy Markdown
Collaborator

@erseco erseco commented Nov 27, 2025

Implement real-time collaborative editing for rich text fields using TipTap editor with Yjs synchronization via WebRTC. Features include:

  • New settings in Documentate configuration for enabling collaborative mode
  • Configurable WebRTC signaling server (defaults to public Yjs server)
  • TipTap editor with full formatting toolbar (bold, italic, underline, lists, alignment, links, undo/redo)
  • Full table support (insert, add/delete rows/columns, merge/split cells)
  • Real-time cursor presence showing other users editing
  • Connection status indicator showing sync state
  • Graceful fallback to TinyMCE when collaborative mode is disabled
  • All dependencies loaded via CDN (esm.sh) - no server installation required

Implement real-time collaborative editing for rich text fields using TipTap
editor with Yjs synchronization via WebRTC. Features include:

- New settings in Documentate configuration for enabling collaborative mode
- Configurable WebRTC signaling server (defaults to public Yjs server)
- TipTap editor with full formatting toolbar (bold, italic, underline, lists,
  alignment, links, undo/redo)
- Full table support (insert, add/delete rows/columns, merge/split cells)
- Real-time cursor presence showing other users editing
- Connection status indicator showing sync state
- Graceful fallback to TinyMCE when collaborative mode is disabled
- All dependencies loaded via CDN (esm.sh) - no server installation required
The is_collaborative_editing_enabled() method now reads directly from
WordPress options instead of depending on the Documentate_Admin class,
which may not be loaded yet when meta boxes are rendered.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +465 to +468
const config = window.documentateCollaborative || {};
const editorId = textarea.id || `editor-${Date.now()}`;
const roomName = `documentate-${config.postId || 0}-${editorId}`;
const signalingServer = config.signalingServer || 'wss://signaling.yjs.dev';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid sharing Yjs room between unsaved documents

On admin/js/documentate-collaborative-editor.js the room name is built as documentate-${config.postId || 0}-${editorId}, so on post-new.php where postId is 0 every unsaved document uses the same Yjs room for each meta textarea. Two different authors creating new documents will therefore edit the same collaborative buffer, seeing each other’s cursors and overwriting each other’s content before a post ID exists. Consider incorporating a per-draft identifier (e.g., wp.data postId once assigned or a UUID) into the room name so new drafts don’t cross-contaminate.

Useful? React with 👍 / 👎.

@erseco erseco merged commit 25e7370 into main Nov 28, 2025
4 checks passed
@erseco erseco deleted the claude/collaborative-documents-editing-018pU6irwZHMtBHhGgMR9epe branch November 30, 2025 18:28
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.

2 participants