Page MenuHomePhabricator

Technical: Vector should use SkinMustache menu code in core
Closed, ResolvedPublic3 Estimated Story Points

Description

Recently the code for constructing menus in skins was upstreamed from Vector to core as part of T262098. Using this code greatly simplifies the Vector codebase.

The only thing that Vector would need to do to keep its HTML output consistent is

  1. drop the portal-first class and use nav:first-child instead
  2. Decorate the data from core to add its Vector specific classes e.g. vector-menu, vector-menu-dropdown, vector-menu-tabs, vector-menu-portal

The change will require various template changes given the data will be sourced from places with different names to those used by Vector so there is a small amount of risk, that can easily be mitigated by verifying the HTML before and after the change.

Event Timeline

Change 624909 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] Simplify menu code

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

This is going to be helpful for language work.

ovasileva subscribed.
phuedx subscribed.

The change will require various template changes given the data will be sourced from places with different names to those used by Vector so there is a small amount of risk, that can easily be mitigated by verifying the HTML before and after the change.

Will this be done manually? Should it be done prior to merging or when the task gets moved to Needs QA?

The change will require various template changes given the data will be sourced from places with different names to those used by Vector so there is a small amount of risk, that can easily be mitigated by verifying the HTML before and after the change.

Will this be done manually? Should it be done prior to merging or when the task gets moved to Needs QA?

I was thinking as part of code review it would be helpful to confirm this is a NOOP in terms of generated HTML.

It's important for us to test on a page with languages and variants.

$wgLanguageCode = 'zh'; '// enable variants
$wgHooks['SkinAfterPortlet'][] = function ( $skin, $name, &$html ) {
        if ( $name === 'tb' ) {
                $html .= '<a>BaseTemplateAfterPortlet LocalSettings link</a>';
        }
};

I was thinking as part of code review it would be helpful to confirm this is a NOOP in terms of generated HTML.

It's important for us to test on a page with languages and variants.

You patch has been merged and will soon be live on the Beta Cluster, which has wikis with language variants available IIRC. I'd be happy to work with @Edtadros on this as I think that we can use the tool I wrote to test your patch during code review.

Change 624909 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Simplify menu code

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

per standup Sam will QA this with the tool he wrote against the beta cluster

It was quite difficult to diff sets of elements between the Beta Cluster and the production wiki (the former being ahead of the latter at the time of writing). That being said, I diffed elements between de.wikipedia.org and the de.wikipedia.beta.wmflabs.org and I didn't see any classes out of place.