Problem/Motivation

Having the save button in the top horizontal toolbar for content editor screens is a huge time saver. I was wondering if it would be possible to move the save button into the toolbar for other admin screens as well e.g. edit content type

Steps to reproduce

N/A feature request

Proposed resolution

Move action buttons to sticky header, show more actions kebab menu and move secondary actions into menu

User interface changes

Moves actions to sticky header

Setting:
Only local images are allowed.

Feature:
Only local images are allowed.

Issue fork gin-3356717

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

HeikeT created an issue. See original summary.

heiket’s picture

Issue summary: View changes
heiket’s picture

Issue summary: View changes
saschaeggi’s picture

This is also on our roadmap. If you have dev resources to implement this, we can move ahead with this.

heiket’s picture

Perfect. I will get somebody on this asap!

saschaeggi’s picture

@HeikeT any news on this? :)

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

saschaeggi changed the visibility of the branch 3356717-moving-the-save to hidden.

lroels’s picture

Looking good and I agree this would be a timesaver.

Only place I still notice the button on the bottom is on block forms.
Might need to add this unless this is an intentional exception.

saschaeggi’s picture

Title: Moving the save button into the toolbar for site builder screen e.g. edit content type » Move Action buttons to sticky header
Version: 8.x-3.0-rc2 » 8.x-3.x-dev

@LRoels fixed, thank you!

saschaeggi’s picture

StatusFileSize
new219.74 KB

I've pushed another change to include a proof of concept to move other actions to a kebab menu. It uses a container so it would be possible to move things in or out of that menu, but by default we would show all buttons which are not primary functions (submits) to that kebab menu.

saschaeggi’s picture

Issue summary: View changes
saschaeggi’s picture

saschaeggi’s picture

We're making big progress here, I'm very exciting to finally have this unified across the UI 🎉

saschaeggi’s picture

Status: Active » Needs review
saschaeggi’s picture

jrockowitz’s picture

StatusFileSize
new507.39 KB

This looks and feels like a nice improvement to the Webform form builder UI. There are a few minor issues that probably need to be fixed via Webform.

For example, the form builder uses Ajax to refresh to table when an element is added or updated. The 'Save' button is fine but the status message is not displaying and fading away.

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

volkerk’s picture

I tested this and moving the action buttons to static on configuration pages is a nice touch!
About the more actions dropdown I had a few thougths.

  • Does it make sense to have the more actions functionality only kick in when there is more than a number of actions?
    Also might be nice to have that configurable.
  • I would suggest that we introduce alter functionality to be able to exclude certain actions from the dropdown button.
  • I am not sure about having the meta sidebar toggle inside the more dropdown button. It is somehow central to the edit experience and also shows state?
saschaeggi’s picture

@volkerk

Does it make sense to have the more actions functionality only kick in when there is more than a number of actions?

I'd rather have it consistent.

I would suggest that we introduce alter functionality to be able to exclude certain actions from the dropdown button.

We actually thought about that as well, if you add '#gin_action_item' => true to form action items, they will always be visible (credit to Jürgen)

I am not sure about having the meta sidebar toggle inside the more dropdown button. It is somehow central to the edit experience and also shows state?

The sidebar can be toggled with a shortcut. But we might want to move the toggle anyway to the sidebar element itself. Can be done in a follow-up though.

saschaeggi’s picture

saschaeggi’s picture

saschaeggi’s picture

Adding credits from people testing 👀

saschaeggi’s picture

Status: Needs review » Fixed

Thank you everyone involved here! This is a huge deal and will pave the way to integrate this into Core at a later point ❤️✊

saschaeggi’s picture

Special thanks to Jürgen with all your help, this would habe not been possible without your help!

saschaeggi’s picture

Issue summary: View changes
onnia’s picture

StatusFileSize
new6.8 KB
new7.5 KB

I could not find any reason why the sidebar icon has been changed? To my eye that looks odd. Can I get some arguments why this has been done?
https://git.drupalcode.org/project/gin/-/merge_requests/420/diffs#6b572a...

Sidebar icon old

Sidebar icon new

fmacia’s picture

Maybe an automatic exception for the delete button could be made? I expect some less technical users losing their mind over the delete button "disappearing" from the form.

zebda’s picture

Is there a way to get all the options out of the kebab menu? I don't find it very user friendly.

rajab natshah’s picture

Thank you, Sascha, for having this in Gin + thanks for the API for it.

With further testing and trying to change the logic on the unlock or delete buttons.
Experimented with the Gin API on this

Any one can custom

      // Move unlock to be a gin action item.
      if (isset($form['actions']['unlock'])) {
        $form['actions']['unlock']['#gin_action_item'] = TRUE;
      }

      // Move delete to be a gin action item.
      if (isset($form['actions']['delete'])) {
        $form['actions']['delete']['#gin_action_item'] = TRUE;
      }
After a review with our product lead and product owner.
The direction went to follow with the new change by the Gin Admin theme

Only keeping the logic in Issue #3436163: Moved the Save as Draft moderation state element next to preview and Save in the Edit content with workflow

Which could work with the following and a bit of styling

      // Set the group for moderation status to be in Gin Actions sticky header.
      $form['moderation_state']['#group'] = 'gin_actions';

      // Move moderation state dropdown to be a gin action item.
      $form['moderation_state']['#gin_action_item'] = TRUE;

When the Workflow module is enabled
Reverting

Suggesting that maybe Gin could have support for the Moderation status position, when the workflow module is enabled, and the content/entity is configured to use it.

Status: Fixed » Closed (fixed)

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

zebda’s picture

@Rajab I tried your code in the hook_form_alter but it doesn't work. How do you use this to exclude items from being hidden?
-- Update
My fault. It had to be in the hook_form_alter after all. For some reason my head turned the TRUE in to a FALSE because it was a negative statement. I should NOT be in the kebab menu. Any how the code works. Thanks a lot.