Loading code twice sows confusion in developers and bloats code for end users.
Following on from T257265, the mediawiki.page.ready module was recently enabled on mobile.
This module contains currently inert code that binds a click handler to #pt-logout a[data-mw="interface"] to provide a "smart logout". This selector matches nothing in Minerva and is duplicated here: https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/f915d69872b0f4e3e9c93903adb49889cdb6033a/resources/skins.minerva.scripts/initMobile.js#L269
I see two possible solutions for paying off this technical debt:
- Match the core selector - requires supporting IDs on MenuEntry items and adding data-mw=interface attributes
- Allow customization of the selector via the SkinPageReadyConfig that Minerva is already using and update the selector
it seems 1 would be preferable.
Developer notes
- Matching the selector will require adding data-mw="interface" to main menu links. It seems this could easily be hardcoded to all links in includes/Skins/menuGroup.mustache.
- The ID of the li item in menuGroups could be derived from the existing name e.g. id="pt-{{name}}" or provided explicitly via changes to the model
Gotchas:
- Note in non AMC there are 2 links that would match such a selector
- Mustache inherits parent properties. Be careful not to inherit the ID of the parent group e.g. #p-personal
QA steps
On both Vector and MinervaNeue skins:
- Click the logout button
- A notification message should show telling you that you are logged out
- You should be logged out.
QA Results - Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T259200#6829409 |
| 2 | ✅ | T259200#6829409 |
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T259200#6841368 |
| 2 | ✅ | T259200#6841368 |



