Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Page MenuHomePhabricator

[Potentially breaking change in Vector 2022] #p-namespaces element being replaced by #p-associated-pages
Closed, ResolvedPublicBUG REPORT

Description

We have made a minor ID change to #p-namespaces within the Vector 2022 skin. Gadgets styling this element should considering updating CSS rules that target #p-namespaces to also target #p-associated-pages. Note, related to this change, is that on Vector 2022 on special pages where only one tab is shown the tab will disappear (T313409).

This change will go out in the train that is deployed the week beginning 5th September 2022 (should be on all wikis on 8th September if all goes to plan).

Since mw.util.addPortletLink is a stable API, any gadgets adding to the p-namespaces menu using this gadget will be unaffected by this change. If you are appending directly to #p-namespaces element please update your code to reference mw.util.addPortletLink and pay attention to any console warnings.

Examples of impacted code and solutions

// old
#p-namespaces { display: none; }

// consider
#p-associated-pages,
#p-namespaces { display: none; }
mw.util.addPortletLink( 'p-namespaces', '#', '' ); // no change - this will work as usual
// before
document.getElementById("p-namespaces").style.visibility = 'hidden'

// consider
var menu = document.querySelector("#left-navigation #p-namespaces") || document.getElementById("p-associated-pages");
menu.style.visibility = 'hidden'

IF in doubt, please test your script on https://en.wikipedia.beta.wmflabs.org/

Event Timeline

Hey @Quiddity this is a really minor technical change, and we've been really careful with this one... so hopefully nobody notices anything, but I figured it does no harm for this to go out with tech news on 9th September in case we missed anything or need to consider other use cases we've missed.

Hey @Jdlrobson a few questions:

  1. if I understand correctly, something like this would be an accurate summary of the requested action? Is there a simpler way to describe "append"?

On Special pages that only have one tab, the tab-bar row will be hidden in Vector-2022 to save space. The row will still show if Gadget's use it. Gadgets that currently append directly to the CSS id of #p-namespaces should be updated to use the mw.util.addPortletLink function instead. Gadgets that style this id should consider also targeting #p-associated-pages, the new id for this row.

I'm trying to convey the exact actions-needed and news, in as few and simple sentences as feasible. (The timeline is implicitly defined by the TechNews section header of "Changes later this week")

  1. I see the linked global-search in T313409#8179832 but it appears to be missing a few entries that come up in this broader global-search, e.g. the 4th entry there is showing
getElementById("p-views").style.visibility = 'hidden'; document.getElementById("p-namespaces").style.visibility = 'hidden'; document.getElementById("p-cactions")

Is that a cause for concern, or a variant that needs to be mentioned in the blurb (and/or in the other task)?

  1. Are there any example code-updates (i.e. diff links) that could be usefully added to either the blurb, or the task Description?
  1. (meta-question) Should the TechNews entry link to this task, or the other task? (I.e. I'm not sure why it has been split. Is there a problem with adding the User-notice tag to T313409 directly, and discussing TechNews blurbs in-situ? I can grok not wanting to tangent the task, but I'm just not sure what your intent is with the separation!)
Jdlrobson renamed this task from #p-namespaces element being replaced by #p-associated-pages to [Potentially breaking change in Vector 2022] #p-namespaces element being replaced by #p-associated-pages.EditedSep 1 2022, 11:44 PM
Jdlrobson updated the task description. (Show Details)

if I understand correctly, something like this would be an accurate summary of the requested action? Is there a simpler way to describe "append"?

That sounds great.

there a problem with adding the User-notice tag to T313409 directly, and discussing TechNews blurbs in-situ?

The audiences are different. I'd like to keep T313409 focused on the user-facing part of this (the tab disappeared - you monster!), not the gadget-impacting part (you broke my gadget that is not using the encouraged mw.util.addPortletLink API - you monster! ) :)

Thanks! Added to https://meta.wikimedia.org/wiki/Tech/News/2022/36 - I'm sending it out for the 1st round of translations now, and it will be frozen for translation in ~22 hours (so edit it before then, if needed!)

Note that only the following are documented targets of mw.util.addPortletLink():

  • p-cactions (Content actions),
  • p-personal (Personal tools),
  • p-navigation (Navigation),
  • p-tb (Toolbox).

#p-namespaces and #p-associated-pages are not mentioned. Nor are any others that may exist.

I have also never found any higher-than-api-level documentation for any of these targets, and my mental model of the page is such that I essentially always have to look them up (or, more likely, cut&paste from one of my existing gadgets). Skin-independent documentation of the addPortletLink system, and skin-specific documentation of how it treats them, would reduce some hassle.

BTW. #p-personal-sticky-header also works for new sticky header. Not sure if that is intentional. I guess p-personal should add to both menus on new vector 2022.

var newElement = mw.util.addPortletLink(
  'p-personal-sticky-header',
  '/wiki/Special:RecentChanges',
  'Recent Changes',
);

Either way would be nice to document that :-)

Thanks for flagging the documentation problems. I can confirm that documentation is woefully out of date :-)

I have also never found any higher-than-api-level documentation for any of these targets,

I usually refer to the images here (which are hard to find! but do exist) https://meta.wikimedia.org/wiki/Customization:Explaining_skins#Portlets
I think there used to be an old image that combined them all, like File:MediaWiki_SpecialUpload_interface_labelled.png does for int-strings, but I can only find this more recent example File:MediaWiki_portlet_names.svg which isn't currently used on mw/meta.
I agree it would be great if some of the onwiki details could be updated.

Jdlrobson claimed this task.