-
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: Query Builder #26304
Comments
I'd challenge a bit the initial assessment:
I don't think such a mix should be pursued. What type of user and use cases is it trying to serve? The query block needs to allow theme developers and block authors to specify queries as needed (it can be through block attributes and doesn't necessarily imply a UI) and end-users to interact with a subset of them in a much more straightforward way. This has to be informed by what the real needs are and not an abstract interface to The other important part of the query block, in contrast with the Latest Posts block currently in core, is the ability to work with different templates and structures for organizing post items (title, date, author, content, etc). That's where most of the important work rests right now — variations, patterns, individual blocks and their tools. Excellent handling of featured image (find ways to allow using a Cover block to render a featured image, for example). Possible integrations with layout blocks like Columns. Good editing flows for the Loop inner blocks template. Reminder of the very initial kickstart for this block; I need to be able to create this: Once we are closer to this being a reality it could make sense to explore a full interface over the query object, but it's not a priority right now. |
@mtias Thanks for the feedback! I was looped into Query Block recently. I did my best to interpret the gigantic discussion (😂 ). Apologies for potentially misguiding the direction of things 🙏 I think this reframing was helpful. I'm happy to assist with ongoing work if needed. |
@mtias Thank you for your description! Personally, after having seen the newest (really nice!) explorations of @mapk over here, I more and more have the feeling, that the Query Block at the moment has to combine too many too different concepts:
The current approach is to use variations – but we need variations for every part. E. g. a "Latest Posts" variation which of course handles "Query configurations". But "Latest Posts" could be shown as a simple list or as cards etc. etc. Would that be two variations e. g. "Latest Posts: Cards" and "Latest Posts: Grids"? I don't think that's a scalable solution. I would like to propose the idea to seperate at least the first concept from the others and would like to bring in the "Loop Block" for further considerations:
For more clarification, here a quick draft: Would that be technically possible? Would that make things even easier? I would be happy about your feedback. |
@mariohamann that's already how it works :) When you insert a |
Problem
How do we create a scalable and predictable UI for the Query block that provides enough power for advanced users to build detailed queries, works with the REST API, and communicates the query clearly for non-developer people to also use?
Solution
Based on this comment from @ItsJonQ, and an earlier discussion with Q, @mariohamann, and @ntsekouras, we thought it worth while to investigate a design direction that involves a condition builder (aka Query Builder) for the Query block.
This UI introduces a modal element for a block. While modals exist in Gutenberg today, it's a bit new to allow one to appear from a block's toolbar (I think). We needed plenty of area to implement the form fields necessary for this builder. Sidebars and block toolbar dropdowns weren't enough.
I had explored setting design options here. And while they solved the problem, it was difficult to settle on where the settings and filters would exist and caused visual clutter when viewing them all at once. The Query Builder helps in this respect by moving the complicated query building to a modal and hiding that power behind an icon in the block's toolbar. The Query is still communicated in the sidebar (currently as JSON text), but provides a quick view of the actual query without having to dive back into the modal.
Prototype
Query Builder Modal
cc @mtias
The text was updated successfully, but these errors were encountered: