Page MenuHomePhabricator

[Regression] CSS selector for vector menu label is not generic enough
Closed, ResolvedPublic

Description

The gerrit change I9a2ebd50, to the CSS which is applied to vector menus with labels (currently only the "variants" menu, from LanguageConverter), do not scale for other similar menus. Anyone wanting to add a new vector menu with a visible title analogous to the "variants" will have to duplicate the CSS because the new CSS is now only for the "#p-variants #mw-vector-current-variant".

I noticed this because the formatting of a menu like that added by one of my user scripts changed after I replaced the h4 by an h3 [1], and the reason is that this selector doesn't apply to it anymore. Gadgets such as [2] might have the same kind of problems.

Consider changing the selector to something like
div.vectorMenu .vectorMenuLabel
or
div.vectorMenu h3.vectorMenuLabel
(and updating the code which generates the menu accordingly).

[1] https://pt.wikibooks.org/w/index.php?diff=242001
[2] https://en.wikipedia.org/wiki/Special:PrefixIndex/MediaWiki:Gadget-MenuTabsToggle


Version: unspecified
Severity: normal

Details

Reference
bz43406

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:06 AM
bzimport added a project: Vector.
bzimport set Reference to bz43406.
He7d3r created this task.Dec 25 2012, 12:16 PM

You have a point. I didn't really know how to do it well (per the commit message: "I changed the bonkers structure to two <h3>s, one with id=mw-vector-current-variant. This is still broken, but I don't really know how to do it properly.").

If you know how to make this structure less crazy, please do. :) Right now there are two consecutive headings, which makes absolutely no sense at all. Either it should just be one heading (with one label), or a heading and a div or something. It could also use one heading with contents such as "zh-cn (Variants)", where the "(Variants)" part is the generic heading and would be hidden with CSS, and "zh-cn" is the label.

(Also, the breaking changes caused by this change were advertised on wikitech and wikitech-ambassadors.)

The way I did the "Variants" menu here was the root cause for bug 66364. Let's get rid of it at last. One label is enough.

As for the original complaint, now both of Vector's dropdown menus include a text label by default (as requested per bug 44591).

Change 138368 had a related patch set uploaded by Bartosz Dziewoński:
Stop using a retarded structure for Vector's variants menu

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

Change 138369 had a related patch set uploaded by Bartosz Dziewoński:
Stop using a retarded structure for Vector's variants menu (cont.)

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

Change 138368 merged by jenkins-bot:
Stop using a suboptimal structure for Vector's variants menu

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

(Note that you'll need to wait for HTML cache to expire before you stop seeing the old structure in pages, up to 30 days after the change is deployed.)