-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add Support to Insert Existing Reusable Blocks from the Editor #2575
Comments
@iamthomasbishop could you help me with the designs for this issue? Thanks! |
@fluiddot Hey there! Apologies for the delay on design direction. I didn't expect to be working on this so soon, but I do already have some notes/sketches/designs from previous explorations, so I should be able to provide something today or tomorrow. I have a lot of ideas for the inserter as a whole that are relevant to this work, but before I go too crazy I have a couple of questions I'd like to clear up in terms of scope -- @maxme I think you'll be in the best position to answer these, but @fluiddot obviously feel free to chime in as well.
If the scope is simply "show users' existing reusable blocks in the inserter" then I already have a pretty good idea of how I think we should approach this. But if we are expecting to expand the scope, I might alter the design direction/proposal slightly. For now, I'll assume the narrowest scope and share some notes and designs either later today or tomorrow morning (UTC-5). |
Hello @iamthomasbishop! Thank you very much for the response. From my understanding of the issue, the scope is limited to only provide an entry point in the inserter to the reusable blocks, so there's no plan yet to add logic for managing them. Regarding the support of reusable blocks as editable, I'm not sure about it, my impression is that this issue doesn't cover it neither, is this right @maxme? |
This is right, it's out of the scope of this ticket.
We should lists all these tasks under this epic ticket #2497. I'll create a new ticket about editing existing reusable blocks and a second one for managing them, then add them both to the epic.
This will come with some tweaks to our inserter instead, there is a ticket for that: #2570 |
Ok, thanks for clarifying @maxme @fluiddot 😄 I think this is pretty straight forward then. We can probably utilize our Segmented Control component to separate reusable blocks from standard blocks. I put together 2 quick prototypes of what this would look like -- one with the Segmented Control on the top of the sheet and the other with the control at the bottom. Gifs
PrototypesFeedbackI'd like to hear feedback on the following:
Notes
|
Really cool design @iamthomasbishop it's very clean, regarding the feedback:
It's tricky to decide this kind of things 😄 , here goes my pros/cons of each: Control on top: Pros:
Cons:
Control on bottom: Pros:
Cons:
In my opinion the best would the
I prefer "natural", it could make the header to look a bit empty but if we add the icons I think it could look cool.
I think icons could emphasize the segments and since we only have 2 there's room for adding them. |
@fluiddot That's pretty close to my list of pros and cons, and I am also leaning towards top-positioned because while the control does move, this isn't an interaction that should happen super frequently -- or at least not enough that it's going to cause an uproar -- and it is more discoverable than the bottom-positioned alternative.
Agreed that natural probably will feel best because it allows the content to breathe a bit and as a result the control is more distinct. Let's start with just text for labels because I think some translations may give us longer labels. For example, here are some examples of text-label vs. with-icon, using English vs. German: Note: at some point we will probably add a third segment ("patterns"), so we will need some wiggle room. I don't foresee us adding additional segments beyond that -- but if we do, we'd want to consider using scrolling tabs or something similar. |
Yeah I agree, ok let's go with the "Control on top" option 👍
Good point, I think it's a good idea to start with only the labels and as you commented, overall it's going to be safer do it this way for avoiding potential text cut off issues 👍
For now if you agree I'm not gonna take this into account for this issue but of course, in the future that would be a good solution in case we want to add more tabs. |
Most definitely, that's a future project 😄 @fluiddot I think we should be able to utilize the Segmented Control component (RN) as-is, and I don't think we're introducing any new things, but if there's anything that I'm missing from a design perspective (or if you have any questions regarding flow, function, etc.) let me know and I'll be happy to pull that together! |
Thank you Thomas for the designs!
I wonder if patterns will replace reusable block some day, so we might not have this problem in the future. |
I think there has been discussion on the core side, but I don't know has come of that discussion. My guess is reusable blocks will stick around in some form, because it is a bit different from standard Patterns — reusable blocks are a clever way of allowing users to group and re-use any arrangement of blocks — almost like "custom"/user-defined patterns. So I think they'll stick around for a while, although personally I think we could find a better name for the concept, but I digress 😄 |
I've got a question about the behavior when navigating tabs. |
@fluiddot I would prefer that we preserve the scroll-position, but I wouldn't necessarily call it a deal-breaker. I think we had a similar discussion when working on the color picker UX where we wanted to preserve scroll position on segment-change, so maybe there's some knowledge to be gained from that implementation. |
Ok sorry but for now I'm going to keep it without preserving the scroll-position however it would be a good improvement for a second iteration. |
That's fine, we can save that refinement for an iteration. Would you mind creating a separate ticket for that just so we have it documented? |
Sorry for the delay, I've just created an issue related to this. |
Here I'm resuming my work so far in this issue: Split the issue in 2 partsFirst of all, I decided to split this issue into 2 parts, the first part adds support for Reusable blocks and the second one adds Reusable blocks to the inserter menu. I did it this way because I wanted to keep the PRs as small as possible as well as I didn't want to mix both changes. The first part to be honest was unexpected when I began to work on this but nevertheless was required for supporting Reusable blocks. Related to this, the support for now is limited to only the preview of the block, edition is going to be implemented in a different issue. Here are the different PRs related to the issue: First part - Add support Reusable blocks Second part - Add Reusable blocks to the inserter menu Pending things to do
Related issuesDuring development I spotted some issues that I opened in Gutenberg repository. |
This task is completed although it won't be displayed to users until the reusable block is enabled in this PR. |
Add Support to Insert Existing Reusable Blocks from the Editor.
/wp/v2/sites/{siteId}/blocks/
core/block
referencing the reusable block id.The text was updated successfully, but these errors were encountered: