Problem/Motivation

The Layout Builder uses core's off-canvas "tray" when adding/editing blocks to a layout. It opens the tray on the right side of the page, but it's not very wide, and as a result it doesn't accommodate larger block forms very well. This is most evident when adding block that has a textarea field w/ CKEditor:

ckeditor tray

This problem surfaced in #2948064: Layout Builder should support inline creation of Custom Blocks using entity serialization.

An interesting issue to follow that may help resolve this is #2916781: Allow off-canvas dialog to be rendered at the top of the page.

Proposed resolution

  1. Add a visual indicator "handle" so it's more obvious that the left edge is draggable.
  2. Add a "toggle width" button in the title bar (next to close). Clicking this maximises the width to not quite full screen width. Clicking it again returns the sidebar to its previous width.
  3. Remember the width that the user has set for the sidebar on and restore that when the dialog opens.

Remaining tasks

Confirm the proposed solution is the way to handle this.

User interface changes

If a user changes the configuration for the off-canvas tray width, the off-canvas tray will appear wider.

API changes

None, I think.

Data model changes

New config: system.site:off_canvas.width

Release notes snippet

Issue fork drupal-2951547

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:

  • 2951547-off-canvas-tray-width-option Comparechanges, plain diff MR !4412
  • 11.x Comparecompare
  • 2951547- Comparecompare
  • 9.5.x Comparecompare

Comments

bkosborne created an issue. See original summary.

tedbow’s picture

You can easily pass width in dialog options to make the off-canvas dialog wider. Right now it defaults to 300px unless the page is narrow and then covers the whole page.

Another option would be to create another off-canvas render like off_canvas_wide that would set a wider width automatically. That way it would more likely that core and contrib would have the same width when needed the "wider" dialog.

On thing to think about though with layout is that having wider dialog will also more likely invoke a breakpoint that will shift the layout. Maybe this isn't a concern but thought I would mention it.

Another option would be to have a off_canvas_full render which always take up the full width of the page. But then is there benefit of using dialog vs a another page?

bkosborne’s picture

What about an option to have it render from the bottom horizontally instead of on the right in a sidebar? Not necessarily built in as an option in the UI, but if contrib had a way to change that, that would allow site builders to use a tray from the bottom instead, like Panelizer IPE does now. It leaves much more room for form items.

meba’s picture

Can we just check what systems like Adobe Experience Manager do and inspire ourselves there?

johnwebdev’s picture

You can easily pass width in dialog options to make the off-canvas dialog wider.

Can we also make sure that this is easily done without having to override various parts with custom controllers or use JavaScript from a contrib. perspective?
For instance if #2916781: Allow off-canvas dialog to be rendered at the top of the page lands there are more options on where you want the canvas to be, and even if Layout Builder has sensible defaults it would be nice to override.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

r_h-l’s picture

Another field affected by this is a multi-image field. The remove button is pushed completely off the screen. Have to modify the CSS to 800px wide to get it wide enough to appear.

sam152’s picture

Can we also make sure that this is easily done without having to override various parts with custom controllers or use JavaScript from a contrib. perspective?

I think this would be a great place to start, that way there are options for an integration point for people to experiment. How about we follow the lead of what node does and do something like \Drupal\node\Controller\NodeController::addPage, provide a theme definition for the list of blocks a user can add. That way, there is a template that can be overriden and a list of links that can be preprocessed.

sam152’s picture

Status: Active » Needs review
StatusFileSize
new4.04 KB

Here is an implementation of #8. It would be cool to actually do the same with selecting the section to add. That would satisfy the needs of contributed modules like layout_builder_restrictions which currently uses some non-api tactics to alter the list.

johnwebdev’s picture

#9 Nice! 👏 This is much better. And works!

Top of my mind:

  • We can still use the details theme definition within our block list for the default implementation.
  • At the point where the developer can change the link attributions (which I suppose are the most interesting to change), they are already nested. Which means they have to implement a double foreach loop to change them. Wondering if we can fix that?
tedbow’s picture

Status: Needs review » Needs work

I like the idea of being able to edit these links.

I tried to use the preprocess hook to change links for inline blocks to be modals

function tester_preprocess_layout_builder_choose_block_list(&$variables, $element) {
  if (!empty($variables['categories']['Inline blocks']['links'])) {
    foreach ($variables['categories']['Inline blocks']['links']['#links'] as &$link) {
      $link['attributes']['data-dialog-type'] = ['modal'];
      $link['attributes']['data-dialog-options'] = Json::encode(['width' => '500px']);
      unset($link['attributes']['data-dialog-renderer']);
    }
  }
}

but ran into couple problems

  1. The off-canvas still remains open #2983120: OffCanvas dialog doesn't close when opening a standard Dialog. existing problem to figure out
  2. new issue #3012044: Off-canvas dialog resize doesn't work if modal is open
  3. After you submit the form the modal does not close because \Drupal\layout_builder\Controller\LayoutRebuildTrait::rebuildAndClose() has $response->addCommand(new CloseDialogCommand('#drupal-off-canvas'));

    We could somehow change or extend \Drupal\Core\Ajax\CloseDialogCommand to have CloseCurrentDailogCommand. This would use \Drupal\Core\Ajax\AjaxHelperTrait::getRequestWrapperFormat() to close the current dialog.

Of course if we just expect people change the width of the off-canvas then the above won't be a problem but I think will sometimes want to use the modal dialog.

Just changing this

$link['attributes']['data-dialog-options'] = Json::encode(['width' => '500px']);

Actually does work.

Settings to needs work because we either need to document that you shouldn't use the modal or figure out how you can.

tedbow’s picture

If we want modules and themes to be able control the dialog that is used for the block forms they will also have to edit the contextual links used for update forms.

I guess this is possible via hook_contextual_links_view_alter but the DX is not great there I think for determining what type of block is being updated.

If a module/theme wanted to update all update links regardless of type it wouldn't be too hard.

/**
 * Implements hook_contextual_links_view_alter().
 */
function tester_contextual_links_view_alter(&$element, $items) {
  if (isset($element['#links']['layout-builder-block-update']['url'])) {
    /** @var \Drupal\Core\Url $url */
    $url = $element['#links']['layout-builder-block-update']['url'];
    $attributes = $url->getOption('attributes');
    if (isset($attributes['data-dialog-options'])) {
      $dialog_options = Json::decode($attributes['data-dialog-option']);
    }
    else {
      $dialog_options = [];
    }
    $dialog_options['width'] = '500px';
    $attributes['data-dialog-options'] = Json::encode($dialog_options);
    $url->setOption('attributes', $attributes);
  }
}
sam152’s picture

Hm, all good points. Changing the whole approach from the outside is still a tricky endeavour, perhaps this issue should instead just focus on making the canvas wider from within layout builder.

I'd still be interested in #9 to clean up modules like layout_builder_restrictions though.

johnwebdev’s picture

I think we should just include a comment for now stating we're only supporting dialog/off-canvas , and make the modal proposal a follow-up which by the way could be a pretty nice contrib. module.

andypost’s picture

Btw it could be configurable, at least it makes sense to allow core to override dialog type

tedbow’s picture

re #13

I'd still be interested in #9 to clean up modules like layout_builder_restrictions though.

I think this refers to

That would satisfy the needs of contributed modules like layout_builder_restrictions which currently uses some non-api tactics to alter the list.

But actually I don't think that code is need any more. layout_builder_restrictions_plugin_filter_layout__layout_builder_alter mentions // Invoke deprecated API hook for restricting layouts. @todo: remove.

Though I am not positive I think the new hook hook_plugin_filter_TYPE__CONSUMER_alter should be the only thing you need to remove layouts or plugins from the list.

mark_fullmer’s picture

But actually I don't think that code is needed any more. layout_builder_restrictions_plugin_filter_layout__layout_builder_alter mentions

Confirming that layout_builder_restrictions does not use the EventSubscriber any longer; that was in place for legacy sites prior to the introduction of hook_plugin_filter_TYPE__CONSUMER_alter().

tedbow’s picture

Status: Needs work » Needs review
StatusFileSize
new852 bytes
new4.38 KB

Rerolled the patch and added a comment about not changing the dialog type. Added the comment in the template. Not sure if there is better place.

jidrone’s picture

Status: Needs review » Needs work

Hi everyone,

I think the patches on this issues don't provide a solution to improve UX of larger block forms how the title says.

Using hook_preprocess_layout_builder_choose_block_list doesn't work for inline blocks creation because they don't come in $variables['categories'] .

I think a real solution for this issue is to make the links for inline blocks creation to open in a modal window, but I understand it depends on #2983120: OffCanvas dialog doesn't close when opening a standard Dialog.

tedbow’s picture

StatusFileSize
new605 bytes

@jidrone good catch. this because #2968500: Change inline blocks workflow in Layout Builder to match mocks was committed and inline blocks are no longer in the main list.

But since \Drupal\layout_builder\Controller\ChooseBlockController::getBlockLinks() is used in both the case of the main block list and the inline block links we could simply allow modules to use a preprocess on this links if they want to change the width of the dialog.

Technically a module could do this now with mymodule_preprocess_links but this would be invoked for all links. If change #theme though to links__layout_builder_blocks they could implement mymodule_preprocess_links__layout_builder_blocks. This would allow edit the link attributes in the same way I was suggesting in #18 expect you would not need a new template.

The only problem is #2968500: Change inline blocks workflow in Layout Builder to match mocks introduced the "Create Custom Block" link which if there is only one type of custom block link directly to the custom block form. So in that would not be able to alter the link that opens up the inline block form.

tedbow’s picture

Status: Needs work » Needs review
tedbow’s picture

StatusFileSize
new1.29 KB
new1.54 KB

Here is a fix for the "Create custom block" link. It also uses '#theme' => 'links__layout_builder_blocks', for the 1 link.

We should probably descope this issue or use this patch for a new issue "Allow easier altering of block configuration links". But want to leave this here for discussion.

jidrone’s picture

Hi @tedbow,

Would be great to send a variable to know the category of links to make easier to alter only the links of Inline block creation for example.

tim.plunkett’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs issue summary update

NW for #22

tedbow’s picture

Opened #3032456: Allow easier altering of Layout Builder block configuration links

leaving this issue open to discuss other ux problems with large forms

sam152’s picture

@tedbow, what do you think of resurrecting #18. I have some ideas about alternative ways of displaying lists of blocks in the sidebar, and that approach provides a structured way to approach it.

If #22 has been spun off into another issue, do you still think #18 is valuable, and if so, what are the blockers to getting it done?

tedbow’s picture

@Sam152

what do you think of resurrecting #18.

#18 pretty just provided template for the block listing but I don't think we would need that if we did #3032456: Allow easier altering of Layout Builder block configuration links

or did you want be able to have the specific theme/template for the hole list to be able alter in another module or theme?

sam152’s picture

Exactly that, altering the whole component would have been nice when implementing: https://www.drupal.org/sandbox/sam/3033243. Something I needed based on expecting many thousands of content blocks.

michaellander’s picture

StatusFileSize
new298.37 KB

I think for the large quantity of block content entities problem, just making it alterable might be a great way to go. I could foresee someone implementing a button to open Entity Browser so you could filter/tag/etc to locate the block.

For larger configuration forms and content block edit forms, either a modal/overlay or ability to drag the offset tray with a handle could be a great solution.

One of my modules has a fairly large configuration form for the block, and the space limitation will be more difficult to work around.

Smart Content Block Form

This is something that could definitely be solved on my end with a bit of creativity, but we may be more limited with content block edit forms with a large number of field widgets.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

murz’s picture

Another workaround for edit blocks in full page is to find block id, and open standard block edit form. This can be done via modifying /admin/structure/block/block-content views for show reusable=false blocks. This will show all blocks from Layout Builder, with link to full block edit form. So will be good to add "Edit block" contextual link to each block with link to full edit form.

chris burge’s picture

There's a solution in contrib that addresses this issue: Layout Builder Modal.

(IMHO, this is best addressed in core.)

adam-delaney’s picture

StatusFileSize
new107.08 KB

Being able to expand the system setting tray similar to how Ckeditor maximize works would be nice.

adam-delaney’s picture

@Murz, good idea! Providing a contextual link to edit the block entity as a full page callback seems like a no-brainer. I feel like this should be available out of the box. Providing quick access to that edit page within the block editing interface within the systems settings tray should be provided as well.

rlnorthcutt’s picture

Contextual link to the block edit form with the "use-ajax" class and data properties would be turn key.

cyb_tachyon’s picture

There's a couple of things to think about here:

  1. The default width of 300 is insufficient for custom blocks and many core blocks as it stands.
  2. Not every interface needs the default of 300 for the editor width provided by \Drupal\Core\Ajax\OpenOffCanvasDialogCommand::DEFAULT_DIALOG_WIDTH.
  3. Modules modifying layout builder would likely want to customize the display a bit for their specific use only.
  4. A theme hook improvement only solves this issue at a theme scale and would introduce theme bloat to many modules while not allowing them to specify enhancements for only their blocks.

I'd like to propose the following solution, and if I don't hear any screeching alarms, we can roll a patch:

  1. Layout builder's block configure display is set to 900 via $attributes['data-dialog-options'] = '{"width": 900}'; in core/modules/layout_builder/src/Controller/ChooseBlockController.php:235.
  2. Layout builder is enhanced to read optional display (dialog) overrides from Block Plugin Definitions if they are present at core/modules/layout_builder/src/Controller/ChooseBlockController.php:159
    • This would allow custom coded module blocks to do things like present in a modal, display at the top, etc.
cyb_tachyon’s picture

StatusFileSize
new784 bytes

Changes layout builder default block configure display width to 900.

webchick’s picture

Issue tags: +AcquiaUXTest

Just a quick note that this issue came up during recent UX testing we did on Layout Builder.

joshf’s picture

FWIW I was able to leverage @cyb.tachyon 's approach using hook_contextual_links_alter() to create a wider tray for our client without needing any core patches.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

muranod’s picture

When I click Add Section, I have to alternately widen and narrow the window several times to see the whole width of the box (fortunately, I'm using dual monitors, otherwise this would not work without zooming the browser window contents way down in size. This is erratic though, and does not always work. It seems to be related to the viewport.

I'm using Bootstrap theme, Drupal 8.7.9.

Even if I can get the form to where it is visible and usable, it snaps back to a narrow column whenever anything within the form is clicked. Tried in Firefox Developer, Chrome and even IE. Also, the form sometimes disables scrolling of the whole browser window, and even when it doesn't, the form itself won't scroll with the other contents of the window (the page I'm editing).

Happy to provide any other info, but I'm not a coder. I did play around with the css and some of these seemed to help when I applied them in FF Developer, though I did not apply them into my site's stylesheet:

#drupal-off-canvas form { width: 600px; }
.dialog-off-canvas-main-canvas { padding-right: 100px; }

Look forward to trying it when I can get to the settings.

cyb_tachyon’s picture

StatusFileSize
new1.92 KB

Updated patch that handles the block contextual edit link as well as section links (for sections with configuration forms).

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

luke.leber’s picture

re: #37 - we've found that a strategic preprocess hook can also achieve this. It's not exactly a performant solution, but does avoid a core patch in order to make the 'add block' dialog wider. Thanks for the idea!

/**
 * Implements hook_preprocess_HOOK().
 */
function my_module_or_theme_preprocess_links(&$variables) {
  foreach ($variables['links'] as &$link) {
    if (!isset($link['link']['#url'])) {
      continue;
    }
    $url = $link['link']['#url'];
    if (!$url instanceof Url || $url->getRouteName() !== 'layout_builder.add_block') {
      continue;
    }
    $link['link']['#attributes']['data-dialog-options'] = '{"width": 900}';
  }
}

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

christopherdoherty made their first commit to this issue’s fork.

christopherdoherty’s picture

StatusFileSize
new2.81 KB

Updated patch for v9.5.x.
Sets dialog width to 900px for these tasks:
- configure section
- configure block
- move block
- remove block

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pyrello made their first commit to this issue’s fork.

pyrello’s picture

Status: Needs work » Needs review

So, I went the route of making this a piece of configuration. There is no Admin UI yet for changing it. The benefit of this method is that to change the setting for all relevant links, you just need to update the configuration.

I'm sure there's things that I missed and there are no tests for the updates yet, but I set to "Needs review" so that someone can tell me what is missing and what should be tested.

luke.leber’s picture

FWIW - Gin LB's approach in letting the content creator resize their own sidebar is pretty nice :-).

pyrello’s picture

@Luke.Leber thanks for pointing that out. I haven't had a chance to dig into the Gin LB implementation yet, but it looks similar to the core's (mostly hidden) off-canvas resizing capabilities. The main difference seems to be that in Gin LB they have the tray on top of the canvas, not next to it.

azinck’s picture

I've found the sidebar tray solution utterly unworkable for any significant content creation. For folks with the same problems I recommend https://www.drupal.org/project/layout_builder_iframe_modal as it frees up a LOT more space.

johnpitcairn’s picture

Coming in very late here ... I've recently been using Gin LB, and further customizing the off canvas sidebar dialog to:

  • Add a visual indicator "handle" so it's more obvious that the left edge is draggable.
  • Add a "toggle width" button in the title bar (next to close). Clicking this maximises the width to not quite full screen width. Clicking it again returns the sidebar to its previous width.
  • Remember the width that the user has set for the sidebar on a per-dialog-route basis, and restore that when the dialog opens. Stored in browser localstorage. So the block-edit width can be wider than the section-delete width, etc. I may extend this to store per-block-type widths.

I think I'd like to add a way to set the default sidebar width on a per-route and maybe per-block-type basis, then let editors customise their own experience from there as above.

I'm not a fan of any system that always covers the content, ie layout builder modal. I've reverted the Gin LB "feature" that covers content with the sidebar. The content is responsive, right?

smustgrave’s picture

Status: Needs review » Needs work

For the IS update. Also will have to dig but believe there is another ticket looking to fix the layout builder canvas.

pyrello’s picture

Issue summary: View changes
pyrello’s picture

Issue summary: View changes
Status: Needs work » Needs review

Updated IS

smustgrave’s picture

Status: Needs review » Needs work

Thanks!

Taking a look at the MR 4412 and see there is a schema change, so most likely will need a post_update hook?

Also the test failures seem legit to the issue.

pyrello’s picture

Status: Needs work » Needs review

Fixed failing tests.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs upgrade path, +Needs change record, +Needs subsystem maintainer review

Relooking at it I think it will definitely need an upgrade path

Also not sure about the no UI. Essentially someone would have to edit their yml files manually and import that way?

Going to subsystem maintainer thoughts

lauriii’s picture

The proposal in #59 sounds like a good starting point. I don't think this should be something that a site builder should have to configure because essentially the preferred width would depend on the site, and the device the editor is using. 

luke.leber’s picture

Also, re: #59

An added bonus of preventing the sidebar from overlaying the content versus "squishing" it is that editors get a more diverse preview of what they're building. It can also help crack down on some use of non-inclusive / directional language (i.e. "The image to the right...") if the editors are more likely to see how that sort of language breaks down on different viewports 👍.

johnpitcairn’s picture

Would a screen capture of this be helpful? It would be gin-based but the concepts are theme-agnostic.

johnpitcairn’s picture

StatusFileSize
new1.6 MB

Like this. The sidebar width memory is per-route, which might not be ideal given add-block and configure-block are different routes, the user might expect setting the width in add-block would be remembered when you later edit the block. There is a maximum and minimum width on the sidebar, and a set width beyond which it does overlap content (so the content is never less than say 20rem wide). The toggled full-width state is not remembered. Very much WIP.

[OK, how do I display a video here?]

https://youtu.be/OPNK4zIOmLQ

lauriii’s picture

Priority: Normal » Major

The width per route was something I wasn't 100% certain because it might make the UX more complex than it needs to be. I've always wondered why does the off-canvas region resize when you click something. Usually the pattern is that the width remains consistent, even if the sidebar contents change.

Given that, maybe we could potentially simplify this by storing a single off-canvas width in the local storage, which is used when the off-canvas command doesn't include a specific width. This way the width would remain consistent when you navigate in the off-canvas, and when the off-canvas is re-opened.

I don't know where the 300px default width comes from, but I think it would also make sense to increase that so that we have a more reasonable starting point.

johnpitcairn’s picture

Gin LB already stores a single preferred width (which I have to fight to make per-route work). We could steal that.

I think I'm likely to try to zero in on 3 narrow/medium/wide default widths, figure out how to specify which one a given dialog should use by default, but still allow the user to override that and remember it. Somehow. It sounds like a good candidate for contrib.

300px is definitely too narrow a lot of the time. I think we are limited to a pixel value by the current ancient ui dialog code? I've been overriding that in the dialog setup to a nominal 400, but overriding that in css with a calculated rem- or vw-based minimum and maximum because frankly pixels suck as a width for practically anything.

lauriii’s picture

Issue summary: View changes

The idea on 3 default widths sounds like a good idea to try but maybe we can try to keep this issue as simple as we can and leave testing ideas like this to a follow-up issues.

Changing the default value to 400 would already help a bit, so that might be a good starting point and we could open a follow-up to try to improve it further.

I believe that the next steps are (based on #59 and the discussion following that):

  1. Add a visual indicator "handle" so it's more obvious that the left edge is draggable.
  2. Add a "toggle width" button in the title bar (next to close). Clicking this maximises the width to not quite full screen width. Clicking it again returns the sidebar to its previous width.
  3. Remember the width that the user has set for the sidebar on and restore that when the dialog opens.
  4. Change the default width from 300px to 400px.

Updated the issue summary with these steps.

johnpitcairn’s picture

Change the default width from 300px to 400px.

We should modify this on devices narrower than say 480px, and screens where the vertical toolbar is present. We shouldn't ever cover the entire available width?

lauriii’s picture

On mobile, it might be fine to cover the entire screen. There's no way we could provide both, the off-canvas and the page side by side with that little space. It's not an ideal experience but not sure we can do much better with the space that we have available.

johnpitcairn’s picture

My experience is that covering the entire screen has ux issues with some users not realizing they are still on the same page, and pressing "back". Leaving a narrow margin (say 5-10%) with the page visible underneath (layout at full width) mitigates that.

But if this is how the core dialog does things and has ux sign off, fine I guess?

lauriii’s picture

That sounds like a valid UX issue. I'm wondering if we should open a separate issue for that to investigate if we could improve the designs and/or change how the navigating back behaves in this scenario?

johnpitcairn’s picture

Could do. I'll have a little time to work on this issue soon if nobody else jumps in. I have a decent POC without gin_lb now, it just needs working back into 11.x defaults.

pyrello’s picture

I would love to see improvements like those suggested in #59. We had rolled our own version of the visible drag handle and a cookie to store the width for the user. The resize functionality for the off-canvas sidebar was broken in 9.5.x (and is still broken in the latest 10.1.x versions last I checked) and we were investigating reverting back to a static width as part of moving to 9.5. That is why I produced the MR that I did. We ultimately decided to keep our enhancements and just deal with the fact that the resize functionality is wonky. Looking forward to seeing the new version. If I get a chance I can try putting together something based on our custom functionality and/or Gin LB.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.