Skip to content
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

Patterns > synced patterns > cannot unsync #66774

Open
Marc-pi opened this issue Nov 5, 2024 · 2 comments
Open

Patterns > synced patterns > cannot unsync #66774

Marc-pi opened this issue Nov 5, 2024 · 2 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.

Comments

@Marc-pi
Copy link

Marc-pi commented Nov 5, 2024

What problem does this address?

I can create my own custom patterns, but once those are created with the synced flag to ON, i cannot undo once submitted
the only way it to create a new instance of my pattern or detach it each time it is used

Just as a reminder, by default a new pattern is created with the flag set to ON

Tested with WP6.7RC3 + TT4 + GB19.5.1

Image

What is your proposed solution?

  • In the patterns list page, add a way to unsync in the 3 dots menu, if the pattern is not used somewhere or is just created

mysite.com/wp-admin/site-editor.php?categoryId=my-patterns&postType=wp_block

Image

  • once edited, permit to change the status
    Image
@Marc-pi Marc-pi added the [Type] Enhancement A suggestion for improvement. label Nov 5, 2024
@Mamaduka Mamaduka added the [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced label Nov 6, 2024
@talldan
Copy link
Contributor

talldan commented Nov 7, 2024

I think this has been discussed before in another issue or maybe it was when the sync status was first introduced, but I'll recap it here.

The challenge with being able to change the sync status is knowing what to do with existing instances of the patterns that have been inserted in various posts, pages, templates etc.

If the pattern's source were changed from 'Unsynced' to 'Synced' - any existing pattern instances would all be 'unsynced'. It might be ok to leave them as 'unsynced', it'd be similar to if the blocks were detached from the synced version of a pattern. Some users though might expect that all of these instanced are converted to 'Synced' pattern instances.

I think it's worse when the pattern's source is changed from 'Synced' to 'Unsynced'. The user might already have lots of synced instances inserted across their site. If the user changes the blocks in the pattern source, those synced instances will all update even though the source pattern has now been marked as 'unsynced'.

There might be ways to solve it. The two that come to mind are bulk conversions of blocks across a site, or alternatively linking synced patterns to only the 'synced' revisions of a pattern source.

In the patterns list page, add a way to unsync in the 3 dots menu, if the pattern is not used somewhere or is just created

I saw you mentioned this, so perhaps you'd already considered the above problem. At the moment there's no way to tell if a pattern is used, though it is another tracked feature (#60205), so once that's solved it might be possible!

Right now the quickest alternative seems to be using duplicate and then deleting the old pattern.

@Marc-pi
Copy link
Author

Marc-pi commented Nov 7, 2024

I saw you mentioned this, so perhaps you'd already considered the above problem.

exactly, in "if the pattern is not used somewhere or is just created"
for me changing the sync status is only doable if the pattern is unused yet in any content

At the moment there's no way to tell if a pattern is used, though it is another tracked feature (#60205), so once that's solved it might be possible!

good catch, did not see this issue, it is a prerequisite,

Right now the quickest alternative seems to be using duplicate and then deleting the old pattern.

yep
thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants