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

CommentFileSizeAuthor
current-action.png146.75 KBplopesc

Issue fork drupal-3501465

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

plopesc created an issue. See original summary.

plopesc’s picture

Title: Navigation Top Bar Page Actions dropdown shoud not include link to the current page » [PP-1] Navigation Top Bar Page Actions dropdown shoud not include link to the current page
Status: Active » Postponed
Related issues: +#3484575: Move the Edit button outside the more actions drop down

Postponing 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.

plopesc’s picture

Title: [PP-1] Navigation Top Bar Page Actions dropdown shoud not include link to the current page » Navigation Top Bar Page Actions dropdown should not include link to the current page
Status: Postponed » Active

Working on this one since the parent issue has been already merged!

plopesc’s picture

Status: Active » Needs review

MR created including test coverage.

berdir’s picture

I 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.

plopesc’s picture

Title: Navigation Top Bar Page Actions dropdown should not include link to the current page » Navigation Top Bar Page Actions dropdown should not include link to the current page and order should respect local tasks weight
Issue summary: View changes

Good 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.

gxleano’s picture

Review steps

  1. Install a Vanilla Drupal site (Drupal 11.x) and Enable Navigation Top Bar module
  2. Create node and visit the node page
  3. Confirm that page actions dropdown is there and the "Edit" options is NOT visible when expanded

See evidences:
Only local images are allowed.

gxleano’s picture

Status: Needs review » Reviewed & tested by the community

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

  • nod_ committed ba0fa0ea on 11.x
    Issue #3501465 by plopesc, gxleano, berdir: Navigation Top Bar Page...

nod_’s picture

Status: Reviewed & tested by the community » Fixed

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!

plopesc’s picture

Status: Fixed » Closed (fixed)

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