In use, I found that I often click the text on the dropdown button, rather than the arrow and accidentally trigger the first block type. I think an UX improvement could be changing that first option in the dropdown to something like "Add Block" so users can click the entire button to display the options.

This is a must have module for enhancing layout builder!

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

galactus86 created an issue. See original summary.

pyrello’s picture

@galactus86 Thanks for checking out the module. I took a look at the definition for the 'dropbutton' render element: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21.... It doesn't look like there is a way, using that element, to create the type of UX you are requesting. If you have a suggestion for an alternative, I would be happy to look into it. Also, if you want to provide a patch, I'll give it a look.

Thanks!

Sean

arshadkhan35’s picture

Thanks @pyrello for this amazing module, we are using this module too and wanted to have this feature where we can add new label at the top of the dropdown, Created a patch for the same which include

  • A settings from where you can choose whether you want to add a label or not with a checkbox
  • Label text is configurable in same setting form

Please have look. thanks

arshadkhan35’s picture

Status: Active » Needs review
pyrello’s picture

@arshadkhan35 Thanks for submitting a patch. I'll take a look when I have some time to review it.

arshadkhan35’s picture

Hi @pyrello please ignore #3 patch as it has some missing file , Rerolling the same patch against 8.x-1.2 tag and 8.x-1.x-dev branch.

arshadkhan35’s picture

galactus86’s picture

Version: 8.x-1.1 » 8.x-1.2
Status: Needs review » Reviewed & tested by the community

Hi @pyrello

For some reason I missed any updates on this issue so I apologize for not following up.

I applied the patch from @arshadkhan35 with Composer and so far it seems to work as described. I am able to access the config page, update the text, and then use on a Layout Page. Not seeing any errors in the logs.

And really useful module, so thank you!

pyrello’s picture

Version: 8.x-1.2 » 2.x-dev

Targeting a new version and taking the opportunity to switch to semantic versioning at the same time :)

pyrello’s picture

Version: 2.x-dev » 8.x-1.2
StatusFileSize
new13.12 KB

After testing the patch in #7, my impression is that using the dropbutton element no longer seems right when the first link is not an actual action and just a trigger for seeing the actions. This patch attempts to create a UI for what I think the experience should be like.

Feedback is definitely welcome.

pyrello’s picture

Status: Reviewed & tested by the community » Needs review

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

pyrello’s picture

StatusFileSize
new16.61 KB

Adding a patch to make testing changes to the issue fork and merge request easier.

pyrello’s picture

StatusFileSize
new14.22 KB

I always forget to add these at the time when I am adding the patch.

pyrello’s picture

StatusFileSize
new33.79 KB

Here is what it looks like in practice:

pyrello’s picture

StatusFileSize
new16.66 KB
new14.66 KB

The patch in #14 had an error in because I had failed to change a couple of variable names when I was renaming things.

New patch, new interdiff.

pyrello’s picture

pyrello’s picture

pyrello’s picture

pyrello’s picture

Status: Needs review » Reviewed & tested by the community

Based on some limited feedback in Slack and our own testing, I think I'm ready to call this RTBC. If we need to refine the UI in the future, I guess we'll open additional issues.

Thanks to everyone for your help with this.

  • pyrello committed c60b756 on 2.x
    Issue #3157440 by pyrello, arshadkhan35, galactus86, bspeare: Make first...
pyrello’s picture

pyrello’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jdhaire’s picture

Was this patch merged into v1.2? I have 1.2 installed but it does not match branch 2.x. I tried applying the https://www.drupal.org/files/issues/2021-03-17/3157440-17_0.patch without success. On drupal 9.3.4. Any direction on how to get this functionality would be appreciated. Love this idea as it saves time and reduces clicks. Thanks!

jdhaire’s picture

Nevermind! I completely overlooked the 2.x-dev (maybe add to the module page). Any way, works as expected. Is there a way to modify the + icon that displays before the label? I would like to style it to match the rest of the + icons. Thanks again! Sorry for the first message panic. Ha!