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

Navigation Screen: Update Navigation Block Toolbar to only include list view and menu name #28856

Closed
shaunandrews opened this issue Feb 8, 2021 · 5 comments
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.

Comments

@shaunandrews
Copy link
Contributor

The Navigation block toolbar doesn't do a whole lot in the context of the Navigation screen. Currently, it displays the Navigation block icon and the ellipsis icon with a rather empty options menu:

image

There might be some benefit in being able to copy a Navigation block, but you can't actually paste it anywhere else in the Navigation screen. I think we should just hide the ellipsis menu altogether.

The normal Navigation block has a button to open the list view. I think we should enable that in the Navigation screen as well.

Adding in the ongoing work (#25343) for displaying/editing the menu name in the toolbar, we'll end up with something like this:

image

@draganescu
Copy link
Contributor

@grzim as a quick follwo up to #29012 we should re-introduce the list view button in the toolbar.

@draganescu draganescu changed the title Navigation Screen: Update Navigation Block Toolbar Navigation Screen: Update Navigation Block Toolbar to only include list view and menu name Feb 24, 2021
@draganescu draganescu self-assigned this Mar 17, 2021
@draganescu draganescu mentioned this issue Mar 17, 2021
7 tasks
@draganescu
Copy link
Contributor

In this UI the navigation block's toolbar does not have the block settings menu at the end. Removing it is not trivial as there is no switch to flip about it.

I have thought about what would the best way forward be and I can only come up with two directions, neither of which are too sound:

  1. Filter the BlockToolbar component in the block editor package and add a flag that can disable the block settings menu. The problem is that it's a really superfluous filter for a very specific need, and since we have slots for adding items to a block's toolbar we don't really need to filter.
  2. Hide it in the navigation editor via CSS, which is basically a hack :)
  3. Even more complicated, hook into block supports and develop a supports settings which sounds Rube Goldberg-ish to me.

a) Is it that bad for reasons of advancing this to hide the element via CSS? (cc @talldan)
b) @shaunandrews is this departure from the assumption that all blocks have block settings something we could actually make use of in this screen, instead of dropping that menu altogether?
c) is there another cleaner way, one that does not create superfluous API,, is not hacking the UI or is not very complex?

@talldan
Copy link
Contributor

talldan commented Mar 18, 2021

Yeah, I don't really like any of the options.

I suppose CSS is the least harmful.

There's also the option of an "isCopyable": false block support setting. This would leave the menu empty, and there could be some separate logic that when the menu is empty it doesn't display. There is precedence for disabling individual menu options as well (reusable, html), but I don't know if we have a good enough reason for this setting..

This has a risk that one day something else will be added to the menu and it'll be visible again.

I'd really prefer it if we cleaned up the menu so that the stray separator didn't show and leave it at that.

@getdave
Copy link
Contributor

getdave commented May 13, 2021

Currently, the work needed (probably in separate PRs) is:

  1. Clean up the menu so that the stray separator doesn't show after the Copy action.
  2. Hide the Copy action via CSS (use display: none to ensure it hides for assistive tech users).
  3. Consider adding Block supports for isCopyable and hide the menu if there are no items registered to it.

@draganescu draganescu removed their assignment Jul 22, 2021
@kathrynwp
Copy link

kathrynwp commented Sep 20, 2022

Closing this issue due to the Navigation Screen project being moved to an inactive status on the feature projects page in coordination with the project leads. (The developer documentation in the initial post are no longer accessible)

If this work is picked back up, issues can be revisited and reopened as needed. Thanks for pitching in on this early feature so the wider WordPress project could benefit from the lessons learned!

@kathrynwp kathrynwp closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants