Right-click for contextual menu

Created on 6 February 2025, 2 months ago

Problem/Motivation

Currently, when a page loads, several contextual menus with contextual links are generated. Many of them won't even be used because the user won't necessarily see all the contextual menus. Such contextual menus affect the cacheability of the page as well because the links are different for different users, etc. Also, the contextual menu icon (a little cog icon) often floats over important UI elements and makes it difficult to see what lies underneath.

Steps to reproduce

Install and use the contextual module.

Proposed resolution

Consider showing contextual menus in a different, more performant way.

- On page load, contextual menus are not built or rendered.
- Items that have a contextual menu are rendered with special attributes like: data-entity-type="node" data-entity-id="19" data-contextual="true"
- When the user right-clicks on such an element, an AJAX request loads the menu for the item in question.
- If the parent item also has a contextual menu, there should be a way to see the contextual menu for the parent item.
- If a UI element must be used to represent the presence of a contextual menu (say, the cog icon or 3 vertical dots), the menu should be loaded when such an element is clicked.

Remaining tasks

TBD

User interface changes

TBD

Introduced terminology

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Feature request
Status

Active

Version

11.1 🔥

Component

contextual.module

Created by

🇨🇦Canada jigarius Montréal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024