-
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
Create a UI that suggests patterns that are contextual to the currently selected block #28736
Comments
It is looking likely that the direction we're heading in for #28735 could inform the UX for this issue as well. The video below illustrates how the UI there translates to multi-block transforms. I think it woul work just as well for single block transforms as well. transforms.mp4After selecting two images and opening the pattern selection interface I am able to view patterns that consume two image blocks, or even two cover blocks since they are closely related. The UI will no doubt continue to evolve based on feedback in 28735, but I think it would be good to start thinking in more detail about how we determine which patterns to display here, and the order in which to display them. I posited this elsewhere:
Let's discuss here. cc @DaisyOlsen. |
Thanks for pulling me over here @jameskoster. I've been on a bit of a mission to teach people to register block patterns, so this is quite relevant to me. I do like the larger modal, as I think the sidebar preview doesn't do a lot of visually interesting blocks justice. Related to how patterns surface in the transformation modal (or sidebar) I have open questions about how those registering block patterns could identify that the blocks could be transformed (or not) - If there is a way to do this in a smart way that doesn't add any extra requirements for those creating block patterns it would be ideal. I also wonder how this might be affected by the addition of a block pattern library. Should it be possible to transform from a block to a pattern that is in the directory? |
Totally agreed. As above, if we can pull in patterns that contain the selected block dynamically, that could work well. Mightn't that be quite an intense request though, if there are thousands of patterns to loop through?
Yes, I think there should be a way to view only local patterns, only directory patterns, or a combination. That is probably something to explore separately though (at least on the design side). |
Driving by to leave a note that the modal pattern suggested in #31033 can also be applied here. Clicking the "Patterns" link in the menu item would trigger the modal carousel. |
Either of these approaches seems like a great start, with the modal probably being easier to browse, while the inline approach gives it a bit more WYSIWYG flavor. I find it hard to say something definitive on how to handle the matching, it sounds quite complex. At least it would not occur to me to select a bunch of blocks and then look for a pattern that could apply to those, I'd look in the pattern library for something matching what I had in mind, and otherwise try to build it myself. |
Even if you build something yourself, it can still be fun to browse patterns that utilise the same blocks – you might be inspired by something different! So yes, I agree – when there are multiple blocks, patterns that match the selected blocks 1:1 should be given more prominence. In truth, I find it quite difficult to come up with logic to suggest patterns for situations where no 1:1 matches are found. It all starts to feel quite costly in terms of the query we'd need to run. |
Thanks for sharing @cgaits. The challenge in the UI here is twofold:
This concept is quite easy to navigate – although I'm not sure how it scales when there are more patterns – but the size of the thumbnails seems quite small to me, and I'm wondering how the interaction works on mobile. I keep coming back to the idea of displaying patterns in a modal (#31033). It creates a space for large previews, scrolling, searching, and even view modes like grid, list, and carousel. Best of all it is portable across different flows and interactions, for example creating a template part from scratch (#31746). |
The first iteration of this landed and I'm removing this from the 5.8 board as we're passed the feature freeze date. Bug fixes can continue to land though and important iterations (case by case) can be considered. |
Let's close this and follow up with more focused imporvements. |
When one or more blocks are selected, there should be a UI which presents options to "convert" that block(s) into a pattern which consumes it/them, and preview the selected block in context of the suggested pattern(s).
A rough starting point:
The tricky thing here will be working out which patterns to present... Quoting Matias:
The text was updated successfully, but these errors were encountered: