Problem/Motivation

Add a new Administrative Navigation Toolbar in core being current worked in the Navigation contrib module after proposing #3364258: [meta] Improve administration navigation.

Proposed resolution

Add the new Navigation Toolbar in core as beta. The Roadmap to Stable can be found at #3421969: [PLAN] New Navigation and Top Bar to replace Toolbar Roadmap: Path to Stable.

We tested and validated a left, vertical toolbar because it performs better with large or complex menus like the one we use for Drupal’s administration interface.

This left vertical toolbar can be collapsed to take less horizontal space on the desktop, allowing it to navigate through icons predefined for first level items, chosen from the extensive open-source library Phosphor.

The sub-menus open on a drawer on the right of the main toolbar on the desktop when the first level item is hovered to provide a quick navigation between the main sections. The region opens on top of the content and takes the full height of the viewport. Inside it, deeper navigation levels can be opened by clicking, up to 2 extra levels to accommodate complex information architectures and contrib module additions on deeper levels. On smaller viewports, the toolbar is placed on top of the content, and opens with an overlay.

We provide a default Drupal logo at the top of the toolbar that can be replaced or hidden to allow for extra customization. At the bottom of the toolbar, where the collapse button leaves, are also placed necessary items that aren’t accessed that often: the user menu and the Help. If the content of the toolbar is too tall for the viewport, the toolbar footer will also stay fixed at the bottom to provide the ability to collapse or open the toolbar.

We’re implementing a new design system that will eventually be used by the whole administration UI. It uses an updated look and feel, but more importantly it defines layers of abstraction that will allow the UI to be more customizable. The code will allow specific features like dark mode, density or predefined palettes to be easily overridable. We are not doing that in Claro because the complexity it'd entail is beyond the scope of the Navigation

The main feature the new navigation will provide is the ability to create and place new navigation blocks into the toolbar through the UI, so site builders can easily customize their administration. These navigation blocks can be reorganized and removed, and even show a block label if necessary.

Navigation blocks are implemented as plugins (using the NavigationBlock attribute), very similar to Blocks. The difference is intentional as the use and placement of navigation blocks is limited to only the navigation bar. While just using Blocks here was considered, the constraints of the new navigation bar mean most existing blocks are not a good fit. Implementers need to be keenly aware of the constraints in creating new navigation block plugins. However, being that navigation blocks were closely modeled on blocks, it should be fairly straightforward for developers wishing to extend the functionality of the navigation bar to do so.

The navigation module ships with three navigation block plugins out of the box. A shortcut navigation block shows a user's currently configured shortcuts, with links to the relevant admin pages to make changes. A user navigation block shows the users name and links to view/edit profile and logout. Finally a system menu navigation block exposes all menus as a navigation block, using a deriver on the plugin.
Navigation blocks are config entities. An instance of a navigation_block config entity is created whenever a site administrator uses the Navigation block UI (found under Configuration > User interface > Navigation blocks) to configure the placement of a navigation block, much like the Block layout UI. Accessing the Navigation blocks UI is restricted by the ‘administer navigation_block’ permission.

Content creation menu

The new content creation menu is a new menu provided by the navigation that allows a quick access to content-related tasks to increase usability for content users. The results of the users' tests proved it being a useful tool for this persona, specially moving the quick access to create different kinds of entities to a first level that doesn’t require navigating to another page. For the beta release we’re providing a set of predefined options that can be customized on the menu itself.

Top Bar

This feature is under active development and is hidden behind a flag in admin/config/user-interface/navigation/settings. Disabled by default, its goal will be to provide the rest of the contextual actions needed to improve the UI that the actual Navigation can’t accommodate. Some of its future additions can be seen on the new navigation Roadmap.

Remaining tasks

The tasks initially tagged as Beta blockers have been closed. Any new issue found and listed as Beta blocker.

User interface changes

The existing to black Toolbar will be replaced by a new light left vertical toolbar that allows navigation into submenus through a drawer area.

API changes

  • New NavigationBlock (navigation_block) config entity defined. See Drupal\navigation\Entity\NavigationBlock.
  • New plugin type, ‘NavigationBlock’. See Drupal\navigation\Attribute\NavigationBlock.

Data model changes

@todo

Release notes snippet

The Navigation module provides a redesigned left-aligned, collapsible, vertical sidebar navigation for the administration UI. Sub-menus open on a full height drawer that accommodate deeper navigation levels. On smaller viewports, the toolbar is placed on top of the content, and opens with an overlay.
The Navigation module provides multiple customization options like adding new custom menus or chaging the default Drupal logo provided.
The menu blocks can be added and reordered through the UI thanks to Layout Builder, so site builders can easily customize their administration. The navigation module ships with a new Content creation and management menu that allows quick access to content-related tasks to increase usability for content users.

Issue fork drupal-3438895

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ckrina created an issue. See original summary.

cilefen’s picture

Version: 10.3.x-dev » 11.x-dev
m4olivei’s picture

A couple of handy references for our purposes here:

  • Claro issue used to prepare for core inclusion. A patch was managed here for the changes needed between the contrib version of the module and core. We'll need something similar here.
  • The script that was used by Claro for trasposing the contrib version of the theme into a core patch. Provided by @laurii. We'll need something similar here.

I'm going to work on the script a little.

m4olivei’s picture

ckrina’s picture

We're still working on cleaning-up the MR and providing the necessary info on the issue summary, so leaving this as Active for now to finish those. When it's done we'll move this to Needs Review.

ckrina’s picture

Title: Add the new Navigation module to core » Add the new Navigation to core as an Experimental module
Issue summary: View changes
StatusFileSize
new905.83 KB
new92.31 KB
new17.15 KB
ckrina’s picture

Status: Active » Needs review

Moving to Needs Review to start gathering reviews and feedback :)

PD. Tugboat is broken on core issues at the moment on account of Drush not supporting Drupal 11.x yet. (thanks @m4olivei and @plopesc for pointing that out)

nod_’s picture

a bunch of comments, not found of using custom event, I'd subclass it and call the new class directly

catch’s picture

Not a full review but a handful of comments on the MR.

ckrina’s picture

Issue summary: View changes

Adding some design system related info as context.

finnsky’s picture

Assigned: Unassigned » finnsky

gonna do small fixes right in MR

finnsky’s picture

Assigned: finnsky » Unassigned
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new66.44 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

larowlan’s picture

Status: Needs work » Needs review

I've collated the duplication between the navigation module and the block module.

Is there any of this we can reuse some of the things in core now we have a core MR and the ability to make changes to core to support our needs?

Block Navigation Similarity
Block (attribute) NavigationBlock (attribute) High
BlockAddController NavigationBlockAddController High
BlockController NavigationBlockController High - 1 identical method
BlockLibraryController NavigationBlockLibraryController High
BlockListController NavigationBlockListController High
Block (Entity) NavigationBlock (Entity) High
BlockDeleteForm NavigationBlockDeleteForm High
BlockForm NavigationBlockForm High
SystemMenuBlock (Block plugin) SystemMenuNavigationBlock (Navigation block plugin) High
Broken (Block plugin) Broken (Navigation block plugin) High
ShortcutsBlock (Block plugin) ShortcutsNavigationBlock (Navigation block plugin) High
BlockAccessControlHandler NavigationBlockAccessControlHandler High
BlockInterface NavigationBlockInterface High
BlockListBuilder NavigationBlockListBuilder High
BlockManager NavigationBlockManager High
BlockManagerInterface NavigationBlockManagerInterface High
BlockPluginBase NavigationBlockPluginBase High
BlockPluginCollection NavigationBlockPluginCollection High
BlockPluginInterface NavigationBlockPluginInterface High
BlockRepository NavigationBlockRespository High
BlockRepositoryInterface NavigationBlockRepositoryInterface High
BlockViewBuilder NavigationBlockViewBuilder High
plopesc’s picture

@larowlan Thank you for opening that discussion.

We need at some point to address the code duplication issue.

I'm not sure whether this is a task to work on now or when moving the module from experimental to stable.

If I understood correctly, experimental modules recommendation was to not modify other core pieces just in case they will not be finally promoted to stable. Not sure if that's not actually the case, or if this scenario could be an exception.

catch’s picture

If I understood correctly, experimental modules recommendation was to not modify other core pieces just in case they will not be finally promoted to stable.

Navigation supplying plugin implementations to eventually move to other modules (as is in the MR) is good because then if there was removal later, it's a clean break. That's what's meant by modifying core pieces.

However core MRs to improve APIs, so that the experimental module doesn't have to work around them - these are always fine. Workspaces for example had to make dozens of changes to the entity API and individual core entity types (revision support, publishing support etc.) before it was stable, but all of those made sense if workspaces never existed too.

I think the main question with the duplication, is whether the separate config storage is definitely going to be maintained or not, if it is, then it's mostly a matter of code duplication, if it was somehow going to be merged with block configuration, then it mean an upgrade path and block beta (but not necessarily alpha).

deviantintegral’s picture

I think https://www.drupal.org/project/navigation/issues/3397058#comment-15331899 describes why we walked away from blocks - that the Navigation toolbar will never have a true render context in build() and will never be tied to a theme, whereas blocks are always placed within a theme.

ckrina’s picture

I think the main question with the duplication, is whether the separate config storage is definitely going to be maintained or not, if it is, then it's mostly a matter of code duplication, if it was somehow going to be merged with block configuration, then it mean an upgrade path and block beta (but not necessarily alpha).

Beyond the code and on a UX perspective, the decision to have an independent page to manage the blocks for the admin navigation was deliberate. We wanted a separated page because:

  1. Appears both in front-end and admin themes (as summarized in #18)
  2. Because it's a different context: you are customizing the "admin UI", not "the site". So you are not changing the site Structure (where Block layout is placed), but the admin tools you are providing to work on the site.

We wanted to reuse something that existing devs know so they can create and place here custom blocks specifically created for the navigation (so they don't place anything and breaks the admin navigation). The result has been duplicated code, which is not ideal but a requirement of being a contib as mentioned. In an ideal world we would change block in core so the changes can be used also to eventually place blocks in a future Dashboard. But realistically we probably can't change core in 1 week: so does it mean we should try to get in as alpha?

m4olivei’s picture

Closed / re-opened the MR to trigger Tugboat. Sorry for the noise.

larowlan’s picture

I've opened two new MRs as follows

They're ready for review and testing, screenshots on the MR - seems to be working fine, net change is -4000 lines of code

I didn't want to push to the existing branch as I felt folks might want to review the alternate (layout builder) approach. Check the second of those MRs above for the change between both approaches.

finnsky’s picture

StatusFileSize
new119.71 KB

@larowlan i've tested LB approach in terms of frontend. Looks fine and i didn't find regressions.

Probably we need to use new page with admin UI for this layout edition.
Because on mobile or in collapsed state it became hard to use.

finnsky’s picture

Issue summary: View changes
StatusFileSize
new189.49 KB

Also we have styled block titles in blocks approach. Please check as well. Thanks

catch’s picture

Let's assume this will get in and tag it for release highlights :)

larowlan’s picture

From a framework manager point of view, I'm happy to sign off on the backend code in this MR for the following reasons:

  • There is no new API, it is purely a feature module making use of existing Drupal hooks and plugins
  • The changes are entirely isolated to the module, it can be uninstalled if it causes any issues on your site without any data-model bleeding into the site
  • There is only simple config stored so if we ever need an update path for API changes, updating 2 simple config objects feels much less risky than e.g. updating content entities

I'd like to congratulate everyone who worked on it, its an awesome piece of functionality and a huge step forward for Drupal core

larowlan’s picture

Status: Needs review » Needs work

For the open items in the MR

finnsky’s picture

Frontend feedbacks resolved

ckrina changed the visibility of the branch 3438895-module-flag to hidden.

catch changed the visibility of the branch 3438895-attempt-to-remove-duplication to hidden.

plopesc’s picture

Status: Needs work » Needs review

Tests are green and all the MR threads are closed.

Moving to Needs Review again for a new round of reviews.

Thanks to everyone who has worked to make it possible!

ckrina’s picture

Agh! I forgot to reference #3441576: Add a new "Navigation user links" menu in favor of hardcoded links in NavigationUserBlock when I closed the thread, but yeah “someone might want to add or remove things” is a really good reason to rethink the strategy.

So we do have a follow-up so moving it to Needs Review again :)

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

catch’s picture

Status: Needs work » Needs review
mherchel’s picture

Status: Needs review » Reviewed & tested by the community

This is so beautiful. Everyone has done (and is doing) amazing work!

  • I pulled down the diff and applied it against a fresh 11.x install.
  • I tested out the functionality and it works as expected, and as intended.
  • It looks absolutely so beautiful.
  • I was able to effectively navigate around via keyboard
  • I tested in forced colors mode, and although there are are some minor issues, the menu is perceivable, operable, understandable, and robust.
  • All threads appear to be resolved.
  • I did not fully review the code, although it appears that it has been thoroughly reviewed. I will spend more time on this after it enters beta

RTBC! 🎉

ckrina’s picture

Tagging with "Needs frontend framework manager review" to make visible a missing step.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new222.65 KB
new238.61 KB

Took this for a very quick test drive and went to what I think it the hardest admin page we have... the node preview. Which looks fantastic apart from 1 very important detail. We're missing the vital "Back to content editing" button. See screenshots below:

Steps to reproduce:

  1. Install standard
  2. Install navigation module
  3. Visit node/add/article
  4. Fill in required field
  5. Press the preview button

With toolbar

Toolbar showing back to content editing button

With navigastion

Navigation missing the button

alexpott’s picture

StatusFileSize
new140.27 KB

The button is there! It is just hidden by the navigation :)

Showing uncovered back to content editing button

finnsky’s picture

Gonna hotfix

finnsky’s picture

Status: Needs work » Needs review
finnsky’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new462.37 KB


as agreed back to rtbc. also fixed module css. to fix umami preview.

alexpott’s picture

Issue tags: +Needs change record

Nice fix. So frontend themes might need to make changes to support the module. I think we need to document what changes they need to make in a change record attached to this issue. Looking at the MR changes this looks like the only one a frontend theme might have to make.

catch’s picture

StatusFileSize
new40.73 KB

Took this for a test drive too and it really looks great - minor points below:

Definitely follow-up material, but I just tried installing navigation module with toolbar module already installed to see if it looked broken, and it works great... presumably we're altering away toolbar, think I saw that in the MR.

Navigation and toolbar will both need to be stable in core simultaneously for at least some amount of time, so I think we should change (or add to) the alter with an explicit hook_requirements() implementation to recommend uninstalling toolbar when navigation is installed. Maybe in navigation while it's in beta and in toolbar when navigation is stable and toolbar is deprecated?

On my 13" laptop monitor, the menu scrolls and the user/help section does not. I guess that's by design, but I kind of wondered if I could collapse only the footer so that I could fit the whole menu vertically.

I also wonderd if the top bar would handle the node preview back to content editing button issue that @alexpott brought up, but because it's not a local task or local action, it can't do it the same way it does node local tasks. Might be a possible approach though.

(lol I tried to post this and it failed, because that's already been fixed, making the preview slide over works too).

plopesc’s picture

Thank you for your reviews.

Navigation already provides a basic hook_requirements() implementation: https://git.drupalcode.org/project/drupal/-/merge_requests/7474/diffs#80...

If you think it can be improved, or is not descriptive enough, we could update it.

catch’s picture

Ah I didn't spot that, but yes it's there in the status report. I would maybe change it to 'Toolbar and Navigation modules are both installed' then something like 'The Navigation module is a complete replacement for the Toolbar module and disables its functionality when both modules are installed. If you are planning to continue using Navigation module, you can uninstall the toolbar module now"? But even more follow-up material given it already exists.

catch’s picture

Oh one more thing, I just tried out the layout builder configuration which I felt bad for even suggesting in the first place. It took me a few seconds to realise that the layout configuration was in the actual navigation itself (was expecting the usual full page layout), but as soon a I realised, my mind was blown.

Tried messing around with the block ordering, and was able to make everything fit on my laptop without scrolling by dropping the logo and the shortcuts menu item.

Customized navigation layout with no logo and shortcuts menu removed

This took about 45 seconds, can see dozens of possibilities here, really nice and what a difference from the toolbar!

So glad the half-baked suggestion actually worked.

ckrina’s picture

Issue tags: -Needs change record

I also wonderd if the top bar would handle the node preview back to content editing button issue that @alexpott brought up, but because it's not a local task or local action, it can't do it the same way it does node local tasks. Might be a possible approach though.

Yes, that would be the place since it's expected to handle contextual actions needed for the current page.

I've just created a CR but I haven't said anything about the Top Bar because it's only on its early stage, so I don't want to encourage people to enable it. For those with more experience with CR, does this makes sense?

finnsky’s picture

Issue summary: View changes
StatusFileSize
new1.31 MB

RE #44

So frontend themes might need to make changes to support the module.

Here we have case when not all modules and themes supports Drupal.displace, it is not related to Navigation module at all.

This preview panel also has problems with another displace elements. Also fixed in last commit.

ckrina’s picture

Issue summary: View changes

Updated the release notes section.

mherchel’s picture

Fixes in #41 are correct, but do not take into account RTL because it's using logical properties with Drupal displace (which is not language direction aware).

Fix incoming in a couple min.

mherchel’s picture

RTL issue with node preview container is fixed. Good to go!

alexpott’s picture

Issue tags: +Needs change record

We also need a CR for themers that implement a frontend theme that overrides .node-preview-container like Olivero does and to tell them how to change it so it works with the Navigation module and the Annoucements module.

finnsky’s picture

@alexpott so maybe revert last fixes? they are really not about Navigation module. as described in #50

mherchel’s picture

I would argue that it doesn't need a CR (although if you disagree I'm happy to do it). This was a legitimate issue that pre-existed both the announcements and navigation modules. The same issue would affect anything using the off-canvas dialog, or any other component that uses drupal.displace() and the node preview container.

mherchel’s picture

Issue tags: -Needs change record

Change record created at https://www.drupal.org/node/3443793

Note that we had a bit of discussion in Slack at https://drupal.slack.com/archives/C7AB68LJV/p1714124756817409

ckrina’s picture

Since I've been mostly doing code review during the initiative and all the front-end related issues found on the MR have been either addressed here or follow-ups have been opened, I feel comfortable removing the "Needs frontend framework manager review" tag.

  • lauriii committed dae38539 on 11.x
    Issue #3438895 by finnsky, larowlan, plopesc, m4olivei, ckrina, mherchel...

lauriii credited Anandt846.

lauriii credited baluv3.

lauriii credited bnjmnm.

lauriii credited chetan 11.

lauriii credited ctrlADel.

lauriii credited dead_arm.

lauriii credited gdd.

lauriii credited hooroomoo.

lauriii credited hot_sauce.

lauriii credited iro.

lauriii credited javi-er.

lauriii credited jponch.

lauriii credited jwilson3.

lauriii credited markie.

lauriii credited Mithun S.

lauriii credited NikMis.

lauriii credited pjudge.

lauriii credited q0rban.

lauriii credited rkoller.

lauriii credited sani.

lauriii credited Shreya_th.

lauriii credited silviu.

lauriii credited Silviu S..

lauriii credited SKAUGHT.

lauriii credited Svitlana.

lauriii credited tedbow.

lauriii credited vensires.

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

I opened #3443843: Mark Navigation as beta experimental to decide on beta stability, so that we can commit the module as alpha before that. I noticed that there are some comments missing, and other minor things that could be improved. I don't think these need to block the commit because it would be much easier to fix these outside of this massive MR, especially given that the contrib module is now out of sync.

Committed dae3853 and pushed to 11.x. Congrats everyone! 🎉

xjm’s picture

Note that this only goes in the release highlights if it gets to beta and is therefore in the tagged release, so we can tag that issue when it lands. :)

catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Fixed » Patch (to be ported)

Moving to 'to be ported' for 10.3.x. It needs #3443843: Mark Navigation as beta experimental to be decided first. But also if we're not going to backport this to 10.3, we need a 10.4 branch asap so we can backport it and any commits to that branch - otherwise we're going to have a complicated rebase/cherry-pick sequence to deal with.

aaronmchale’s picture

Absolutely fantastic to see this get committed 🎉

I'm proud to have played a small apart in this! A huge achievement by all involved, well done!

  • catch committed 7bef6b10 on 10.3.x authored by lauriii
    Issue #3438895 by finnsky, larowlan, plopesc, m4olivei, ckrina, mherchel...
catch’s picture

Status: Patch (to be ported) » Fixed

I've cherry-picked this (had to resolve some merge conflicts, hopefully did that correctly) to 10.3.x along with all the other issues committed for navigation, so that even if we decide not to release it as beta in 10.3.x, we can branch 10.4.x with navigation included and delete it with a single rm -rf from 10.3. Or if it goes in as beta to 10.3.x, then it'll be ready to go without the cherry-picks blocking a beta.

Retrospective review of the 10.3 commit to make sure I didn't mess up the merge conflicts would be welcome.

longwave’s picture

fazni’s picture

Amazing good job +1

  • lauriii committed dae38539 on 11.0.x
    Issue #3438895 by finnsky, larowlan, plopesc, m4olivei, ckrina, mherchel...

Mithun S changed the visibility of the branch 3438895-add-the-new to hidden.

prashant.c’s picture

Amazing, happy to see this moving to the core. Well done!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ana barcelona’s picture

Adding my organization

xjm’s picture

Fixing attribution.