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

Find a better place for the "Manage All Reusable Blocks" link #13390

Closed
afercia opened this issue Jan 20, 2019 · 18 comments
Closed

Find a better place for the "Manage All Reusable Blocks" link #13390

afercia opened this issue Jan 20, 2019 · 18 comments
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jan 20, 2019

In the top bar "more" menu, "Manage All Reusable Blocks" is a link and triggers navigation to wp-admin/edit.php?post_type=wp_block:

screenshot 2019-01-20 at 19 07 36

However, it's placed within an ARIA menu and has a role of menuitem. This way, it's announced by assistive technologies as a menu item. There's nothing to inform users it's a link and that activating it will trigger navigation to a new page. In short, the current interaction is completely unexpected.

I'd say that also visually there's nothing that communicates to users this is a link. The navigation to a new page may be completely unexpected for non screen reader users too.

Using an <a> element is correct, but this link can't be placed within a role=menu. This is a good example where design needs to take semantics and expected interaction into consideration. The whole menu is made of menu items for actions and that's the convention communicated to users. A link feels out of place.

Worth noting that in the inserter, this link is actually communicated as a link because the native semantics is preserved:

screenshot 2019-01-20 at 19 22 17

ARIA roles and attributes communicate semantics and also expected interaction. It would be great to enforce via code that components using role=menu can't contain links.

Regarding the specific case of the "Manage All Reusable Blocks" link, it should be removed from the more menu entirely.

I seem to recall there was some previous conversation about the discoverability of this link. As it's a link that points to a default WordPress admin page that displays a specific post type, one option could be considering to place it in the WordPress admin menu on the left.

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Needs design efforts. labels Jan 20, 2019
@ZebulanStanphill
Copy link
Member

As it's a link that points to a default WordPress admin page that displays a specific post type, one option could be considering to place it in the WordPress admin menu on the left.

This seems like the best option to me. This could also solve discoverability issues, as noted in #13519.

@youknowriad youknowriad changed the title Menus should not contain links Find a better place for the "Manage All Reusable Blocks" link Feb 6, 2019
@paaljoachim
Copy link
Contributor

Thinking out loud...

Here is a reusable block with an edit button.
screen shot 2019-02-06 at 19 29 10

Can we click the edit button and edit the reusable block directly there in the layout?
Then afterward clicking update button to save the newly adjusted reusable block.

--

Gaining access to editing the list of reusable blocks.
What about a drop down? The user selects which reusable block to edit or actually use.
Something like this..

editing-reusable-block-dropdown

@afercia
Copy link
Contributor Author

afercia commented Jun 3, 2019

This issue is even more important now that the menu has seen some significant improvements in #14843. The whole menu now works as expected: arrows navigation goes through all the menu items, the menu and its items behave as expected... with the exception of the "Manage All Reusable Blocks" link.

This is a link and it's now announced as a menu item (the actual announcement varies depending on the browser / screen reader combo):

Screenshot 2019-06-03 at 10 09 28

This way, users have no clue activating this menu item will trigger navigation to another page, they have no idea it's actually a link.

I'd tend to think that also for users who don't use assistive technologies the navigation to a different page is unexpected.

/Cc @gziolo

@gziolo
Copy link
Member

gziolo commented Jun 3, 2019

This is a link and it's now announced as a menu item (the actual announcement varies depending on the browser / screen reader combo):

diff --git a/packages/components/src/menu-item/index.js b/packages/components/src/menu-item/index.js
index de5429ddf..268cfce75 100644
--- a/packages/components/src/menu-item/index.js
+++ b/packages/components/src/menu-item/index.js
@@ -28,7 +28,7 @@ export function MenuItem( {
        icon,
        shortcut,
        isSelected,
-       role = 'menuitem',
+       role,
        ...props
 } ) {
        className = classnames( 'components-menu-item__button', className, {
@@ -67,7 +67,7 @@ export function MenuItem( {
                {
                        // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
                        'aria-checked': ( role === 'menuitemcheckbox' || role === 'menuitemradio' ) ? isSelected : undefined,
-                       role,
+                       role: role || props.href ? role : 'menuitem',
                        className,
                        ...props,
                },
diff --git a/packages/edit-post/src/plugins/index.js b/packages/edit-post/src/plugins/index.js
index bae6f0811..27eb91b47 100644
--- a/packages/edit-post/src/plugins/index.js
+++ b/packages/edit-post/src/plugins/index.js
@@ -23,7 +23,6 @@ registerPlugin( 'edit-post', {
                                                <>
                                                        <ManageBlocksMenuItem onSelect={ onClose } />
                                                        <MenuItem
-                                                               role="menuitem"
                                                                href={ addQueryArgs( 'edit.php', { post_type: 'wp_block' } ) }
                                                        >
                                                                { __( 'Manage All Reusable Blocks' ) }

Would it solve the issue for More Menu? I see the following:

Screen Shot 2019-06-03 at 12 53 27

I can use only Enter to open the link.

@mapk - do you have some thoughts on whether we could move this link somewhere else. According to specs role="menu" should contain buttons and links should be part of role="navigation".

@afercia
Copy link
Contributor Author

afercia commented Jun 3, 2019

Well, actually on the ARIA authoring practices there's an example of ARIA menu with menuitems that are links. The problem is it's not clear activating this menu item will trigger navigation to another page.

I think it could also be solved by changing the text "Manage All Reusable Blocks" to make clear it goes to another page. However, I'd prefer this link to be moved somewhere else.

@mapk
Copy link
Contributor

mapk commented Jun 10, 2019

There are only two items in that menu that include verbs; "Copy all content" and "Manage all reusable blocks". The Copy option keeps the user on the same page and provides immediate feedback. It does seem confusing that the "Manage all reusable blocks" item navigates the user to another page entirely.

I understand the importance of surfacing reusable block editing, but now that we have a Block Manager, I feel that ALL blocks should be listed there, even reusable blocks. Right now they are not. I'm in favor of a solution that:

  1. Adds the ability to show/hide reusable blocks in the Block Manager.
  2. Adds a link in the Block Manager to "Edit blocks" which sends the user to the new page.

Example

Manager v4 - Reusable blocks

What do you think, @afercia @gziolo ?

@gziolo gziolo added Needs Dev Ready for, and needs developer efforts Good First Issue An issue that's suitable for someone looking to contribute for the first time and removed Needs Design Needs design efforts. labels Jun 11, 2019
@gziolo
Copy link
Member

gziolo commented Jun 11, 2019

I like this proposal. I imagined myself something similar 👍

@afercia
Copy link
Contributor Author

afercia commented Jun 11, 2019

Thanks @mapk, grouping anything related to blocks management in one place makes sense to me. The "Edit blocks" link that looks like a link helps as well.

Language related question: I'm not a native English speaker so I definitely may be wrong but shouldn't "Block Manager" be "Blocks Manager" ?

@noisysocks
Copy link
Member

Agree with moving the link to the Block Manager. Also worth noting is @melchoyce's proposal to introduce a Block > Manage section into WP Admin.

@gziolo gziolo self-assigned this Jan 3, 2020
@gziolo gziolo added [Status] In Progress Tracking issues with work in progress and removed Needs Dev Ready for, and needs developer efforts labels Jan 3, 2020
@paaljoachim
Copy link
Contributor

Let's just add a tab into the Block Inserter next to the Patterns tab.
#17335 (comment)

Having a way to preview reusable blocks similar to patterns.
But also a way to edit a reusable block/patterns and then resave or create a new.

@mapk
Copy link
Contributor

mapk commented Apr 14, 2020

Let's just add a tab into the Block Inserter next to the Patterns tab.

We're currently looking to add tabs for Blocks and Patterns in the Inserter right now. We may possibly add Template-parts there too, so the Inserter may get too overwhelming with a resuable blocks tab.

@ZebulanStanphill
Copy link
Member

Still, I don't think reusable blocks belong in the same section as regular blocks. In fact, I'd consider them to be closer to patterns or template parts in some ways. They should be shown with a preview rather than an icon, just like patterns.

I think the best place for a "Manage Reusable Blocks" link is just somewhere in the WP admin navigation menu, next to wherever full site editing will go. Reusable blocks are just another post type after all. Why do we hide the interface for managing them?

@gziolo gziolo removed their assignment Oct 27, 2020
@gziolo gziolo removed Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress labels Oct 27, 2020
@paaljoachim
Copy link
Contributor

Is this issue still in valid?
@joedolson
What are the next steps we need to take?

@mrfoxtalbot
Copy link

I think the best place for a "Manage Reusable Blocks" link is just somewhere in the WP admin navigation menu, next to wherever full site editing will go.

+1 to this. I am not 100% sure what the ideal location would be, but it should be listed somewhere on the main admin navigation to improve discoverability.

@allysonsouza
Copy link

+1

It's very weird that there's no way to access reusable blocks from main menu, this is the obvious and expected way from an user perspective.

@DeaJae
Copy link

DeaJae commented Aug 27, 2022

It'd be great to access these from main admin rather than opening up a post to get the menu link to get to the lost post blocks.

Would it be possible to have something like this under the Gutenberg plugin's menu list? along with the ability to see the templates, blocks and patterns for Classic theme users this way too?

@annezazu
Copy link
Contributor

annezazu commented Sep 5, 2024

Coming back to this WAY later :D and I'm wondering if we should close this out or update it because, as of WordPress 6.6, there's a dedicated section for synced patterns in Patterns for both classic themes and block themes (classic themes have a "Patterns" section under Appearance and block themes show "Patterns" as a top level item). This "manage all reusable blocks" has now become "Manage patterns". How is this announced now though? Is there more we can do there to keep this issue actionable?

@mrfoxtalbot
Copy link

there's a dedicated section

I'd close this, @annezazu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants