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

[Query Loop]: Improve block variations in blocks with pattern setup flow #42533

Closed
Tracked by #41405
ntsekouras opened this issue Jul 19, 2022 · 1 comment
Closed
Tracked by #41405
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Block Variations Block variations, including introducing new variations and variations as a feature [Type] Bug An existing feature does not function as intended

Comments

@ntsekouras
Copy link
Contributor

ntsekouras commented Jul 19, 2022

Description

Currently in Query Loop and Template Parts we use the pattern setup flow, where a user can choose and insert directly a semantic pattern or some default block variation(scope: block).

Right now we have only one variation that is exposed to the inserter(Posts List), but that is subject to change with this issue. The problem here is that patterns and the scope block variations have different attributes and this results to override the Posts List variation attributes.

The problem is for any block that uses pattern setup flow like Template Part, but is not visible there because that block's variations only contain the area attribute which is also the one used in calculating the active variation(in isActive function).

We need to find a good way to preserve some important attributes(or part of them if is an object like query) and in general make sure that these preserved attributes do no affect the presentation/design.

This also applies to the replace with pattern flow.

Should we remove Posts List variation for now? It seems it just adds unnecessary confusion right now.

Related: #32268

Step-by-step reproduction instructions

  1. In post editor insert a Posts List variation
  2. Select any default block variation or a pattern(patterns usually don't contain sticky: 'exclude', like Posts List do)
  3. Observe that the sticky option is not set to exclude like we declare here: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/query/variations.js#L51
@ntsekouras ntsekouras added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block [Feature] Block Variations Block variations, including introducing new variations and variations as a feature labels Jul 19, 2022
@ntsekouras
Copy link
Contributor Author

It seems the remaining part of this issue can be addressed in #32268.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Block Variations Block variations, including introducing new variations and variations as a feature [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant