Problem/Motivation
Navigation Top Bar Page Actions dropdown includes options in entity pages that are taken from the page local tasks array.
Local tasks when are rendered as tabs include the current page to be marked as the active tab. However in the Top Bar context, we include the action in the "More Actions" dropdown. Including the current page there could be confusing, as seen in the screenshot:

There is an Edit link in the actions dropdown that just reloads the page, given that user is already in the Edit page.
Besides that, local tasks are not sorted in the same order as in the original tabs, we need to ensure that original weight is respected.
Steps to reproduce
- Install a Vanilla Drupal site and Enable Navigation Top Bar module
- Create node and visit the node page
- Confirm that page actions dropdown is there and the "View" options is visible when expanded
- Click on the Edit option
- Confirm that page actions dropdown is there and the "Edit" options is visible when expanded
- Confirm that page actions dropdown options are soted in a different way than original local tasks
Proposed resolution
Remove the action that corresponds to the current page in the Page Actions dropdown
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| current-action.png | 146.75 KB | plopesc |
Issue fork drupal-3501465
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:
- 3501465-navigation-top-bar
changes, plain diff MR !10984
Comments
Comment #2
plopescPostponing on #3484575: Move the Edit button outside the more actions drop down in order to work on a clena environment and avoid conflicts due to changes introduced as part of that issue.
Comment #3
plopescWorking on this one since the parent issue has been already merged!
Comment #5
plopescMR created including test coverage.
Comment #6
berdirI also noticed the order often seems strange. Layout shouldn't be before View I think. Are we somehow losing the weights of local tasks with this?
Not sure if that's something we could or want to sneak into this issue as well.
Comment #7
plopescGood point. I totally forgot to include that bit.
I think it's OK to address it while we are here to save reviewers and committers bandwidth.
Thank you for reporting.
Comment #8
gxleano commentedReview steps
Drupal 11.x) and Enable Navigation Top Bar moduleSee evidences:

Comment #9
gxleano commentedComment #13
nod_scope increase is fine but we don't have a test to ensure link order, might want a followup for that
Committed ba0fa0e and pushed to 11.x. Thanks!
Comment #14
plopescCreated #3504512: Add tests to ensure that Navigation Top Bar Page actions respect the original local tasks weight to take care of the missing test.