Skip to content

Conversation

@pkevan
Copy link

@pkevan pkevan commented Oct 14, 2025

What?

Pulled from: #72040, this allows the post lock to be configured based on the sync enabled entity.

Why?

In order to maintain the post lock functionality, we need to return when sync config is enabled during a real-time collaboration session where it is enabled for a post type.

How?

Checks that the post type has collaborative-editing enabled via post_type_supports and disabled the lock modal based on it.

Testing Instructions

  1. By default post and page post types have this enabled when the __experimentalEnableSync flag is set.
  2. Visit a post with more than 1 user present and note there is no pock lock modal for either user.
  3. Add remove_post_type_support( 'page', 'collaborative-editing' ); in code to disable the functionality.
  4. Visit a page with more than 1 user present and note that the second user to visit is presented with the post lock modal.

@pkevan pkevan added the [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration label Oct 14, 2025
@github-actions
Copy link

github-actions bot commented Oct 14, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: pkevan <paulkevan@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 14, 2025
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @pkevan! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@chriszarate chriszarate added the [Type] Experimental Experimental feature or API. label Oct 14, 2025
Co-authored-by: Chris Zarate <chris@zarate.org>
} = select( editorStore );
const { getPostType } = select( coreStore );
const { getPostType, getEntityConfig } = select( coreStore );
const entityName = getEditedPostAttribute( 'type' );
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use getCurrentPostType or something like that, that feels more straightforward

Copy link
Author

Choose a reason for hiding this comment

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

switched to getCurrentPostType in df239d1

@Mamaduka
Copy link
Member

The modal should already be overridable after #70586.

@pkevan
Copy link
Author

pkevan commented Oct 15, 2025

The modal should already be overridable after #70586.

It is, but the rest of the functionality around the lock is lost, and with the sync component we want to continue to keep this for now.

@Mamaduka
Copy link
Member

Thanks for the explanation, @pkevan!

@chriszarate chriszarate changed the title Allow post-locked-modal to be overridden when collaborative-editing is enabled Real-time collaboration: Allow post-locked-modal to be overridden when collaborative-editing is enabled Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants