Skip to content

Update a menu once while it is being shown - #4576

Open
vogella wants to merge 2 commits into
eclipse-platform:masterfrom
vogella:coalesce-popup-show-updates
Open

vogella wants to merge 2 commits into
eclipse-platform:masterfrom
vogella:coalesce-popup-show-updates

Conversation

@vogella

@vogella vogella commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

After #4567, opening a context menu still filled its dynamic items several times, since the contribution merge of PopupMenuExtender, processContents and the visibility pass of the show processor each updated the shown menu before MenuManager's own update.
Updates are now collected from the pre-show to the post-show helper, and the shown menu is left to the MenuManager update that follows, so a dynamic item of a context menu is filled once per opening.
This is what the eclipse.workaround.bug467000 timer achieves (https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000), but without its delay.
PopupMenuDynamicFillTest now also checks that the open menu contains every contributed item.
This builds on #4567, and only the last commit is new.

Part of #4566

Every merged menu contribution and every model change made while
merging updated its manager right away, so a menu with N contributions
was rebuilt N times while it was built. For context menus with dynamic
contributions this runs on every right-click, which is the slowdown
reported in bug 467000 for Papyrus and Capella. processContributions
now collects the touched managers and updates each of them once at the
end, skipping managers whose menu does not exist yet, so submenus still
fill themselves when first shown. A test checks that the dynamic items
of a view's context menu are filled as often with 20 contributions as
with one.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000
Part of eclipse-platform#4566

Assisted-by: multiple AI agents and layers of automated tooling 🤖
While a menu is about to be shown, its about-to-show listeners and the
show processor change it several times, and each change updated the
manager right away. MenuManagerShowProcessor now coalesces these updates
from the pre-show to the post-show helper and leaves the shown menu to
the update MenuManager does right afterwards, so a dynamic item of a
context menu is filled once per opening, as with the
eclipse.workaround.bug467000 timer.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000
Part of eclipse-platform#4566

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella vogella added the plan Planned bugs/enhancements for a release label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   1h 1m 9s ⏱️ + 19m 18s
 8 550 tests +2   8 310 ✅ +2  240 💤 ±0  0 ❌ ±0 
21 522 runs  +6  20 849 ✅ +6  673 💤 ±0  0 ❌ ±0 

Results for commit f064e80. ± Comparison against base commit 347808c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan Planned bugs/enhancements for a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant