-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Real-time Collaboration: Add edit mode #73898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: wpvip/rtc-plugin
Are you sure you want to change the base?
Conversation
…istence for collaborative editing * Implement CRDT persistence * Add tests for SyncManager and CRDT persistence
…cing post meta * Add support for syncing post meta * Sync all meta by default * Add test for non-single meta * Add CRDT persistence meta key to disallowed set
…port for collaborative editing
…rridden when collaborative-editing is enabled
…ynthetic" templates
…asCover> slot fills --------- Co-authored-by: Chris Zarate <[email protected]>
…th cursor hint) * Include quill-delta with fast-diff replacement * Update generated docs * Remove "mixed operations" tests because they have hardcoded order assumptions about results * Reformat code in quill-delta * Revert "Reformat code in quill-delta" This reverts commit cc304ee. * Run 'lint:js:fix' * Replace non-type-safe comparisons with type-safe comparisons * Fix type errors in Delta * Revert type change in mergeCrdtBlocks() * Only export Delta from sync package * Add diff types to sync package * Fix remaining != vs !== issue * Add docs comment for Delta export * Add README to explain quill-delta library fork --------- Co-authored-by: chriszarate <[email protected]>
…ting before proceeding * Check for the current attribute existing before proceeding * Add a test for the new check added
* Real-time collaboration: Improve type safety with YMapWrap * Strict type for type guard input
…tests * Real-time collaboration: Fix persisted document meta and add tests * Never sync a floating date * Explicit type on assignment Co-authored-by: Max Schmeling <[email protected]> --------- Co-authored-by: Max Schmeling <[email protected]>
* Real-time collaboration: Sync collections * Create markEntityAsSaved utility function * Improve comment
…ditor toolbar * Add CollaborationMode SlotFill for editor toolbar Creates a new SlotFill component similar to EditorPresence that allows plugins to inject collaboration mode indicators (like view/edit state) into the editor toolbar. The slot renders as the first element in editor-document-tools__left, making collaboration status immediately visible to users. This follows the same pattern as EditorPresence and is exported as a private API for use by collaboration plugins. * Use Symbol for CollaborationMode slot name Changes the CollaborationMode SlotFill to use a Symbol instead of a string for the slot name. This makes the slot truly private by ensuring only code with a reference to the exported Fill/Slot components can access it. String-based slot names can be accessed by anyone who knows the name. Using Symbol() prevents unauthorized usage and follows the pattern established in PR #67238. * hide CollaborationModeSlot in distraction-free mode
…nce is not supported * Real-time collaboration: Do not call saveRecord when persistence is not supported * Update unit tests * DRY up mocks
* Real-time collaboration: [pr-72407] Add UndoManager support for collaborative editing * Real-time collaboration: [pr-72437] Add Yjs awareness * Real-time collaboration: [no-pr] Add <EditorsPresence> SlotFill * Real-time collaboration: [no-pr] Add <BlockCanvasCover> and <VisualEditorOverlay> * Real-time collaboration: [no-pr] Only render presence UI container one time * Moved <EditorsPresence> component to editor-presence * Renamed <EditorsPresence> to <EditorPresence> * Convert <EditorPresence> file to tsx * Update EditorPresence Slot to only render one container * Add basic docs for <EditorPresence> * Update packages/editor/src/components/editor-presence/index.tsx Co-authored-by: Chris Zarate <[email protected]> * Update docs for <EditorPresence> * Make <EditorPresence> private --------- Co-authored-by: Chris Zarate <[email protected]> * Real-time collaboration: [no-pr] Refetch entity when it is saved by a peer * Real-time collaboration: [pr-72450] Add typings in core-data for @wordpress__blocks * Real-time collaboration: [no-pr] Replace fast-diff in quill-delta (with cursor hint) * Include quill-delta with fast-diff replacement * Update generated docs * Remove "mixed operations" tests because they have hardcoded order assumptions about results * Reformat code in quill-delta * Revert "Reformat code in quill-delta" This reverts commit cc304ee. * Run 'lint:js:fix' * Replace non-type-safe comparisons with type-safe comparisons * Fix type errors in Delta * Revert type change in mergeCrdtBlocks() * Only export Delta from sync package * Add diff types to sync package * Fix remaining != vs !== issue * Add docs comment for Delta export * Add README to explain quill-delta library fork --------- Co-authored-by: chriszarate <[email protected]> * Block all saves for user id 4 as a test for viewing * Port the mode picker to GB * Get the selector dropdown to work * Use the new mode from within GB * Actually export the reducer * Restrict view mode to only when the experiment is enabled * Prettify the code * Restrict the post title, and code-editor * Add a guard in place * Real-time collaboration: [pr-72407] Add UndoManager support for collaborative editing * Real-time collaboration: [pr-72437] Add Yjs awareness * Real-time collaboration: [no-pr] Add <EditorsPresence> SlotFill * Real-time collaboration: [no-pr] Add <BlockCanvasCover> and <VisualEditorOverlay> * Real-time collaboration: [no-pr] Only render presence UI container one time * Moved <EditorsPresence> component to editor-presence * Renamed <EditorsPresence> to <EditorPresence> * Convert <EditorPresence> file to tsx * Update EditorPresence Slot to only render one container * Add basic docs for <EditorPresence> * Update packages/editor/src/components/editor-presence/index.tsx Co-authored-by: Chris Zarate <[email protected]> * Update docs for <EditorPresence> * Make <EditorPresence> private --------- Co-authored-by: Chris Zarate <[email protected]> * Real-time collaboration: [no-pr] Refetch entity when it is saved by a peer * Real-time collaboration: [no-pr] Sync collections * Real-time collaboration: Sync collections * Create markEntityAsSaved utility function * Improve comment * Real-time collaboration: [no-pr] Do not call saveRecord when persistence is not supported * Real-time collaboration: Do not call saveRecord when persistence is not supported * Update unit tests * DRY up mocks * Remove the unnecessary support changes * remove tsconfig changes * Remove extra typings field * revert unnecessary change * Combine the selectors as per CR * Fix the linting * Revert some unnecessary changes * Move collaborator mode to editor store, and remove the temporary block on core-data actions * Fix the linting issues * Tweak the changes --------- Co-authored-by: chriszarate <[email protected]> Co-authored-by: Max Schmeling <[email protected]> Co-authored-by: Chris Zarate <[email protected]> Co-authored-by: Alec Geatches <[email protected]>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +309 B (+0.01%) Total Size: 2.13 MB
ℹ️ View Unchanged
|
13a111e to
240db4b
Compare
240db4b to
d4c289a
Compare
What?
This change is meant to add support for the edit mode feature, powered by "edit" collaborate mode introduced in #73474.
Why?
The core feature will reside in Gutenberg to allow for it work in the best possible manner.
How?
There are two new fields introduced under the
rtckey in post meta:enforcedMode: This'd be the mode that's enforced based on a peer's current component location. At the moment, this'd just becodeEditor.enforcedModeOwner: This'd be the owner of the mode above. It's just the id of the current user.When the code editor is entered by a peer, the mode and the owner is set. This is synced to the other peers, which in turn causes their collaborate mode to be changed to view. Once the peer in the code editor exits, this mode/owner is cleared and the collaborate mode is returned back to edit.
The collaborate mode had to be moved back to the core-data store due to the fact that, it's not possible to use it within core-data from the editor package. This circular dependency cannot be worked around, and using the store as a string isn't good practice based on the eslint rules in GB.
Testing Instructions
Screenshots or screencast
Area.mp4