Skip to content
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

Advancing the Block Interface #18667

Closed
mtias opened this issue Nov 21, 2019 · 53 comments
Closed

Advancing the Block Interface #18667

mtias opened this issue Nov 21, 2019 · 53 comments
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). General Interface Parts of the UI which don't fall neatly under other labels. Mobile Web Viewport sizes for mobile and tablet devices Needs Accessibility Feedback Need input from accessibility Needs Design Feedback Needs general design feedback. [Type] Discussion For issues that are high-level and not yet ready to implement. [Type] Enhancement A suggestion for improvement. [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues

Comments

@mtias
Copy link
Member

mtias commented Nov 21, 2019

We are about to cross the one year mark since the release of Gutenberg in WordPress 5.0. In this lapse of time there has been an explosion of blocks being created 🎊and millions more users interacting with the block editor, leading to multiple iterations, improvements, challenges, and lessons learned.

What patterns have emerged as more intuitive? Where does the current interface fall short? What’s common and what is strange when comparing different blocks among the hundreds that already exist?

Something else that was not expected at the beginning was seeing other projects outside the confines of WordPress interested in using the block editor. This poses interesting design questions. How would a Drupal version of Gutenberg look? Is there an essence there that can help us refine its foundations?

The biggest design tension the editor faces is between making blocks and their interactions clear while not distracting people when they are creating, writing, and thinking. This is a tension that means, some times, bringing a block into clear focus and, other times, letting it recede into the background. (See #16280.)

This is particularly challenging when taking into account people have different needs, preferences, and dispositions that can completely inverse what “clear” or “overwhelming” means to each person. Density of information can be helpful to some while hindering the experience of others.

In the block editor context this translates to different tradeoffs, as the more that gets added the more complexity the interface needs to orchestrate. Making writing easy can come at the expense of making other important actions more convoluted. This, however, is the fundamental usability challenge we need to wrestle with!

Over time, the interface has evolved to handle increasingly complex needs, such as nested block structures, movement, selection, breadcrumbs, navigator, outlines, and more. These have all grown organically to meet new challenges. But in trying to address them in isolation, new problems arise: elements that were not designed to be prominent suddenly become more focused.

One thing that has proven useful is exploring “modes” in more depth — of which top toolbar, focus, and navigation are good examples. There’s been immense progress around iterating and improving upon these issues with each release. (Latest is this proposal for selection modes.) However, there are other problems that reflect structural constraints and require looking deeper at the anatomy of the block in order to improve. Sometimes this requires significant investment and thinking, as was the case with the newly introduced “navigation mode”, which can then unlock new pathways. (See #17088.)

This unlocking is crucial to create an interface that can serve all users while recognizing their intrinsic differences. One of the most fundamental aspects to address there is clarity.

The Block as a Canvas

block-canvas

A principle that has remained true is that the block canvas is the primary interface and brings about the expectation of direct manipulation. Blocks can define multiple states, variations, and can mutate. The canvas of the block should guide users around interacting with the content. For this, the interface needs to welcome exploration and needs to be able to teach its affordances intuitively.

One of the biggest virtues of the block is that it allows to have contextual tools when you need them, avoiding having to show unrelated tools when you don’t need them.

It also provides uniformity within diversity, as learning the ingredients of the interface happens once but scales to hundreds of blocks.

Looking at the current anatomy of the block a few aspects arise:

image

The natural visual hierarchy shows the main interactions or functions:

  • Canvas.
  • Toolbar.
  • Movers.
  • Insertion.

(With one hidden part in the block inspector (sidebar settings), but let’s pause that one for now.)

It is apparent that the block functions already carry interface weight and spread across a few different surfaces. When considering screen readers and keyboard navigation this also means a lot of areas that the user needs to traverse to interact with a block effectively.

image

With so much UI it’s worth attempting to reduce the surface, bringing it to the minimum possible to strike the right balance and clarity. There are also too many shades, making outlines and elements feel crowded and making it harder to increase contrast without increasing the feeling of overwhelmingness. This can be notorious in nested contexts, like in #14935 and the cascading issues it generates. More complex blocks surface a lot of these problems more clearly: see #17544.

A Toolbar’s Tale

The Toolbar is the second most important aspect of a block. It’s a fundamental extension of the direct manipulation principle. Third-party blocks have naturally wanted to do more with the toolbar, adding new controls or expanding on previous ones. Libraries like CoBlocks, Kioken, Editor’s Kit, and a long etcetera have been pushing those boundaries. (Color tools (#16662), background tools (#16479), etc.)

This has resulted in the following challenges:

image

Reflecting upon this situation, a few principles emerged:

  • The toolbar has to be a natural extension of the direct manipulation aspects of the block content.
  • The toolbar can be contextual and accommodate a wide range of tools, both general to all blocks (movement, duplications, removing, etc) and specific to the current block (transforms, settings, shortcuts, etc).
  • The Toolbar needs to adapt. Toolbar controls need to be grouped, collapsed, and expanded based on context. This contextuality extends not only to different blocks but also to specific states of individual blocks.
  • Clarity and contrast is fundamental. It has to remain a clear element against all backgrounds and conditions, including complex nested contexts.

Let’s Explore!

Looking at all these considerations we can start piecing together paths of exploration for a more refined block interface that emphasizes clarity and function while reducing how many elements are floating.

image

image

Absorbing the movers into the toolbar can become a contextual action, simulated in the following GIF.

paragraph-movers

The movers have a more clear relationship to the block type they are affecting, which can also help refine the drag-and-drop behaviour.

paragraph-movers-alt

Drop-downs can be recognized as extending from the same elements as the toolbar itself, reducing the amount of unnecessary icons, and improving contrast and clarity.

image

When looking more broadly to the block we can also apply some of the same principles to reduce materials (outlines with different weights) and benefit from the reduction the toolbar allows. Combining this with the work done on the “navigation mode”, the outlines can become a more effective system to communicate states and interactions.

image

An important aspect is that outlines for block selection can remain consistent, including those employed during navigation mode, ideally helping with issues like #17184:

block-outline-navigation

Combining the movers with the toolbar also helps tremendously in some of the scenarios where the current model fails — like the use of horizontal movers in Buttons or the Navigation block:

image

It’s also interesting to see how these principles can help extend the toolbar to the placeholder element, so that the initial setup of the block connects better with later interactions, retaining an element of familiarity:

image

image


This is just to kickstart the conversation, I think there’s a lot of potential in thinking about all these problems more holistically from a design, usability, and accessibility perspective. Huge kudos to @pablohoneyhoney and @jasmussen for playing with these ideas a bit.

There’s a lot more ground to cover and explore. What do you think? Does it spark any other ideas? If you have been working with blocks and experiencing the rough edges, does it solve some of them?

@mtias mtias added [Type] Enhancement A suggestion for improvement. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] Blocks Overall functionality of blocks General Interface Parts of the UI which don't fall neatly under other labels. Mobile Web Viewport sizes for mobile and tablet devices Needs Design Feedback Needs general design feedback. [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues labels Nov 21, 2019
@richtabor
Copy link
Member

This is great @mtias, really forward-thinking. 👏 👏

Here are a couple notes I had while reading through the issue:

  1. I'm curious what this means for the "Top Toolbar". What parts of the interactions do you imagine becoming ingrained there?

  2. The last screenshot references a color UX pattern. Baking in an easily implemented foundational colors experience would be so fantastic for blocks! Having background/text color controls in a standardized locale would lead to a much needed pattern for applying colors.

  3. I'm not sure if it's been explored yet, but it may be interesting to explore having the toolbar remain static on the parent block while nested blocks are being edited - with controls adapting based on the selected child block.

  4. What does the little black triangle at the bottom right of the block icon? If it means that there's a dropdown with additional controls in it? If so, the alignment/text alignment controls should also have it.

Screen Shot 2019-11-25 at 9 09 34 PM

@jasmussen
Copy link
Contributor

I think Matías is on a flight today, so I'm doing my best to answer in his place. I'm sure he'll chime in if I'm off base!

I'm curious what this means for the "Top Toolbar". What parts of the interactions do you imagine becoming ingrained there?

This is something we'll need to explore and address in implementation. The focus has been primarily on the default experience, which has the most literal visual context to each block being edited, but the top toolbar option should remain an option for those who prefer. Whether this means always showing the mover control, or making sure there's space for it to appear without moving the toolbar, there are options here.

The last screenshot references a color UX pattern. Baking in an easily implemented foundational colors experience would be so fantastic for blocks! Having background/text color controls in a standardized locale would lead to a much needed pattern for applying colors.

🙌

I'm not sure if it's been explored yet, but it may be interesting to explore having the toolbar remain static on the parent block while nested blocks are being edited - with controls adapting based on the selected child block.

I believe #18440 (addressing #17267) might be along the lines of what you are suggesting here. I happen to agree with you this is necessary for at least some container blocks!

What does the little black triangle at the bottom right of the block icon? If it means that there's a dropdown with additional controls in it? If so, the alignment/text alignment controls should also have it.

Dropdowns are likely to be increasingly necessary in the toolbar, not just to scale (the alignments menu which could theoretically grow to include custom flexbox alignments), but in order to better address plugin, responsive, and nested contexts.

In this exploration, dropdowns do not have additional visual indicators, which is consistent with popovers like the Block Library, Block Traversal and Ellipsis menus. It remains to be seen in implementation how intuitive this is for all sorts of users, but the idea is to reduce and simplify a very complex control. The triangle for the block item instead becomes an anchor point for the block, indicating the toolbar segment from which all others expand.

@ZebulanStanphill
Copy link
Member

Regarding the move controls, how would these changes affect accessibility? What would be the tab order for the toolbar controls? Is it bad for accessibility to have the move controls only be shown when hovering the block icon?

@jasmussen
Copy link
Contributor

Good questions, Zeb! Finding the right balance with the mover control is of great importance. On the one hand they offer a clear interaction for easily swapping two blocks around in a manner that is mobile friendly and not as fiddly as drag and drop, which is important for people with reduced motor skills.

At the same time, it's a big control that is useful only some of the time. Same as the sibling inserter — the plus that sits between two blocks — the idea outlined in this ticket suggests that the control could be hidden until needed.

Tab-order-wise, the controls could potentially be in a better place than before, as there will now be a single block toolbar control to tab into. Just like the sibling inserter is surfaced on both hover and focus, so would the mover controls, and they would come before the rest of the controls in the toolbar.

As I also noted to Rich, the mover control is one of those aspects that will need to be refined as we explore it in code. The intent is to find the right balance between utility and accessibility, there are a few ways we can go with it.

@mapk
Copy link
Contributor

mapk commented Nov 27, 2019

I'm really excited to see these evolutions!

I recall another challenge we face is having UI appear and disappear with various hover and selections. While this exploration still allows this, I believe grouping the UI into one cohesive toolbar as shown here will help resolve the problem. 👍

The stronger contrast is beautiful. 😍

There’s a lot more ground to cover and explore.

We definitely need to put this to the test. It would be fun to explore in the context of:

  • Nested blocks – Is it important to visually relate the nested block to the parent?
  • Right-aligned content – Does the toolbar look too detached?
  • Borders – It appears that certain blocks have a border (ie. buttons and images), but others do not (ie. Paragraph)?

Basically exploring how this new toolbar works in relation to what was addressed here (some of this is already being done):

Over time, the interface has evolved to handle increasingly complex needs, such as nested block structures, movement, selection, breadcrumbs, navigator, outlines, and more.

This will help keep us focused on the whole.

@mtias
Copy link
Member Author

mtias commented Nov 27, 2019

I'm curious what this means for the "Top Toolbar". What parts of the interactions do you imagine becoming ingrained there?

It's a good question. The top-toolbar is mostly in a decent place, since it doesn't suffer from many of the problems the in-canvas toolbar has. I'd expect it'll inherit some of the main improvements (clarity around drop-downs, contextual tools, differentiation of ellipsis menus — which the header has two —, focus states, etc).

There are some challenges to the header area that I think we need to look at more holistically, especially with full-site editing which is likely going to bring more controls within a limited space. I could see, for example, top-toolbar not adding the controls to the header but immediately below it if we can work out the double-stacking not looking horrendous :)

Having background/text color controls in a standardized locale would lead to a much needed pattern for applying colors.

Agreed! I think we are getting to a point where the UI work can help us drive issue like #7553 and #9534.

What does the little black triangle at the bottom right of the block icon?

What @jasmussen said. Also it's meant to emphasize the dropdown and add a level of hierarchy to the block type, which has been absorbing more interactions (transforms, styles, selection, possibly more).

image

@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Nov 27, 2019

I could see, for example, top-toolbar not adding the controls to the header but immediately below it if we can work out the double-stacking not looking horrendous :)

I think long-term, something like this is inevitable. Semantically, it seems weird to combine the general toolbar with the block toolbar, and having the two on separate lines would allow controls on both to be given optional inline labels (see #10524) without getting really cramped.

@karmatosed
Copy link
Member

I am excited about this iteration and appreciate it started by distilling back to the block. I want to dive a bit into this with some thoughts that come to mind. The first of those is how critical noting it's been a year is. It's crucial the interface evolves, responds and adapts to what is today's space and what will be in future. There's a lot we've all learnt along the way that can be fuel for this iteration. I think it's also worth pointing out this itself should be an iteration, with more to come.

A big problem currently is as the interface gets more complicated with nested blocks and content, the current situation doesn't scale. That feels at the root of going back to the block and re-examining. I think the suggestion of for example moving the block movers solves such a big piece of this. The toolbar suggestions as a unit to me feel instinctively like a significant step forward. It is also worth noting some benefits come in usability just from having the bigger hit space; there's an opening of the interface even that soothes cognitive load.

I am very keen on bringing in a grid and feel this as spreads across the experience is going to reduce visual confusion and space for comprehension of the experience as a whole.

As I look at the examples, wayfinding seems more natural; this is a significant improvement and one of friction today. Being able to see what you are doing and when is even more crucial as the move to site editing ramps up. While it's not being visualised in complex content in those examples, I can see how this would at least be a lot more easy to focus on than what we have currently.

It would be great to as part of this iteration explore not only the visual language but the interaction one. What story can we tell, what can we enhance with the animations, dragging and bounces? There's never been time for crafting of this into a story arc, pacing. Similarly, taking the time to make an audit of what interactions we have seems right. By setting up an interaction language the experience will improve dramatically along with all the other improvements proposed. In the examples shown, I am optimistic about this being part of the work.

jasmussen pushed a commit that referenced this issue May 11, 2020
These are colors that are explored through the G2 visual refresh (see #18667).

The color change does a few things:

- It is chosen and balanced against the rest of the visual refresh.
- It reduces the overall color palette, removing secondary colors used for toggles or checkmarks, unifying on a single blue.
- It increases contrast against white, quite a bit, which is good for toggles, focus, form widgets and buttons.

The new blue has a contrast of 5.61:1 compared to 4.57:1 for the previously used WordPress blue (#007cba).
@youknowriad youknowriad added [Type] Discussion For issues that are high-level and not yet ready to implement. and removed [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. labels Jun 4, 2020
@ellatrix
Copy link
Member

ellatrix commented Jun 6, 2020

Is there anything left here? :)

@jasmussen
Copy link
Contributor

Is there anything left here? :)

Yes! Lots! There's the realignment of menus, there's lots of work to do in the sidebar to reduce and align to a grid, and work is never over.

I don't object to this ticket being closed, as the primary points of the refresh are addressed, and actionable followup issues can be created separately.

@ellatrix
Copy link
Member

ellatrix commented Jun 9, 2020

Is there a tracking issue for he realignment of menus? Would be good to get into 5.5.

@annezazu
Copy link
Contributor

Since it's been nearly a year since this has been expanded upon and much of it was merged into prior WordPress releases, I'm going to close this out! Awesome work across the board for everyone who helped drive this forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). General Interface Parts of the UI which don't fall neatly under other labels. Mobile Web Viewport sizes for mobile and tablet devices Needs Accessibility Feedback Need input from accessibility Needs Design Feedback Needs general design feedback. [Type] Discussion For issues that are high-level and not yet ready to implement. [Type] Enhancement A suggestion for improvement. [Type] Overview Comprehensive, high level view of an area of focus often with multiple tracking issues
Projects
None yet
Development

No branches or pull requests