Admin nav should use Drupal displace API

Created on 2 August 2023, 11 months ago
Updated 16 August 2023, 10 months ago

The new navigation should use the Drupal displace API to inform themes that it exists, and what it’s width is. This lets themes fix position elements, without overlapping the HTML elements.

More information on the displace is at https://www.drupal.org/node/1956804 β†’

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mherchel Gainesville, FL, US

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

Comments & Activities

  • Issue created by @mherchel
  • Assigned to claireristow
  • πŸ‡¨πŸ‡¦Canada claireristow

    Working on this now!

  • @claireristow opened merge request.
  • πŸ‡¨πŸ‡¦Canada claireristow

    Hey @mherchel, I'm struggling to find a way to make Drupal.displace work with CSS transitions. Since the sidebar width transitions when collapsed/expanded, the main page content position can't be calculated until the transition is complete, causing a delay/glitch. Check out the tugboat for the visual. I'm wondering if you have any insight on this one?

  • Issue was unassigned.
  • Status changed to Needs work 11 months ago
  • Status changed to Needs review 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mherchel Gainesville, FL, US

    Just pushed some changes that should resolve the issue. The remaining bug is if the page is loaded with the navbar in the wide state, and then switched to the narrow state, the transition will does not apply on the very first state change. Other than that, it looks good IMO.

  • πŸ‡ͺπŸ‡ΈSpain ckrina Barcelona

    Closing πŸ› The sidebar in umami appears on top of the content Closed: duplicate in favor of this one. But moving here the discussion:

    I mentioned:

    Yeah, that's a really good question. In "theory" yes per https://api.drupal.org/api/drupal/core%21modules%21system%21templates%21..., but the reality is that a lot of front-end themes want to have full control of their markup which as can be seen in the off-canvas change record: [#2896596].

    Maybe it would be a good thing to discuss it with @lauriii as the old Front-end framework manager that might have enough context of what happened, @bnjmnm (and the rest of FFM) and other experienced devs to see what can be the best solution.

    I'd personally think yes, we should rely on having the standard off canvas and if somebody wants to customize it they can do it, but this is would definitely be a breaking change and wouldn't let us do it in a minor? Let's discuss it :)

    See the comments it triggered in the Change Record for the New Off-Canvas dialog: [#2896596]

    Also, @bnjmnm mentioned this as FEFM:

    deally Umami would leverage off canvas offsets since it's used as a reference for how to fully take advantage of Drupaly things. I think it's also perfectly acceptable to not expect this navigation to work that way on all themes, as long as there are measures taken to ensure it's visible in nearly any theme (even if it's on top of the content instead of pushing it over). CSS layers should hopefully allow this without z-index chaos.

  • πŸ‡ΊπŸ‡ΈUnited States bnjmnm Ann Arbor, MI
  • πŸ‡ͺπŸ‡ΈSpain ckrina Barcelona
  • πŸ‡¨πŸ‡¦Canada claireristow

    Here is a summary of our Zoom discussion about using the drupal-off-canvas-main-canvas class for the shifting of main page content.

    We have decided to move forward with this method. We discussed adding padding to the body element as an alternative but agreed that this would likely cause more headaches than the off-canvas approach. The worst case scenario if a developer removes the off-canvas class would be that the sidebar overlaps with some content when logged in.

    We agreed the following should be done to help communicate the importance of keeping the off-canvas class when customizing themes:

    1. We will add a comment in HTML explaining the use of the off-canvas class and what will happen if it is removed (sidebar overlap with main page content).
    2. We will add this as a note in the changelog.
    3. If/when an article is written about changes to the Drupal sidebar, this should be mentioned as something devs should look out for when customizing themes.
  • Assigned to claireristow
  • Status changed to Needs work 10 months ago
  • πŸ‡¨πŸ‡¦Canada claireristow

    I am going to work on that remaining bug that @mherchel flagged in comment #6

  • Issue was unassigned.
  • Status changed to Fixed 10 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024