Enhance Navigation admin workflow with Managed Tabs.

Created on 25 April 2024, 7 months ago
Updated 3 May 2024, 7 months ago

Problem/Motivation

Navigation has two separate pages in 'User interface'. While on layout blocks form a user, after either saving or clearing their storage, is left without the ability to use the actual links due to Layout API 'preview' mode. No clear attachment to rest of project flow.
- only breadcrumb on page to escape
 (after change over from tradition block placement table, pre core merge).
- ‘show content preview’ blocks links from working (in order to maintain task of configuration itself)

Steps to reproduce

- Using Drupal 11 dev line, install standard profile.
- enable Navigation module.
- goto 'Navigation settings' config page (admin/config/user-interface/navigation-settings). notice there's a lack of direction when using these pages. possible: user may remove all blocks from active layout!
https://www.drupal.org/files/issues/2024-05-02/navigation-managed_tabs-e...

Proposed resolution

  • Add tabs 'managed layout'. shift routes and 2nd 'user interface' link into this new tab.
  • Adjusts both routes and title/h1
  • Set 'Manage Settings' as default tab. parent route.
  • Add 'return to site' link beside form actions. Reminder: breadcrumbs, local task, even h1 not be available in render as these are placed blocks in real sites
  • Adjust 'preview toggle' checkbox above submit -- move up here closer to text until 🐛 (layout navigation) hook help is used to provide layout form content Active is complete.


Remaining tasks

User interface changes

Combine pages from 'user interface' group.

API changes

None.

Data model changes

None.

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Navigation 

Last updated about 7 hours ago

No maintainer
Created by

🇨🇦Canada SKAUGHT

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

Merge Requests

Comments & Activities

  • Issue created by @SKAUGHT
  • 🇨🇦Canada SKAUGHT

    stashing demo here for now:

    use Drupal\Core\Url;
    
    
      public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL) {
        $form['#attributes']['class'][] = 'layout-builder-form';
        $form['layout_builder'] = [
          '#type' => 'layout_builder',
          '#section_storage' => $section_storage,
        ];
        $form['#attached']['library'][] = 'navigation/navigation.layoutBuilder';
    
        $this->sectionStorage = $section_storage;
        $form['actions'] = [
          'submit' => [
            '#type' => 'submit',
            '#value' => $this->t('Save'),
          ],
        ] + $this->buildActionsElement([]);
        $form['actions']['preview_toggle']['#weight'] = -10;
        $form['actions']['footer'] = [
          '#type' => 'html_tag',
          '#tag' => 'footer',
        ];
    
        $form['actions']['footer']['content'] = [
          '#theme' => 'links',
          '#links' => [
          'first_link' => [
            'title' => t('Goto site Frontpage'),
            'url' =>  Url::fromRoute('<front>'),
          ],
          'second_link' => [
            'title' => t('Goto Administration Dashboard'),
            'url' => Url::fromRoute('system.admin'),
          ],
        ],
          '#attributes' => ['class' => ['links-inline']],
        ];
    
        return $form;
      }
    
  • 🇨🇦Canada SKAUGHT

    Have reviewed this initial issues in the Weekly UX meeting. We also talked about using drop-button as the safe with the 2 options. The general feeling was toward showing these footer links.

    - also on page: h1 title is too verbose.
    -
    - related: actual menu item to get here is still 'navigation block'. not 'layout.
    - IMO: we should always show the logo when editing the layout.. this is also an 'escape' button users would recogniae.
    - 'footer'. can not see a 'add block' button' during review.

    We did talk about some of the wider points around the setting tray labels could be more verbose (when selecting blocks to place)
    - what do we have 'create content block' in the header. we do not seem to have any scope for this.
    - 'add block' type should expend title 'menu' 'menu blocks' -- if uses has small screen/ready then a fuller label is present.

    @ckrina
    A more complete review for Screen readers is recommended for this new UX.

  • 🇪🇸Spain ckrina Barcelona
  • 🇩🇪Germany rkoller Nürnberg, Germany

    while i was testing the new navigation page functionality i had an idea for the "lock in" problem this issue is about. on second thought it is difficult to have a button like "save and go to page x" (the pattern we've ideated in todays meeting - you will never find one single page it would makes sense to go to from here). but since layout builder is used here why not orient towards the pattern used on the manage display page on a content type when layout builder is activated?

    when the user gets to /admin/config/user-interface/navigation-block present the help text and a "manage layout" button (the button label is still debatable). at this point the sidebar is still functional. as soon as the "manage layout" button is pressed the page goes into the "layout mode" and the sidebar switches being just a none functional preview. and by pressing the save button in that "layout mode" the user returns to the previous page with the "manage layout" button. that way the user would remain in the context of the navigation block page and the context switch would be also comprehensible and the user wouldn`t be forwarded into a sort of "detached" page where one is being trap in at the moment.

  • 🇨🇦Canada SKAUGHT

    SKAUGHT changed the visibility of the branch 3443556-layout-navigation-user to hidden.

  • 🇨🇦Canada SKAUGHT

    #11
    'managed layout' tab idea:
    Currently, the config for 'logo' is in an independent form/path in the menu. Combining these form/routes 'one tab set' would start a base for us as this time for this path. then we can add 3rd links to front and admin index. user is directed around more in a more normal drupal flow.

  • 🇨🇦Canada SKAUGHT

    change notes (solution 2) in progress:
    - title/h1 adjusted
    - routes adjusted

    wip. action links feel too heavy. (: I maybe overthinking this aspect now.

  • Status changed to Needs review 7 months ago
  • Pipeline finished with Failed
    7 months ago
    Total: 182s
    #158607
  • Pipeline finished with Failed
    7 months ago
    Total: 182s
    #158624
  • 🇩🇪Germany rkoller Nürnberg, Germany

    Unifying the two pages into a single page and using local tasks is a good idea, I like that as well, good idea. A few thoughts:

    1. I am usually for shorter menu item labels. So i wonder if it would make sense to strike settings and rename navigation settings to navigation. On one hand several menu items in the configuration submenu are using the addition of "settings" but on the other hand the first page / tab within the navigation settings also is called managed settings. plus the prefix "manage" is sort of redundant, for screenreader users, and there are also several issue to remove the verb manage from page/tab titles (for example 📌 The 'Edit', 'Manage display' and 'Manage form display' tabs were hard to understand Needs work 📌 Word Manage at beginning of multiple admin page names make them hard to distinguish. Needs review . So I wonder why not go with Navigationfor the menu items and Settings and
      Layout

      for the local items. that way all three would be nouns.

    2. I still don't like the concept of having two links, one pointing to the frontpage the other to the administration (personally none of the two would be a desired destination i would think of in the context of after adding the navigation block layout). For one having primary buttons for links doesn't feel semantically correct and still it is the same concept like for the database updater. Me as a user dislike ending up somewhere else at the end of a task other than the page i've started at. it still feels like i reached dead end. and the concept of a navigation sidebar and the preview blur on this page. with the suggestion in #11 🐛 Enhance Navigation admin workflow with Managed Tabs. Needs review it would be sort of like a toggle/switch button. the user is deliberately switching between the layout /preview mode and the actual navigation sidebar. one more click upfront but clearer and the user would remain in the context. but maybe there might be also a third option how to tackle this?
  • Pipeline finished with Failed
    7 months ago
    #158962
  • 🇨🇦Canada SKAUGHT

    #32
    1. Have added 'Remaining task' to this issue started this other acpects. I am hoping to keep some scope to this scope of adding the managed tab itself.
    2. yes. agree 2 links is too much. After some thought around this i realized adding only 1 normal link and placed beside the 2 submits buttons 'Return to site' would be that steady escape path. Also, also show logo on this form!

    @rkoller, I know I also was putting a few ideas on slack around action buttons too. these where also too much on page. Thanks.

  • 🇨🇦Canada SKAUGHT

    Improve links to "Navigation settings" pages Closed: duplicate please add cred for @matthieuscarset

  • Status changed to Active 7 months ago
  • Pipeline finished with Failed
    7 months ago
    Total: 595s
    #160053
  • Pipeline finished with Failed
    7 months ago
    Total: 624s
    #160913
  • Pipeline finished with Canceled
    7 months ago
    #161009
  • Pipeline finished with Failed
    7 months ago
    #161010
  • Pipeline finished with Failed
    7 months ago
    Total: 230s
    #161019
  • Pipeline finished with Failed
    7 months ago
    Total: 275s
    #161021
  • Pipeline finished with Failed
    7 months ago
    Total: 532s
    #161026
  • Pipeline finished with Failed
    7 months ago
    Total: 594s
    #161033
  • Pipeline finished with Failed
    7 months ago
    Total: 571s
    #161043
  • Pipeline finished with Failed
    7 months ago
    Total: 713s
    #161063
  • Pipeline finished with Canceled
    7 months ago
    Total: 124s
    #161074
  • Pipeline finished with Failed
    7 months ago
    Total: 691s
    #161076
  • Pipeline finished with Failed
    7 months ago
    Total: 747s
    #161089
  • Pipeline finished with Failed
    7 months ago
    #161105
  • Pipeline finished with Failed
    7 months ago
    Total: 727s
    #162623
  • Pipeline finished with Success
    7 months ago
    #162631
  • Status changed to Needs review 7 months ago
  • 🇨🇦Canada SKAUGHT

    Ready with tests for managed tabs flow!

  • Pipeline finished with Success
    7 months ago
    Total: 613s
    #162771
  • Status changed to RTBC 7 months ago
  • 🇪🇸Spain plopesc Valladolid

    Code looks good and the administrative UX has been improved.
    Also provides tests.

    Thank you!

  • Status changed to Needs work 7 months ago
  • 🇪🇸Spain ckrina Barcelona

    I just came across this issue and this seems like a big UX change and I need to think a bit about it: the Navigation will handle many more things beyond what we have now (like Top Bar settings), so we need to plan for that before merging pages and hiding them in deeper levels. I'd like to hold big UX changes like this until we all have had time to discuss and agree on them. This needs some time and with DrupalCon planning going on I can't keep up with all issues.

    So moving to Needs work not because the code isn't OK, but because we need to discuss the changes :)

Production build 0.71.5 2024