Add contextual link for the whole Navigation bar to link to the Navigation Admin UI

Created on 3 January 2024, 11 months ago
Updated 27 April 2024, 7 months ago

Problem/Motivation

In 📌 Create an administration UI for managing Navigation Sections Needs work we attempted to use contextual links for each navigation block. It lead to a cluttered UX where in some cases, the user was not able to click the actual link in the navigation bar, it was totally obstructed by the contextual link.

Proposed resolution

This task is to implement a solution that would consist of a single contextual link for the whole of the navigation bar. The link would take the user to the Navigation Admin UI.

Remaining tasks

Implementation of a single contextual link for the navigation bar. Design review and adjustments to avoid obstructing the use of the navigation bar.

User interface changes

A contextual link would be added for the whole navigation bar.

📌 Task
Status

Closed: works as designed

Version

11.0 🔥

Component
Navigation 

Last updated about 11 hours ago

No maintainer
Created by

🇨🇦Canada m4olivei Grimsby, ON

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

Merge Requests

Comments & Activities

  • Issue created by @m4olivei
  • 🇮🇳India prashant.c Dharamshala

    If we just want to make one link that always takes the user or admin to the configuration page "/admin/config/user-interface/navigation-section" I don't think it's needed. The admin can already go to this page using the module's configure link or by going to "/admin/config" For me, having this link doesn't make sense. I'd like to hear what others think about it.

    Thank you.

  • 🇪🇸Spain ckrina Barcelona

    We do want a quick way to get to this admin screen from the toolbar/navigation bar itself for usability reasons: it'll make it easier to find the place where it's managed, and it'll mean less clicks. So if a user has the permission to manage the toolbar, the contextual link should be available.

    What I would suggest is that the contextual region is around of the content area only, and not the footer or the top header. It's the only region we'll let people customize for now.

  • 🇨🇦Canada m4olivei Grimsby, ON
  • First commit to issue fork.
  • Status changed to Needs work 10 months ago
  • 🇪🇸Spain plopesc Valladolid

    Hi folks,

    Started to work on this issue and was able to add the necessary HTML markup to the navigation bar to show the contextual link, as you can see in the image or in the Tugboat environment.

    However, I have been unable to make it visible due to the complexity of the navigation styles and my limited frontend skills. It seems like there are styles that hides it. @m4olivei mentioned that individual block contextual links were hidden to avoid UX issues, so the issues I'm having could be related to those modifications.

    Would be great if someone with better FE skills could take a look and confirm whether it works or not.

    Regarding the implementation itself, contextual module "automates" the process of adding the contextual links, assuming a generic twig template structure. Given that navigation bar has a more complex structure, I ended up doing it in a manual way. Once we have the link visible, we could try to improve it if necessary.

    Thank you!

  • First commit to issue fork.
  • 🇷🇺Russia kostyashupenko Omsk

    Fixed template a bit. Now you can see contextual links. However it requires design.
    Current behavior is:

    1. Contextual links are sticky on scroll - not sure if we need it

    2. Contextual links can overlap "close" icon for

    3. Contextual links in collapsed variant can overlap logotype

  • 🇨🇦Canada m4olivei Grimsby, ON

    Nice, this is looking good as a starting point to review and get some design input. Thanks for putting together all those screenshots @kostyashupenko. Perfect way to review.

    @plopesc found one issue with the contextual links definition. See MR thread.

  • 🇪🇸Spain ckrina Barcelona

    As mentioned in the call today, the contextual link doesn't have to be sticky. The menu itself is more important than accessing the admin page to manage the menus. Adding/rearranging menus might happen 2-3 time per project, using the menu continuously. So the priority is that the menu can be easily used regardless of the contextual link: meaning contextual links shouldn't get in the way.

    That said, and since I can't access this Tugboat environment and judging from the screenshots: the icon should land on the margin on top of the first menu link, but not on top of the logo. It should actually wrap the menus, not the whole area. Quick idea of what I'm trying to explain:

  • 🇨🇦Canada m4olivei Grimsby, ON
  • Pipeline finished with Success
    10 months ago
    #79047
  • Pipeline finished with Success
    10 months ago
    Total: 298s
    #79056
  • 🇷🇺Russia kostyashupenko Omsk

    Just figured out new problems. Regarding position on expanded navigation - clear. We also can make it non-sticky on scroll. Works fine locally (but i didn't push anything for now).

    However here is the issue in collapsed state.
    Here is default position i tried to implement (equal spaces above contextual circle and below):

    But when i'm hovering first menu link - it's a bit overlapped by contextual link:

    But when i'm trying to browse contextual menu, a big part of contextual menu goes out of viewport:

    Obviously i tried to display contextual menu bar in collapsed navigation from left side till right (by default it grows from the right side to the left, that's why it's trimmed on my previous screenshot). However it didn't help:

    Because parent divs has overflow: auto; - which is totally fine, navigation menu is vertical scrollable.
    So all these attempts are really noising to me and i wasn't able to come up with something better. I also was thinking with `position: fixed` for contextual links in collapsed variant -> but in that case it will be kind of "sticky" on scroll, because position fixed will overlap everything. So not sure where exactly i have to put contextual links in collapsed variant.

    Also no issues at all in expanded variant.

  • 🇷🇺Russia kostyashupenko Omsk

    Maybe i will say dumb thing, but what if we will not use UI provided by contextual core module, and instead we will have "Edit Navigation Bar" just regular link (same link as menu links in our navigation), with icon. Like this:

    I'm suggesting it because:
    1. It can be a static link which is always visible / pretty clear to the user. It's in the style of navigation design. Shown no matter if navigation block is hovered or not.
    2. Works perfect already (thx to already written js) in collapsed state
    3. Initial behavior of contextual links is to show circle with pencil icon only when container is hovered. Which points me to the though - we will need to rewrite javascript of contextual module to adapt our needs for collapsed navigation behavior.

  • 🇪🇸Spain ckrina Barcelona

    ckrina changed the visibility of the branch 3412116-add-contextual-link to hidden.

  • 🇪🇸Spain ckrina Barcelona

    ckrina changed the visibility of the branch 3412116-add-contextual-link to active.

  • Pipeline finished with Success
    8 months ago
    Total: 277s
    #124327
  • Pipeline finished with Success
    8 months ago
    Total: 318s
    #124334
  • Pipeline finished with Success
    8 months ago
    #124338
  • Pipeline finished with Success
    8 months ago
    Total: 51s
    #124418
  • Pipeline finished with Success
    8 months ago
    Total: 50s
    #125341
  • Pipeline finished with Success
    8 months ago
    Total: 56s
    #134262
  • Pipeline finished with Success
    8 months ago
    Total: 55s
    #136164
  • 🇺🇸United States KeyboardCowboy Denver, CO, USA

    With @ckrina: The admin navigation is not as likely to be edited consistently after the site is built, so we feel this can be downgraded to minor.

  • Pipeline finished with Success
    7 months ago
    #152721
  • 🇪🇸Spain ckrina Barcelona
  • Status changed to Closed: works as designed 7 months ago
  • 🇫🇮Finland lauriii Finland

    I'm not sure I agree we should show contextual link for the navigation. The feature to customize the navigation is great for power users, but it seems unlikely that most users would customize the menu. Basically as @KeyboardCowboy is saying, even for power users it's something you'd once and then never do it again. Because of this, I think the contextual link is adding extra noise that is not warranted. We already hide contextual links elsewhere in the admin UI for similar reasons.

  • Pipeline finished with Success
    6 months ago
    Total: 866s
    #173469
  • Pipeline finished with Success
    5 months ago
    Total: 196s
    #196127
  • Pipeline finished with Success
    5 months ago
    Total: 135s
    #196154
  • Pipeline finished with Success
    5 months ago
    Total: 1017s
    #197860
  • Pipeline finished with Success
    5 months ago
    Total: 168s
    #198232
  • Pipeline finished with Success
    5 months ago
    Total: 168s
    #198233
Production build 0.71.5 2024