-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 block: Toolbar control revisions #25198
Comments
Order byI realize the "Order by" was added here: #24691 to the Inspector, but I thought it might work well in this popover. Now, I'm second guessing this one because it doesn't feel like an important setting required for the use of this block. Chances are, this particular setting won't get a lot of use as most people will prefer the default of "Newest to oldest". Filter by AuthorThe ability to filter by "Author" was added here: #25149. Regarding my comment above about Categories and Tags, should the Author option also hide depending on the template being used? For example, if I'm adding this block to a |
Hey @mapk! I don't have many answers myself yet, but here are some of my thoughts :) In the first design iteration I think we should probably change the Number of Pages
That seems right, probably with different wording, like Offset Categories & Tags
I would like to hear some thoughts from people more involved in FSE as well. Order by Filter by Author |
Also keep in mind that another |
That's right! I remember you mentioning this before. I'm on board with this.
Maybe. I think whatever we use for copy will need to be flexible enough that if the results only fill one page, it still makes sense. I'll add the "Needs copy" label to get some thoughts. Also cc-ing @mtias to get your input on this. We're iterating on the settings for the Query block and can use some feedback regarding this particular issue. |
Here's a mockup including some of these changes.
|
I received some recent feedback that has encouraged me to explore a basic Query block with all the settings, whether in the toolbar or sidebar, first. From there we can explore the variations that may hide certain settings, or show settings preconfigured (and possibly uneditable if inherited from template). There was also some thoughts on whether or not will have another iteration up today |
Hello! Popping in here from editorial. I like what you are doing here, you are making things much clearer, especially with the explaining text. I would perhaps change the "Show more than one page" toggle to "Show multiple pages." |
Thanks, @carolynannewells! I actually iterated a bit more earlier today and landed on, "Allow pagination of results" What do you think about that one? I'm totally willing to trust your expertise here! I've also made some adjustments as another iteration. This is isn't quite final. Just wanted to share my progress from today. Option 1 - Two setting buttons in toolbarNotes
Option 2 - Inline filter input fieldsRiffing off of the work in the new Link UI, I also wanted to share some explorations I did around the filters. Hat tip to @MichaelArestad for suggesting this. I pulled the filters out into their own icon buttons in the toolbar. When clicked, they open up just like the link UI does. I'm not confident about this direction, but thought it could spur more feedback. |
I think that "Allow pagination of results" works! :) |
Could "categories" and "tags" be dropdowns rather than inputs? |
I've been working through more iterations today.
Prototype |
Does it make sense to have the category and tag filters in the sidebar as well as in the toolbar? |
There are a few assumptions you could make instead of trying to squeeze things into the toolbar:
|
I think these explorations were important to visually work through all of this. You bring up a good point about cognitive load. The toolbar settings work well as dropdown select items, but when we add more form-like inputs whose input value isn't reflected in the toolbar, it gets a bit awkward. I'm going to push in the other direction (back to the sidebar) for some of this to share.
I was thinking this same thing too! Most likely, the Query block will be used with pagination, so making that the default sounds reasonable. |
For now it is, but this is the time and the issue where we will change this :). There have been some ongoing development efforts to enhance the functionality of the Having said that, I think it's great that there is not only design mock ups and iterations (that are definitely needed), but also feedback and suggestions! 💯 One thing we probably could do is to get some decisions about some of the current options and implement them. For example if there seems to be a consensus on where the |
Riffing off of @bph's comment above, here's a couple iterations of the Pagination icon toggle. Option 1 - PaginationWe can load the block with that setting "on" and highlighted. It would look like this: Option 2 - PaginationRather than a toggle, make use of the dropdown ability to switch the toolbar setting. |
Yes, that's how I had it in some of the early iterations.
That block would automatically be added if the Pagination is turned "on". |
I'm thinking about the amount of input fields involved with the Query block settings. I've been working around creative ways (see above iterations) to show these form fields without breaking from existing UI patterns, or incorporating future patterns that are in development (Link UI). For the most part, block toolbars include simple toggle switches (ie. Bold, Italic) and dropdown selections (ie. alignment) whose states are reflected in the toolbar itself. There are a few that include more advanced controls like the Link and Color settings, but these are rare. I'd like to include the more important settings in the toolbar, but because of the amount of form fields, I believe if we provide strong defaults, these settings could remain in the sidebar where most of the form fields for blocks tend to reside. Unless there is an above approach that is more desired. Settings overviewNotes
FeedbackI'd like to get some theme developer's feedback on this.
|
A few notes on that last iteration:
Critical & missing:
|
It includes them when "on" and excludes them when "off". They would show as sticky in the block and remain at the top. cc @ntsekouras for confirmation.
Good eye! I've been pulling and pushing settings back and forth between the toolbar and sidebar. If they reside in the sidebar, I'll make sure that happens.
I'm really unfamiliar with taxonomies, but are you imagining a dropdown that allows me to select between categories, tags, or taxonomies? Or just having them all lumped together? |
I'm imagining selectors similar to the ones we currently have for selecting tags. So not exactly dropdowns... Rather textfields with auto-complete functionality and a "dropdown selector" for lack of a better word once you start typing. This can work well for all taxonomies, allows selecting multiple items and is so compact that we could fit together Categories, Tags and any other custom taxonomies the post-type might have, we'll need 1 text-field/tag-selector per-taxonomy. |
The UI in the latest design iteration to choose what to filter + display is that of -creating-. I think this is too confusing and the UI should use -filtering- patterns to make it more immediately recognizable as to what these settings are for. Doing so would have an added benefit of a more simplified and concise interface and perhaps could lead to a way to have some / all of this in the toolbar. |
Haiii!!! Hope you all are well. I poked around some of the query block UI as it feels like it's within the realm of "Design Tools", which helps me better understand use cases. 🥇 First ideaFirst off, I fully recognize how complex something like this is. The combination of things is (theoretically) endless, compounded by the amount of categories, tags, custom taxonomies a user may have. (I've seen WP sites with literally 10,000+ tags). That being said... I think there may be a UI solution here - at least to handle the combinations. My mind jumps to a "Condition Builder" UI. This idea sparked from the following comments in the thread: @ntsekouras 🧬 Condition BuildersCondition builders are designed to handle this very thing. I may be biased as I've worked on a Condition Builder UI several years ago. It was, as you could imagine, wildly complex (as far as combinations of things goes). However, the nature of a condition builder was able to it. A bonus is that folks may already be familiar with Condition Builder UIs, especially if they have experience in the analytics or marketing world where Condition Builders are standard (e.g. Email marketing platforms) It is worth noting that Condition Builders are more of an "intermediate" feeling UI. Not as friendly as a couple of checkboxes. However, I think the Query block is "intermediate" by nature. Much more so compared to a "Paragraph", 🧠 Powerful logicIn addition to adding/chaining filters... operators can be added such as Something like... (pseudo code incoming)
🌍 Query "Language"The condition builder (query builder) is modelling after a "query language". In our case, WordPress's query language, which resembles MySQL a bit. An example to look into may be Jira's JQL (Jira Query Language): It's been a while since I looked into it deeply.. From what I remember, the UI is basically a condition builder. They also have a complimentary text field where you could write the query manually, not unlike the suggestion from @mariohamann. I'm not suggestion we create our own query language. Rather, I'm suggesting the UI solution for Query block should map to both the mental model of how users assume data can be queried and the API of the WP query parameters. No need to run with this idea. You all have been at this much longer than I have! The idea of a condition builder may have already come up (hard to tell from the sea of comments). Hopefully this helps though! P.S. If a Condition Builder UI is what y'all think is best, I'd be happy to help prototype some ideas to try things out 🏗️ . |
Thanks @ItsJonQ! I would really love to see this idea being explored as well! I think it might suit us well! |
I really like the idea of the I tested a concept some days ago, to see how we could use those builded Queries for the REST API to get the full power of WP_Query: https://github.com/mariohamann/rest-query-endpoint (Where I pointed out the idea of "JSON Builder", too. :)) After asking in REST-Slack channel for feedback, I've got the response, that the given REST endpoints could already handle most of the queries, but I hadn't the time to check it out. The following GIF ist just intended to show how query builder and args-output could work together – not a proposal fo the UI. :) GIven that, variants could still create some "pre selections" or "default filters". (E. g. for a
The output (and therefore in my opinion the UI) should match the current WP_Query Class. as far as possible. |
While @ItsJonQ is working toward a condition builder, I thought to take a step back based on some of @ntsekouras' earlier endeavors. Currently WordPress.com has a Blog Post block that displays their filters in a simply search input that shows selections as labels. This follows similarly to the Tags module in WordPress.org right now. This solution...
I've also included the current iteration of the block's toolbar. Some of that interaction can be seen here. |
FiltersI think it is a very good idea to stick to common behaviour with the filters → Really like the new explorations @mapk . 👍🏻 Building on @ItsJonQ proposal I had this quick idea I would like to bring in: Clicking on "Open condicitional builder" opens a modal, which influences the shown JSON. Maybe it's too "technical" but maybe it helps for further explorations. :) Sticky poststl;drFor sticky posts the current UI seems to behave as a boolean (include, show only?), but we need three options (include, exclude, show only). Furthermore we need the option to "ignore_stickiness". @ntsekouras What are the planned options from code perspective? ExplanationIn the REST API (referring the docs) we have the parameter
🔍 Example "Featured posts" and "Other posts": If one wants to list all featured (=sticky) posts in one Furthermore in WP_Query we have the parameter to 🔍 Example "Recent posts": Sticky posts should show up, but they shouldn't stay on top. Toolbar vs. Sidebartl;drBecause of other blocks/plugins with similiar behaviour (e. g. Core/Recent posts, WP.Com/Newspack/BlogPosts, Elementor) the complexity (e. g. two steppers and descriptions inside pagination) and power (e. g. Post Type selector) of the paramaters, I think the options of the toolbar should stay in the sidebar. New UI-InteractionsAt the moment, I have the feeling there are way to many new UI interactions:
ComplexityOften toolbar settings are used for visual changes (e. g. bold, italic, text-align, image position) or for simple actions (add new row in tables, add link etc.). In my opinion many of those options are far away from being self-explanatory and simple, e. g. sticky posts (see above), offset, pagination or the technical term "post types". To support the users, I think they definetely need good and verbal descriptions. Furthermore, I really like the icons in the toolbar, but they are very tiny and e. g. the Comparison to other blocks/pluginsI had a look on the |
From a design perspective, I did add those 3 options in a dropdown. Here's how I imagine the various display settings working from the toolbar. Icons would most likely need further iterations. Post type Number of posts / Offset Sort order Pagination Sticky posts |
Perhaps I may be overthinking things, but I think the designs may not accommodate more complex WP setups. What I mean by that would be folks with several custom taxonomies beyond Categories and Tags.
(just making up values above) With the sidebar UI, we'd need to have 1 input per taxonomy. That being said, I'm not opposed to anything. Just thoughts and observations from my side :) For the Toolbar, I notice that it's showing custom icons for the Post Types. I have another question! Would the Query block support custom fields? 😱 If so, that makes it trickier considering the keys and values can be anything 🙈 (Not impossible. The UI just needs to accommodate the flexible nature of it :)) |
Thanks, @mariohamann! When I was exploring more robust filters, mixing the filters in the sidebar with the display settings was overwhelming. Now with more simplified filters, it might be okay to bring some non-essential settings back to the sidebar like sticky posts. It's good to keep these Gutenberg "best practices" in mind for informing the design.
So with that in mind...
I think the Post Type is an important setting as well! It determines a lot of the other settings that can be used. Does moving it to the sidebar make it less important? Keeping it in the toolbar does give it more importance, but it's also a setting that once set is probably not often returned to.
We might be able to provide descriptions in the dropdowns if needed.
Icons aren't great at expressing changes and reflecting settings especially if they are new icons that users aren't familiar with. Moving it all to the sidebar seems to make the sidebar overwhelming and lessen importance of many values. Maybe post types should just be words as you suggested? @ItsJonQ, thanks for chiming in!
This is correct. I'm not all that familiar with taxonomies, or how often people have multiple taxonomies to choose from. Is this a common thing that could wind up showing 5-10 different taxonomies?
This is correct. @ntsekouras has raised this issue as well. It's where I'd like to get to, but if it can't be achieved with the API, it will need to be displayed differently. Maybe just using words here instead of icons as @mariohamann suggested might work well.
Great question. I not sure myself. |
@ItsJonQ I think this block is perfect to overthink things (and needs it). 😄
Two inputs. We need to seperate "Include" and "exclude" (e. g. including I think the way @mapk shows above showing the main taxonomies (cateogry and tags) may be a very good one (as it may meet the expectations of about 98% of blogger...). And we could add "Advanced filters" with the Query Builder for the sophisticated rest of us. :) This would be inline with WP_Query where you can access those main taxonomies per default with Custom fields: This would be just lovely. I think REST API can already handle them. |
As part of the fifth call for testing for the FSE, the experience around what lives in the toolbar vs the block's sidebar was mentioned as being quite confusing:
EDITED TO ADD: This came up during the seventh call for testing as well as a point of confusion:
Currently, there is a lot of needing to jump around to both sets of settings. For example, you might want the block to display a certain category but only 3 posts from that category. To do that, you have to interact with the block sidebar settings first to set the category before then using the block toolbar to select the number of visible posts. |
As I reasoned in detail in #25198 (comment) I still think it's much more intuitive to put every setting into the sidebar. Querying is complex, the block is complex, therefore hiding settings behind unfamiliar icons and distributing them across different places reduces usability. (That's why I didn't use the toolbar in my prototypes.) |
More feedback around this experience has come up in the tenth call for testing for the FSE Outreach Program. This seems to be a repeated point of confusion:
|
@jameskoster any design input for this? 🙇 |
There will likely be cases in the future where we have a particular control available both in the inspector, and in the block toolbar. I'm thinking for example background color options for the Cover block. Given that as a pattern, it could make sense to visualize what it might look like if a query options panel held these options, with the same contents of the panel duplicated in the block toolbar flyout. |
Swimming the sea of Design Tools, I can't shake the idea that we might use that UX to create a query builder of sorts: https://jameskoster.design/2021/10/07/concept-creating-a-query-builder-inspired-by-design-tools/ I know this is a much bigger thing, but I think we should be careful about arbitrarily moving things around without a clearer vision for where we want this block (and it's variations) to go. That said – and to Joen's point – if we wanted to put these settings in the Inspector in addition to the toolbar, I think that would be fine. Edit: I opened a discussion for the query builder idea: #35760 |
To echo the past few comments on this post:
Absolutely! It would be great to explore an advanced query builder, but I think the QL controls in the toolbar should at least be duplicated in the sidebar. That's where I first looked for those settings, and I didn't find them until several days later. I can imagine users might not ever find those controls if they aren't looking for them in the block toolbar. I very much think of the block toolbar as an inline settings thing, like text appearance, paragraph alignment, width alignment, etc. |
Query Loop controls have change much since this issue was created. Let's close it. |
There have been some recent additions to the toolbar controls for the Query block. Before we go too far, let's evaluate what we have currently.
Posts per page
This is an important setting, however, will the Query block every produce results that include anything other than posts? My suggestion is to change this to say, "Items per page" and make sure it is in Sentence case, not Title case.
Number of Pages
I think this one can change to a toggle that says, "Show more than one page". The reason being is that the current "number of pages" doesn't allow a default that just shows however many pages are required to display all the posts. And it seems likely that users will want to only show ONE page with a few results, or show ALL pages with a set list of results per page. Of course toggling this "on" would add the Query Pagination block automatically if needed.
Offset
This is good to keep, but needs some explanation (helper text). At first I wasn't sure what this did. Can we add some text below that offers a tip? "Offsetting a list to 3 will begin the results at the 3rd item instead of the 1st."
Categories & Tags
I like that these are added for the basic Query block, but I imagine they will be hidden depending on the template for which they're being used. Like if this block is used on a
category-$slug.php
page, I would assume the Tag settings would not be available. Nor would the Category settings be available because the template would pass the parameters directly to the block. Am I thinking about this correctly?Add "Order by" sorting
Let's add the "Order by" sorting option to this list as well.
New mockup
With these design changes, the toolbar popover should look something like this:
cc @ntsekouras
The text was updated successfully, but these errors were encountered: