[Experimental Navigation] Improve menu permissions handling and UX in Gin

Created on 23 May 2025, 10 days ago

Problem/Motivation

Hi,
The experimental navigation feature in the Gin theme introduces several functional and UX issues, especially related to user permissions and how menu links are rendered. These issues negatively affect the admin experience.

Access permissions are ignored:

  • Navigation links such as Create content, Media Library, Files, and Content listing are visible to all users, even if they lack permission to access them. Clicking these links leads to an Access Denied page.
  • Configuration menu icons are shown without labels if the user doesn't have access to the corresponding menu item. This causes confusion in the interface (e.g., Configuration > Reports icon is visible, but the label is missing).

Custom menu items under "Content" are missing:

  • Custom or contrib Modules add child links to the "Content" section. These links are lost because the entire section is rebuilt programmatically, instead of being dynamically pulled from the existing menu structure.

Parent menu links are not clickable:

  • Links like Users, Extend, Themes, and Configuration are not clickable, reducing navigation usability. These should link to their respective overviews.

Cache actions are incomplete:

  • The Flush caches link is available under Configuration > Tools, but there's no way to flush all caches from this section.
  • Suggestion: rename the parent label to Caches, and move the Flush all caches link to the top of this sub-section

Steps to reproduce

  1. Create a user with limited permissions.
  2. Enable Gin's experimental navigation.
  3. Browse through the admin menu:
    • See icons without labels.
    • See links the user cannot access.
    • Notice missing child links added by contrib/custom modules.
    • Observe that parents like Users or Configuration are not clickable.

Proposed resolution

  • Check each link's accessibility with ::access() or appropriate access methods before rendering it.
  • Hide both the icon and label of inaccessible links to avoid UI confusion.
  • Dynamically merge child menu items from the admin menu (e.g., under "Content") instead of rebuilding it from scratch.
  • Make parent menu items clickable using their defined route URLs.
  • Rename the Tools menu group to Caches and insert the Flush all caches link as the first child.

I understand this will require some hardcoded logic, but I believe a bit of hardcoding is preferable to a fully dynamic approach that results in a less ergonomic user experience.

Marc

🐛 Bug report
Status

Active

Version

4.0

Component

User interface

Created by

🇷🇪Réunion Martygraphie Saint-Denis (Réunion)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Martygraphie
  • 🇨🇭Switzerland saschaeggi Zurich

    Hey Marc

    Thanks for putting this together. Unfortunately we'll not develop the feature any further in Gin as it has since been moved to Core as an experimental module! We'll soon remove our experimental implementation. You can already use Core's version by enabling the navigation module.

    Feel free to test out Core's implementation and directly provide feedback towards the Core issue queue.

    Cheers!

  • 🇷🇪Réunion Martygraphie Saint-Denis (Réunion)

    Hi @saschaeggi,
    I find this quite unfortunate.
    Your approach enables a modern solution without relying on two separate modules (Layout Builder and Navigation). However, since I don’t use the Layout Builder module in my projects, I find it burdensome to enable such a complex module just to manage an admin toolbar.
    I’m taking the liberty of submitting my patch, which addresses all the related points.....

    Marc

Production build 0.71.5 2024