-
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
Design improvements to Image Block toolbar #26411
Comments
I'd love to ensure we are doing this more generically for all blocks |
Could we try to define what we need for a generic scope, in a single sentence? I'll try but no guarantee at all 😅
It means we shouldn't re-implement the current toolbars but be able to put them in the same section, adjusting the box model to make look the same as the single toolbar-group, when it isn't collapsed: Maybe it's doable adding a new wrapper component, which could get the API more confusing. I've been diving into the code and I see that we have many Toolbars components, some of them are entirely internal components. Creating this |
Sure I'll try:
In #24898 there's a mockup, which although it's missing the drag handle, is still accurate to the structure: Note in the above image that the spacing is different. A full button is only 48px wide if it's a single button inside the toolbar. In the case of the full height button for cover, it is a block level control, therefore it should be in the same toolbar group as the alignments dropdown, which is also a block level control. |
Very nice 👍 . Thanks!
<3 Very nice.
Yeah... this is the trickiest part from my point of view. I do think there could be some cases where we'd like grouping toolbar groups. For instance, the
Maybe I'm wrong, but let's suppose we'd like to put these two toolbars (group) in the same section. Right now, with the current implementation, we should combine them in the same group. But clearly, to me, they are not part of the same one. Because:
There are some options that are naturally self excluding. A simpler case is
Please help me to get rid of the idea of grouping toolbars-group, slightly described in my previous comment. In short, it suggests adding a new organization level, to put their toolbars-group. I see three organization-levels (it doesn't mean to the so far, beyond the structure of the components: The toolbar:
Into the toolbar, there are toolbars group:
And each toolbar-group contains some buttons:
I suggest adding a new organization-level in between the navigation and the toolbars group destined to them in the same section. It would allow combining |
Good thoughts here.
Bold and italic can be combined, but they remain in the same group. To me, the separation is about hierarchy rather than behavior, and in grouping based on the former, general rules that apply to all blocks can be made.
Help me understand this better. You can choose both full-wide and toggle the full height, with both those options being in the same toolbar-group, no?
I suspect this question has technical underpinnings rather than visual. I will defer to others that I hope will contribute with thoughts here. Thanks for taking a look at this! |
Oh, right. that's correct. It works because the toolbar is not collapsed. There is no clear way to show these three selected states (italic, bold, and link) in the same icon when the toolbar is collapsed. That's what I mean with the alignment example. For text alignment, It's possible because no makes sense setting more than one option (left, middle, and right), and the current state is easily shown with the icon in the toolbar.
Yes.., it's doable putting buttons with different behaviors in the same toolbar, but when it's collapsed, it loses the ability to show the state selected. It happens with the I guess it isn't a big deal since they seem to be secondary options.
Yes, technically we can but It will require refactoring the Question about thi approach. Let's suppose we do something like this: How do we reflect on the toolbar the current option when it's collapsed?
Finally, to me, the solution is just was suggested by you:
In other words, Be able grouping toolbar-groups together, in the same section |
This isn't true in case of alignments, though: I think I hear what you're saying — it's not a direct toggle like full-height, because the toggle is inside the dropdown. But I still think the two can coexist.
I don't think we should do that 😅 — exactly because we can't show the state. You shouldn't select multiple alignments that stack, in the same dropdown.
Visually yes that's what I'm after. I believe there may be some trickiness around what gets announced to screenreaders as a single group, that's why a refactor might be necessary 🙈 |
I mean "it loses the ability" because it shows only one selected icon. This is tied with:
So it answers the question if this disposition is correct: So the answer is - no, it isn't correct, because...
I need to improve and incorporate the proper vocabulary because I'm making the communication confusing. In the gif above, dropdown and toolbar-group represent almost the same: a Toolbar Group. When it's collapsed, the options are sorted into a dropdown, but technically, dropdown doesn't define a toolbar role but a disposition. I say this because you asked in the previous comment:
The answer is yes, but it means that the full height will be sorted together with the other alignments options, in the same dropdown 😅 The dropdown is just a way to show the toolbar items, of a toolbar group.
At which level? Not in the same toolbar group but the same toolbar section. In your example:
yeah... something to keep exploring and researching. |
I need to work on my verbiage! Thank you for the illustrations, and your patience. What I'm saying, using these terms, is that block level actions like align, height, link, crop, belong together in a single toolbar section. I hope I got that right 😅 |
Agree. We are on the same page!!! ✋ The first potential issue that arrives at my mind is when using hooks to implement some toolbars. As you know, we can add the alignments toolbar by setting the However, we can go ahead and try to compose them programmatically. It means to add a |
Thank you. Cc @ajlende as I know he's had this challenge, in case he has any ideas. |
@retrofox did a good explanation of There's additionally a The problem I see is that the I imagine There's also Reakit to consider for the implementation details. The toolbar in Reakit is split into three components: |
Sounds like a nice idea to me.
No sure how applicable is this approach with the current API of the block editor, especially talking about the Even going a little bit forward, wondering how we implement the idea of blocks levels. If I'm not wrong, we'll have to define new slots, one for each part of the toolbar. So in this way, we could fill the different block-levels with the toolbar that we want. <BlockLevelControls>
<BlockAlignmentToolbar />
<BlockFullHeightAlignmentToolbar />
</BlockLevelControls>
<BlockInlineLevelControls>
<AlignmentToolbar />
</BlockInlineLevelControls> |
Then let's keep with the
I really like that idea! It would especially help with block filters that add items to the toolbar. |
The Image block toolbar is heavy on borders, to the point that the visual separation doesn't help:
In the above example, alignment, link, and edit are all block level actions, and conceptually related. These could be in a group together:
Similarly, the "Edit" state of the Image block toolbar is currently quite heavy:
In this context there's no reason for you to see the transform/move controls, or even the alignments, because you are in a modal section of the toolbar. It could be collapsed down to this:
The text was updated successfully, but these errors were encountered: