Remove sticky action buttons
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3541810. -->
Reported by: [jurgenhaas](https://www.drupal.org/user/168924)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Gin implements a sticky action header container which contains form action buttons that are sticky in the top-right corner of the screen. This is a similar behaviour to local tasks with the new top bar from the navigation module.</p>
<p>In order to have a consistent UX, it's been suggested to remove Gin's sticky header container, and instead handle the form actions by a TopBarItem plugin.</p>
<p>The way this works is that the action container in the form gets hidden, and the exposed action items are managed by javascript to forward click events to the real matching form button. Extra effort is required when the form contains ajax components, as the use of those updates form IDs, and therefore Gin's javascript needs to update the exposed action items so that their click events still can be forwarded to the correct matching form element.</p>
<h3 id="proposed-solution">Proposed solution</h3>
<p>Let's remove Gin's proprietary implementation of sticky action items and use a TopBarItem plugin instead.</p>
<p>This is a bit more complex than anticipated. Here is what we probably will have to do:</p>
<ul>
<li>As themes can't implement plugins, let's add this extra feature to the existing <code>\Drupal\navigation\Plugin\TopBarItem\PageActions</code>. That will have the extra benefit that we only get one "hamburger" menu with secondary items which contains the local actions and less important action item together. If we were to implement Gin's action items in a separate plugin, we would end up with 2 drop downs, which will certainly be confusing to end-users.</li>
<li>Implement a form after build hook that collects the action items from forms and registers them in e.g. <code>NavigationRenderer</code> from where the plugin can afterwards collect and add them to the top bar.</li>
</ul>
<p>That hook also needs to be implemented in the navigation module and executed last, so that it's able to collect even those action items that are altered by other modules. However, if OO hook support for themes lands in Drupal 11.3 as well, which we really hope, then this can remain in Gin. But OO Hooks would certainly help us a lot to get rid of all the include files that Gin currently uses. It seems that @nicxvan is working on it but of course there is no ETA available.</p>
> Related issue: [Issue #3530849](https://www.drupal.org/node/3530849)
issue