Blocker: T343598 will help us determine the right API for this.
In T342814 we added a new addPortlet method. Vector and Vector legacy skins have a unique concept of "dropdowns" which is separate to the definition of a portlet and the Twinkle gadget makes use of it. We would like to provide an API to reliably construct a dropdown in these skins
Options
- Twinkle should just not use a dropdown
- Vector should surface a function mw.vectorSkin.makeDropdown
- Vector provides a hook that gadgets can subscribe to that can convert portlets into dropdowns
- Using T343598 the existing hook can be modified to determine it's a dropdown and add appropriate classes. For example if p-actions is given it could make it a dropdown.
e.g.
mw.hook( 'vector.makeDropdown' ).fire( portlet )
QA steps
Run the following code in your developer console for both Vector and Vector 2022:
mw.util.addPortlet('p-twinkle', 'TW', '#p-cactions');
mw.util.addPortletLink('p-twinkle','#', 'Hello world');Expected: A dropdown menu should appear in both skins.
In Vector 2022 it should work when menus are pinned and unpinned.
QA Results - Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T342815#9296818 |
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T342815#9325240 |





