-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Block Library - Query Loop]: Update posts list variation #43284
Conversation
Size Change: -2 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Sounds good to me! It's a little tricky to test, can you provide some screenshots? |
Thanks for the feedback!
Hm.. that's a separate issue and I'm looking into it now..
That's a different algorithm(before @jasmussen what's this PR essentially will do is change the name of Query Loop to Posts Lists, if the postType is What do you all think? |
Yes, it does seem curious for me that the name of the block changes, this has already confused me a few times in the Global Styles → Blocks, where the Query Title is duplicated under a variety of names. I understand the challenge, would appreciate Jay's thoughts as well. |
I think the relationship between Query Loop and its variations should be totally opaque to the user. Posts List and Query Loop should feel like totally separate blocks. So changing a Query Loop to a variation when you interact with the post type dropdown doesn't feel like the right direction to me. |
What?
Related: #40941, #42533
Right now we have only one variation that is exposed to the inserter(Posts List) for Query Loop block. This block uses patterns and scope block variations and we face a couple of problems here:
Posts List
variation the block cannot detect if has an active variation, changing its display name to Query Loop.This PR handles for now only the second part by adding an
isActive
prop when the postType ispost
. I think differentiating variations based only theirpostType
is enough for now, because many query attributes can change(order, orderBy, etc..) which shouldn't affect the main description of the block. Later on we need to explore how to conditionally hide/add controls declaratively and with that we should revisit theisActive
conditions.Testing instructions