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

Don't expose pattern shuffle feature when content has been edited #62288

Open
fabiankaegy opened this issue Jun 4, 2024 · 9 comments
Open

Don't expose pattern shuffle feature when content has been edited #62288

fabiankaegy opened this issue Jun 4, 2024 · 9 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@fabiankaegy
Copy link
Member

WordPress 6.6 introduces a new feature that allows users to hit a "Shuffle" button in the toolbar of any inserted pattern. This shuffle button then replaces the entire pattern with other patterns that are in the same category.

This is a really cool and powerful feature because it makes it easy for someone to cycle though their options and find what they want to use.

But the feature has one large problem as it stands today in Gutenberg 18.5 RC1. The shuffle button doesn't just exist for newly inserted patterns before they are modified but it shows for any patterns on the page.

When a user clicks on the shuffle button after they have already entered/modified any of the content in the pattern, their content just gets replaced/overwritten with the default content stored in the pattern.

This is a very destructive action that should be prevented at all cost.


From my perspective, there are a few options we should look at before we ship WordPress 6.6:

  1. Find a way to only show the shuffle button while patterns are untouched (have no modifications)
  2. Allow theme authors / patter authors to opt out of the shuffle feature
  3. Remove shuffling from the 6.6 release until we have figured out a way to solve this problem
@fabiankaegy fabiankaegy added [Type] Bug An existing feature does not function as intended [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Jun 4, 2024
@fabiankaegy fabiankaegy changed the title Allow theme / pattern authors to opt out of the pattern "shuffle" feature. Don't expose pattern shuffle feature when content has been edited Jun 4, 2024
@ndiego
Copy link
Member

ndiego commented Jun 4, 2024

Here's a quick video of my experience with the new shuffle feature.

shuffle-patterns.mp4

TLDR:

  • I think it's cool as an exploratory feature. The user doesn't really know what they want, so they insert a pattern and then can shuffle through other options.
  • However, the feature falls apart a bit once you choose a pattern and start editing it. The "pattern" can still be shuffled. As Fabian mentions, I think this is a mistake.

In my testing, I also discovered a bug with synced patterns that are included in the same pattern category as the pattern being shuffled.

@colorful-tones
Copy link
Member

Pattern shuffling seems like a whimsical fun idea, and WP could always use a bit of those. It reminds me of the color palette randomizer. I'm not sure if it is still in the codebase and under Experiments? Perhaps shuffling and color randomizer could get a proposal for a separate plugin: Randomizer Experiments plugin or something? 🤔

@fabiankaegy
Copy link
Member Author

@WordPress/gutenberg-core @WordPress/gutenberg-design would love to get more thoughts on this as I think it is important for us to make a decision here asap in the 6.6 release cycle.

CC: @ellatrix @vcanales

@MaggieCabrera
Copy link
Contributor

Pattern shuffling seems like a whimsical fun idea, and WP could always use a bit of those. It reminds me of the color palette randomizer. I'm not sure if it is still in the codebase and under Experiments? Perhaps shuffling and color randomizer could get a proposal for a separate plugin: Randomizer Experiments plugin or something? 🤔

It is still an experiment

@fabiankaegy
Copy link
Member Author

@MaggieCabrera i was under the impression it is included in WordPress 6.6? Is that incorrect?

@MaggieCabrera
Copy link
Contributor

@MaggieCabrera i was under the impression it is included in WordPress 6.6? Is that incorrect?

I mean the color randomizer

@vcanales
Copy link
Member

vcanales commented Jun 5, 2024

I'm not sure if it is still in the codebase and under Experiments?

The Color Randomizer is still there as an experiment.

Perhaps shuffling and color randomizer could get a proposal for a separate plugin: Randomizer Experiments plugin or something? 🤔

I like this thought — Besides Canonical Block Plugins, we could have a Canonical Gutenberg Experiments Plugin :)

@annezazu
Copy link
Contributor

annezazu commented Jun 6, 2024

For context, there was some experimentation to keep content as you shuffled but it was technically complex and is something to explore for future releases. Between undo and overall revisions, this isn't fully destructive in that content is totally lost. I don't know the technical details of what it would take to only show the button if a pattern isn't edited but I don't think there's a clear path there.

Can we keep this open for more feedback and see how this goes in the beta period?

@jasmussen
Copy link
Contributor

I'd tend to agree with Anne, across undo and revisions (which are about to get more prominent), this is just another editing tool, and any changes you make you still have to confirm/save after the fact. Perhaps there's a different word than "shuffle" for this, because what it does is not random—maybe "Cycle patterns"?

Longer term, however, I would love to see any pattern transformations carry over information as best possible—paragraph to paragraph, heading to heading, image to image, and that should work for this as well.

These are not strong opinions.

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] Bug An existing feature does not function as intended
Projects
Status: 🗣️ In Discussion / Needs Decision
Development

No branches or pull requests

7 participants