Background
As part of the AC for T289816, gadget-injected menu items into the personal menu are cloned to the user menu of the new sticky header feature that is currently in development.
This comment on the patch associated with the aforementioned ticket outlines an issue encountered with a specific gadget called the UTC live clock which is no longer maintained. Because of how the javascript for this gadget is written, live updating of the clock relies on the original id of the cloned node (we change the ids of all cloned items to be unique in the sticky header user menu). Unless we refactor the gadget code in this particular use case, the gadget-injected menu item does not work as expected in the sticky header user menu.
Until or if we offer configuration options for gadgets to include menu links in the personal menu, cloning these items does not guarantee that they will function properly. To avoid unexpected breaking of menu items, we should remove gadget-injected menu items from the sticky header user menu for the time being.
Description
Remove gadget-injected items from the user menu of the sticky header.
Acceptance criteria
- Any gadgets that load late should not add items to the user menu of the sticky header via mw.hook( 'util.addPortletLink' ).
QA steps
- Run the following in Javascript console:
setTimeout( function () { mw.util.addPortletLink('p-personal', 'Test', 'Test') }, 1000 )
- Test should appear in the user menu of the main/fixed header, but not in the sticky header user menu.
Developer notes
This is blocked on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/720112 which adds a class allowing us to filter items added via JavaScript.
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T291426#7393897 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T291426#7393902 |