Page MenuHomePhabricator

[Technical] Remove SkinTemplate::getPortletData and SkinTemplate::getPortletLabel
Closed, ResolvedPublic1 Estimated Story Points

Description

As follow up work to the introduction of SkinComponentMenu we should dry up the SkinTemplate::getPortletData and SkinTemplate::getPortletLabel methods to use the SkinComponentMenu

TODO

  • Add is-empty field to SkinComponentMenu
  • Make getPortletData a final protected method on Skin so that it can access the SkinComponentRegistry
  • Remove the getPortletLabel method

Event Timeline

Change 840576 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] Remove SkinTemplate::getPortletData and SkinTemplate::getPortletLabel

https://gerrit.wikimedia.org/r/840576

Change 840576 merged by jenkins-bot:

[mediawiki/core@master] Remove SkinTemplate::getPortletData and SkinTemplate::getPortletLabel

https://gerrit.wikimedia.org/r/840576

I'm noticing the absence of the language button in the visual regression reports

Screen Shot 2022-10-18 at 5.17.24 PM.png (1×3 px, 1 MB)
and am wondering if its related to this change?

Suggest running Pixel against a revert to see if they are restored. If so, then yeh we should revert this and try again (or submit a follow up!) :-) @Mabualruz could you take a look?

Note: This did not make the branch cut so no backports/reverts needed if we can sort this out by the end of the week.

@Mabualruz I created a revert at https://gerrit.wikimedia.org/r/c/mediawiki/core/+/844496 and then ran ./pixel.js reference -b latest-release followed by ./pixel.js test -c 844496 . That resulted in 0 failures which suggests https://gerrit.wikimedia.org/r/c/mediawiki/core/+/840576 is resulting in the visual changes currently shown on https://pixel.wmcloud.org/reports/desktop/index.html . For future reference, these include:

Screen Shot 2022-10-19 at 9.46.02 AM.png (974×3 px, 194 KB)

Screen Shot 2022-10-19 at 9.46.48 AM.png (1×3 px, 313 KB)

Screen Shot 2022-10-19 at 9.46.25 AM.png (972×3 px, 437 KB)

I am trying to locate where did it fail to add the Add Languages. should we revert to minimise impact until I can find the fix?

Change 844548 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/core@master] Remove SkinTemplate::getPortletData and SkinTemplate::getPortletLabel

https://gerrit.wikimedia.org/r/844548

I added support for before and after html in the SkinComponentMenu.php, and passed the value of after from Skin.php. beforeHtml is done through hooks it seems I would prefer to look into it to make the workflow of after and before similar, so we can provide the SkinComponentMenu.php with values and let it handle the cases.

For now htmlBeforeContent is just a place holder logic that should abide to changes once we aligned with workflows like htmlAfterContent

LGoto set the point value for this task to 1.Oct 20 2022, 5:02 PM

Change 844548 merged by jenkins-bot:

[mediawiki/core@master] Add portlet support for after html in the SkinComponentMenu.php

https://gerrit.wikimedia.org/r/844548

Pixel is still flagging 4 issues . The remaining ones relate to the user dropdown.
The labels are no longer wrapped in spans.

Screen Shot 2022-10-20 at 3.02.02 PM.png (204×438 px, 31 KB)

Change 845071 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Pass linkOptions to menu items

https://gerrit.wikimedia.org/r/845071

Jdlrobson raised the priority of this task from Low to High.

Bumping to high as current state is a potential train blocker for next week.

Change 845071 merged by jenkins-bot:

[mediawiki/core@master] Pass linkOptions to menu items

https://gerrit.wikimedia.org/r/845071

Change 845737 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/core@master] Convert SkinComponentMenu `is-empty` from string to boolean

https://gerrit.wikimedia.org/r/845737

Change 845737 merged by jenkins-bot:

[mediawiki/core@master] Convert SkinComponentMenu `is-empty` from string to boolean

https://gerrit.wikimedia.org/r/845737

nray reassigned this task from nray to Mabualruz.
nray updated the task description. (Show Details)