Problem/Motivation

I just updated to 1.0.0-rc6 today and see that the fix per this issue #3394027 is causing a problem when gin_lb and layout_builder_admin_theme are both enabled. The sidebar is fixed, cannot be collapsed, and intrudes into the content area.

I use these two modules together on every site I run and would prefer the arrangement prior to rc6 with the action buttons above the content area.

Can the patch in issue #3394027 be further targeted so that the new enhancements are inactive when layout_builder_admin_theme is enabled?

Thanks.

Steps to reproduce

  1. Install Gin theme, Gin Layout Builder, Layout Builder Admin Theme, and set Gin as the default Administration theme
  2. On /admin/appearance/settings/gin, set Navigation (Drupal Toolbar) to "Horizontal, Modern Toolbar", enable "Show Secondary Toolbar in Frontend" and Save
  3. Enable Layout Builder for some entity display
  4. Create a page of that entity type and edit the page in Layout Builder mode
  5. Notice the sidebar is fixed and there are no options to hide, collapse, or reposition horizontally above

Proposed resolution

When Gin Layout Builder and Layout Builder Admin Theme are both enabled:

  1. My preferred resolution would be to leave the action buttons in a horizontal arrangement above the content area.
  2. An alternate resolution would be to fix the missing sidebar toggle when Layout Builder Admin Theme is enabled.
  3. A third possibility is to give the user the option of positioning the action buttons either horizontally above or in a collapsible sidebar. Could this be accomplished as an option in Gin Settings /admin/appearance/settings/gin?

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork gin_lb-3424508

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

goldin created an issue. See original summary.

goldin’s picture

Issue summary: View changes
stmh’s picture

This is also happening for us, and we are not using the layout_builder_admin_theme.

solideogloria’s picture

Version: 1.0.0-rc6 » 1.0.x-dev
solideogloria’s picture

solideogloria’s picture

Priority: Normal » Major
StatusFileSize
new73.92 KB
new108.1 KB

I am using the Layout Builder Admin Theme module as well. Here are some screenshots, before and after updating Gin Layout Builder.

Before (rc5):

screenshot of the layout builder before the breaking changes

After (rc6):

screenshot of the layout builder after the breaking changes

Notice where I have indicated with red dotted line that the right portion of the blocks are hidden behind the settings sidebar, and I cannot click the edit/configure button for blocks.

JavaScript Errors

In addition, you'll notice that the sidebar itself is a little messed up. The checkbox to create a new revision does not show. There are also some JavaScript errors in the browser console.

Uncaught TypeError: Cannot read properties of null (reading 'setAttribute')
    at Object.showSidebar (sidebar.js?sa91ma:26:22)
    at sidebar.js?sa91ma:11:94
    at Array.forEach (<anonymous>)
    at Object.init (sidebar.js?sa91ma:9:55)
    at Object.attach (sidebar.js?sa91ma:5:25)
    at drupal.js?v=10.2.4:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.4:162:34)
    at big_pipe.js?v=10.2.4:153:10
    at big_pipe.js?v=10.2.4:184:3

Uncaught TypeError: Cannot set properties of null (setting 'checked')
    at gin_lb_preview_regions.js?v=10.2.4:21:39
    at Array.forEach (<anonymous>)
    at Object.attach (gin_lb_preview_regions.js?v=10.2.4:7:42)
    at drupal.js?v=10.2.4:166:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (drupal.js?v=10.2.4:162:34)
    at big_pipe.js?v=10.2.4:153:10
    at big_pipe.js?v=10.2.4:184:3

Debugging

Uncaught TypeError: Cannot set properties of null (setting 'checked')

In gin_lb_preview_regions.js, these two constants are null:

        const toolbarPreviewRegion = document.getElementById(
          'glb-toolbar-preview-regions',
        );
        const toolbarPreviewContent = document.getElementById(
          'glb-toolbar-preview-content',
        );

This appears to happen because the hook gin_lb_preprocess_toolbar__gin_lb is never called. The preprocessToolbarGinLb would be called in that hook, and that's the function that adds the Preview Regions and Preview Content checkboxes that are missing.

Also, I just realized that even after reverting to Gin LB rc5, I still have this JS error, and those two checkboxes still don't show. You can see from the "before" screenshot that they aren't there. I will post a separate issue for this:

#3427472: Preview Regions and Preview Content checkboxes are missing

solideogloria’s picture

Issue tags: +Regression
solideogloria’s picture

StatusFileSize
new40.78 KB

The user sub-menu is also unclickable, as when hovering over my username, the sub-menu is covered by the sidebar. Changing the sidebar .glb-sidebar z-index to 101 instead of 103 would fix that.

user sub-menu is hidden by the sidebar

solideogloria’s picture

Title: UX issue when Gin Layout Builder and Layout Builder Admin Theme are both enabled » The new sidebar makes UI unusable when using Layout Builder Admin Theme

Shorter title

solideogloria’s picture

Does anyone know how to fix this, such as by making the sidebar closable, or by making it push the UI behind it to the left so it can be clicked? It would be nice to have a patch so that I don't have to pin the module to rc5.

solideogloria’s picture

Status: Active » Needs review

solideogloria’s picture

I adding padding-right to the body element for the layout builder. This is the same thing Gin does on its edit page in its toolbar.scss.

Please review to see if the changes fix the issues.

solideogloria’s picture

Status: Needs review » Needs work

This still needs work, as the Gin sidebar on the edit form has a way to hide it, which is important on small screens and mobile. This sidebar cannot be hidden, so it breaks all useability on small screens, since it cannot be hidden.

solideogloria’s picture

StatusFileSize
new106.3 KB

Still, better than before.

screenshot after the latest changes. The sidebar pushes the body content to the left, rather than covering the right side of the content.

Admins might not need to use this functionality on small screens, so this at least makes it so that you can use the latest version of the module.

goldin’s picture

Status: Needs work » Needs review

@solideogloria Testing MR91 and yes it appears to solve the overlap issue with the sidebar. However I am also finding that the contextual links for sections have disappeared (repositioned out of the viewport). I narrowed it down to .layout-builder__section {position: relative;} seems to be missing from gin_lb.css in your fork?

solideogloria’s picture

Can you tell me what .scss file that would be in? If you look at my changes to files, nothing affected that in an scss file.

Also, is there a way to disable minification of CSS in the yarn build? It's impossible to see what changed in the CSS when it's all minified.

christian.wiedemann’s picture

Hi, Is this still happening in the 3.x branch?

christian.wiedemann’s picture

Status: Needs review » Postponed (maintainer needs more info)
solideogloria’s picture

Status: Postponed (maintainer needs more info) » Needs review

I'm not on Drupal 11 yet.

phjou’s picture

StatusFileSize
new672 bytes

I have the same issue on Drupal 11.

It seems like when in layout builder I do not have data-drupal-admin-styles or #extra-specificity-hack where the close button is and consequently the styles are not applying.

I created a small patch that works for me by adding the data-drupal-admin-styles attribute on the container of the toolbar but I am not sure that should be the long term solution.

phjou’s picture

Actually I just discovered there is an issue in the latest version of gin. The button doesn't show even with node edit, I used this patch:
https://git.drupalcode.org/project/gin/-/commit/7667bb0b7d3c1bded7622252...
#3567613: Show sidebar toggle is not usable

And it works perfectly now without the patch I shared previously.