Problem/Motivation
We moved the local tasks into the "More actions" drops-down as they are. The problem is that the main action to edit the content is hidden behind a the More actions drop down.
Proposed resolution
When #3484564: Define the 3 areas the Top Bar will provide is ready, this issue is the next step: on the front-end, when the URL/page is rendering on a full viewmode of an entity (content, taxonomies,...), render the Edit button outside the More actions. See image 3.

This issue is to ONLY move the Edit button outside of the drop-down, not applying any of the other visual changes the image above is providing.
User interface changes
The Edit button will appear as the primary action outside the More actions drop-down.

Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | Screenshot 2025-01-22 at 6.41.59 PM.png | 373.44 KB | lauriii |
| #11 | After Move.png | 38.66 KB | sagarmohite0031 |
| #11 | Before move.png | 26.69 KB | sagarmohite0031 |
| top-bar.png | 6.05 KB | ckrina |
Issue fork drupal-3484575
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:
- 3484575-refactor-top-bar-actions
changes, plain diff MR !10667
Comments
Comment #2
kunalkursija commentedGetting started on this one locally.
Note: #3484564 is the dependency and this issue's MR can only be raised once the parent is done.
Comment #3
kunalkursija commentedChanging the version to 11.x-dev so that the Issue fork gets created from 11.x branch.
Comment #4
m4oliveiRemoving the postponed title prefix as #3484564: Define the 3 areas the Top Bar will provide is merged to 11.x.
Comment #5
ckrinaAdding the "Drupal CMS release target" to see if we could hopefully get to it.
Comment #6
ckrinaAlso adding Navigation stable blocker
Comment #7
kunalkursija commentedI have been working on this issue and have so far completed rendering the edit button and adding partial styles. Some more styling work is pending and then will be raising the MR for this.
Comment #9
kunalkursija commentedLooks like the MR has conflicts due to changes in Plugins, Hooks & Test files. I will have to look into this and update the MR accordingly.
Comment #10
kunalkursija commentedI have resolved most of the pipeline issues except the PerformanceTest that's failing. Below are the different messages that I have been getting:
Question: I noticed that core/tests/Drupal/Tests/PerformanceTestTrait.php calculates these values, but I'm unclear whether these numbers are updated based on specific criteria or the incoming test data. Could someone provide clarification?
Comment #11
sagarmohite0031 commentedHello,
Tested and verified on Drupal 11,
MR applied successfully.
Attaching before and after screenshots
Comment #12
berdirLeft a review about the edit link idenfication.
> Question: I noticed that core/tests/Drupal/Tests/PerformanceTestTrait.php calculates these values, but I'm unclear whether these numbers are updated based on specific criteria or the incoming test data. Could someone provide clarification?
It's no so much calculated, it's just what's the current expectation. If we add more CSS, then we have to increase the expectation. What's interesting is that this *lowers* the amount of cache gets/sets. That is generally good and we can just lower the values. It would be good to understand and write down which cache operations aren't happening anymore.
Comment #13
anjali rathodComment #14
anjali rathodComment #17
lauriiiComment #18
berdirDoes it make sense to postpone this on the title issue? If I understand this correctly, that one introduces an API method to fetch the current entity for which to display the title and the same logic could be applied as to when the edit button should be displayed. I think it makes sense if those two things are in sync. We should only have an Edit button if there is a title that displays for what that button?
Comment #19
finnsky commentedGonna work on it
Comment #20
finnsky commentedAt the moment, the module is still experimental.
We are still waiting for the final design.
We are still waiting for the icon system.
The task description says
So there is no need to make it fully consistent with the image. It is enough to just add the markup and roughly understand how it will work afterwards.
And even more so, there is no need to add deeply nested CSS that will be impossible to clean up later without significant effort
Also, there is no need to add new icons. In particular, the Pencil was already there. Let it be different, but there will not be many icons with the same meaning when we switch to the icon API. (I hope soon)
I also took the icon of three dots from https://phosphoricons.com/ where all the other icons came from.
I also think that there is no point in adding backend tests based on visual styles, for example, the icon type, but this is not my area and I did not change it.
@plopesc could you please review backend after rebase?
Comment #21
plopescBoth issues are related but not essentially depends one on the other, I think. Here we make use of
$this->navigationRenderer->hasLocalTasks()and that method has been moved to a new service in #3484600: Show entity information on the Top Bar. If we merge that one first, we will need to make some adjustments here and vice-versa. Agree that things would be simpler here if we merge that one first, though.We could postpone this one to have a better separation of concerns.
Comment #22
lauriii#3484600: Show entity information on the Top Bar has landed so I think we're good to proceed here 🚀
Comment #23
lauriiiI think this is looking good. I made minor tweaks to the design to make it match the original design a bit more.
Few follow-ups that we need to open:
Comment #24
plopesc#3501465: Navigation Top Bar Page Actions dropdown should not include link to the current page and order should respect local tasks weight Was already created.
Comment #25
berdir> Showing the Edit button as the primary action when viewing a forward revision
FWIW, that should be pretty trivial, just need extend the route match to allow canonical or latest_version:
(canonical|latest_version). If we also want to cover it with tests then it might get more complicated.Comment #28
nod_the dots are way too small for me, but that's subjective, no need to hold this up longer
Committed b8ed481 and pushed to 11.x. Thanks!
Comment #29
berdirThought I commented about this yesterday, follow-up issue then: #3501662: navigation top bar edit button has strange active (?) colors
Comment #30
plopescCreated follow-up #3501934: Navigation Top Bar should display Edit button as the primary action when viewing a forward revision to address the Latest version page behavior.