Problem/Motivation

Drupal core has added a new Navigation module which adds a new administrative navigation UI: https://www.drupal.org/docs/develop/core-modules-and-themes/core-modules...

Proposed resolution

Adopt the new Navigation module for farmOS's main menu.

There are some things to figure out (and maybe clean up), so let's use this issue to document and track findings and progress...

Remaining tasks

TBD

User interface changes

Use new Drupal core Navigation module for the main navigation menu in farmOS.

API changes

TBD (maybe changes to the way modules add menu items and/or customize icons?)

Data model changes

None.

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

I think this would allow us to remove the Admin Toolbar module as a dependency. See: #3449462: Future of Admin Toolbar if Toolbar is removed from Drupal core

m.stenta’s picture

Also curious about the "New API for icon management" in Drupal core: https://www.drupal.org/node/3490350

Perhaps we can leverage this instead of all the random CSS rules we have for customizing toolbar icons.

Related discussion in Gin: #3510801: Update Core Navigation Icon Overrides

m.stenta’s picture

I have started a 4.x-navigation branch in my fork to start exploring/chipping way at this: https://github.com/farmOS/farmOS/compare/4.x...mstenta:farmOS:4.x-naviga...

My approach is basically:

  1. Start by installing Navigation, and uninstalling Toolbar and Admin Toolbar.
  2. Review and remove all Toolbar-specific hooks and CSS.
  3. Figure out what needs to be fixed/updated...

The Navigation module has its own logo configuration, separate from the Gin theme. I added a commit to set that to the same logo, but it doesn't look great. Navigation expects a 40x40 logo (square aspect ratio), but ours is 100x25 (rectangular). It's displaying, but we'll need to make it look better...

Other initial observations:

  • All of the icons are broken in the menu. These will need to be fixed.
  • The menu contains a few things we don't necessarily want... like links for "Files" (to /admin/content/file), "User" (to /admin/people/create), and "Help" (to /admin/help).
  • The "Records" menu item seems to be highlighted by default when you are on the dashboard, or on /assets/* and /logs/*.
  • The action buttons appear as separate buttons, not as a Gin dropbutton. (see related: #2513056: Show entity action buttons on canonical entity pages as action links )

See the attached screenshot.

m.stenta’s picture

The action buttons appear as separate buttons, not as a Gin dropbutton.

Another related observation:

The submit buttons for forms get moved up into the top right, as well (same place as action links).

The consistency of this is nice, but it is a pretty disruptive UX change... anyone who expects to find a form submit button at the bottom of the page will be confused until they find it in the top right.

Notably, Gin already does this in our entity edit forms (when editing assets, logs, etc). But it does not do it for other forms (eg: quick forms), so that's where the change would be.

m.stenta’s picture

StatusFileSize
new63.42 KB

The submit buttons for forms get moved up into the top right, as well (same place as action links).

Attached a screenshot of the planting quick form to show what I mean.

m.stenta’s picture

I'm also seeing some issues with action links and primary/secondary tabs on assets/logs...

The "Edit" and "Revisions" are missing entirely. And only one action link is showing ("Add Log: Seeding" in the screenshot).

It seems that Navigation moves the primary tabs up into a dropdown next to the action links. I'm not sure where the secondary tabs are. We have some special logic to make Drupal's normal entity primary tabs ("View", "Edit", "Revisions") into secondary tabs, so that we can add our own primary tabs like "Logs". So we'll have to figure out how to rework things with Navigation...

Attaching two screenshots for comparison.