Page MenuHomePhabricator

Improve layout of language menu (columns & headings)
Closed, ResolvedPublic

Description

Description

Currently the language menu (ULS) is displaying results in a single column, without any section headings. Ideally we should display results in multiple columns when appropriate, and use section headings.

Acceptance criteria

  • Add columns and headings to ULS presentation.
  • Headings should appear as in the ULS version on https://commons.wikimedia.org and include suggested languages when applicable
currentideal
Screen Shot 2021-02-17 at 6.22.44 PM.png (408×556 px, 34 KB)
Screen Shot 2021-02-17 at 6.23.54 PM.png (371×874 px, 43 KB)

Event Timeline

ovasileva updated the task description. (Show Details)
ovasileva updated the task description. (Show Details)

I've analyzed this task. If I was to estimate this I would be an XXL at the current point. This feels a little like a mini-epic.

Currently the language menu (ULS) is displaying results in a single column

This is not true. It's actually a lot more complicated than this. A single column will be applied if either the screen width < 500 or the number of languages is less than 24

The logic for this is as follows:

			if ( screenWidth > 900 && languagesCount >= 48 ) {
				return 'wide'; // 4 columns
			}

			if ( screenWidth > 500 && languagesCount >= 24 ) {
				return 'medium'; // 2 columns
			}

			return 'narrow'; // one column

On top of this languages are currently grouped by language class when more than one column is used. A lot of thought appears to have gone into this and similar groups are grouped together and arranged by region. (see "Screenshots of current experience" below for examples)

Now... Potentially we could change the logic so language count is not considered:

langlist.gif (304×657 px, 92 KB)

For articles with a small amount of languages this might result in lists with one item, and other lists with 4 in columns.

This change however would also change the display for existing Vector usages.

For several reasons, if we want to take this on, we should do so with involvement from the language team reviewing the history of this decision and whether it should be changed.

Given the code here is extremely complicated (even for me who is somewhat familiar with the code) it is my recommendation that our team does not tinkering with the status quo without upfront support, insight, and code review from the language team.

Screenshots of current experience

https://patchdemo.wmflabs.org/wikis/796258b4f19bcff4ce8db662ed396b26/w/index.php/Spain?useskinversion=2 (282 languages)

Screen Shot 2021-02-18 at 2.32.52 PM.png (1×1 px, 302 KB)

https://patchdemo.wmflabs.org/wikis/796258b4f19bcff4ce8db662ed396b26/w/index.php/Common_Agricultural_Policy?useskinversion=2 (35 languages)

Screen Shot 2021-02-18 at 2.34.27 PM.png (1×2 px, 329 KB)

https://patchdemo.wmflabs.org/wikis/796258b4f19bcff4ce8db662ed396b26/w/index.php/Agricultural_subsidy?useskinversion=2 (15 languages)

Screen Shot 2021-02-18 at 2.37.27 PM.png (1×1 px, 637 KB)

https://patchdemo.wmflabs.org/wikis/796258b4f19bcff4ce8db662ed396b26/w/index.php/Agribusiness?useskinversion=2 (22 languages)

Screen Shot 2021-02-18 at 2.38.00 PM.png (1×1 px, 695 KB)

@Jdlrobson - got it. So if we currently have more than 24 languages, the ULS would automatically expand into columns with no extra work required. This seems okay to me and I think we can go ahead and decline this. @alexhollender - what do you think?

Talked about this today. I'll provide a patch demo for testing and Alex will close.

@Jdlrobson passing this back to you, please pass it back to me once you've had a chance to create the patch demo

Tasks looks ready to close. Quick question on something else - is there are reason the language codes are showing prior to the language name on the patch demo?

Screen Shot 2021-03-02 at 10.56.39 AM.png (844×1 px, 206 KB)

is there are reason the language codes are showing prior to the language name on the patch demo?

An issue with patch demo: https://github.com/MatmaRex/patchdemo/pull/260

thanks @Jdlrobson for setting up all of those patch demos. The menu is looking great. Are there things we'd want to QA here @Jdlrobson @ovasileva ?

No this is existing behaving and presumably QAed when this was initially built. We haven't changed anything so it doesn't seem useful to QA.