[go: up one dir, main page]

Page MenuHomePhabricator

Language selector: adjust list items style
Closed, ResolvedPublic

Description

Looking at the initial implementation of the language selector (T253303) available for Section Translation at test wiki, items in the list of languages need some adjustments:

  • Adjust item dimensions. Items should use an 8px padding on all sides except their start (32px), and have 4px margin between columns (when displayed as a dialog, in wider screens). Currently items have 4px padding on all sides except the start (32px) and some additional unexpected margins on top and after the element. See images of the inspected elements and the spec below. (See T287888#7361404 for the aspects missing)
  • Cursor on hover. Hovering a language of the list should use the "pointer" cursor (a hand communicating interactivity).
Inspected padding and marginSpec
Screenshot 2021-08-02 at 18.02.15 (2).png (600×1 px, 149 KB)
Layout spacing.png (768×1 px, 88 KB)

Pending aspects:

  • For bigger screens, the dialog box still stretches out. For wider screens the dialog does not need to stretch further.
  • On a narrow screen the separation between columns of items (in 3 column layout) is larger than the intended 4px. This can be fixed by not applying the max-width constraint in the .mw-ui-language-selector .language CSS rule. In this way items can expand to fill the column.
    Screenshot 2021-12-22 at 14.52.27.png (1×2 px, 387 KB)
  • The breakpoints may need adjustment since the narrow screen mode seems to be used for window sizes that does not seem so narrow.
  • Labels for language items are not aligned with the text in the search bar. The measurements in the spec should result in the text for the search bar and the language to follow a straight vertical scan line. However there seems to be some unintended padding/margin there making it not to be the case:
test.m.wikipedia.org_wiki_Special_ContentTranslation(iPhone 6_7_8) (1).png (1×750 px, 33 KB)
test.m.wikipedia.org_wiki_Special_ContentTranslation(iPad Pro).png (2×2 px, 373 KB)

Event Timeline

Pginer-WMF triaged this task as Medium priority.Aug 2 2021, 4:38 PM
Pginer-WMF created this task.

Change 714456 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] SX Language selector: Style adjustments

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

Change 714456 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX Language selector: Style adjustments

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

This looks good. The proposed adjustments seem in place. The only consideration is that when the selector is presented as a dialog, the separation between the columns should be 4px. Currently it expands to fill a larger space.

The current behaviour makes sense when the selector is taking the full width (on small screens), but for larger screens, it is preferred to keep such distance fixed to 4px to avoid making the selector wider than needed.

I was playing a bit with the browser inspector, and found some potential rules that may be stretching the dialog further (I marked two items as hovered to make more noticeable the distance between them):

CurrentDisabling width/height constraints
lang-sel-width-original.png (822×1 px, 305 KB)
lang-sel-width-modified.png (822×1 px, 306 KB)

The screenshot under the header "Disabling width/height constraints" is not centrally aligned in the screen right? And when we start searching for something, the number of languages quickly reduces. So if we base the dialog size on languages in it, the dialog shrinks. And the size jumps on key presses since it triggers searches. So we need some sensible width, may be adjusted for wider and extra wider screens.

The screenshot under the header "Disabling width/height constraints" is not centrally aligned in the screen right? And when we start searching for something, the number of languages quickly reduces. So if we base the dialog size on languages in it, the dialog shrinks. And the size jumps on key presses since it triggers searches. So we need some sensible width, may be adjusted for wider and extra wider screens.

Good points. I was not proposing to disable those rules as the solution. I included the screenshot to illustrate how the current spacing between columns was larger than 4px, and which were some potential rules adding the distortion. Th ideal would be to keep the column separation at 4px, the dialog centered and avoid it to shrink further as results are filtered.

I don't know the best way to translate that to CSS rules. In case a max-width is helpful., I included the expected width for two columns (348px) and three columns (512px) in the spec image above.

Change 739701 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] SX: Restrict the width of language selector on wider screens

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

Change 739701 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] SX: Restrict the width of language selector on wider screens

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

As per this patch, we restrict the max width of the dialog so that columns are not stretched apart beyond a limit in wider screens.

Change 739701 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Restrict the width of language selector on wider screens

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

Change 742284 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.1.0+20211129

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

Change 742284 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.1.0+20211129

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

Change 742849 had a related patch set uploaded (by KartikMistry; author: Santhosh):

[mediawiki/extensions/ContentTranslation@wmf/1.38.0-wmf.9] CX3 Build 0.1.0+20211129

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

Change 742849 abandoned by KartikMistry:

[mediawiki/extensions/ContentTranslation@wmf/1.38.0-wmf.9] CX3 Build 0.1.0+20211129

Reason:

Need to fix Merge Conflict first.

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

Change 742849 restored by KartikMistry:

[mediawiki/extensions/ContentTranslation@wmf/1.38.0-wmf.9] CX3 Build 0.1.0+20211129

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

Change 742849 abandoned by KartikMistry:

[mediawiki/extensions/ContentTranslation@wmf/1.38.0-wmf.9] CX3 Build 0.1.0+20211129

Reason:

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

Etonkovidova subscribed.

Checked in wmf.12 - the following spec seems to be in place I've updated the task description):

Adjust item dimensions. Items should use an 8px padding on all sides except their start (32px), and have 4px margin between columns (when displayed as a dialog, in wider screens). Currently items have 4px padding on all sides except the start (32px) and some additional unexpected margins on top and after the element. See images of the inspected elements and the spec below.

Screen Shot 2021-12-12 at 8.23.40 PM.png (1×1 px, 241 KB)

Two notes for review:
(1)

the expected width for two columns (348px) and three columns (512px) in the spec image above.

The two-column layout was not shown- not in a browser emulator (320-375px) and not on a real device (360-375px). The one-column or three-column layouts were present.

(2) For bigger screens, the dialog box still stretches out. And below 1264px, the dialog turns into an overlay (it takes all the screen). See the animated
gif below:

cx_resizing2.gif (745×1 px, 1 MB)

Two notes for review:
(1)

the expected width for two columns (348px) and three columns (512px) in the spec image above.

The two-column layout was not shown- not in a browser emulator (320-375px) and not on a real device (360-375px). The one-column or three-column layouts were present.

The two columns only apply for the suggested languages section which is not shown currently. @santhosh can clarify whether this was not implemented yet, or not enabled for this instance.

(2) For bigger screens, the dialog box still stretches out. And below 1264px, the dialog turns into an overlay (it takes all the screen). See the animated
gif below:

For wider screens the dialog does not need to stretch further. So that would require adjustment.

In addition, I noticed some additional aspects to polish:

  • On a narrow screen the separation between columns of items (in 3 column layout) is larger than the intended 4px. This can be fixed by not applying the max-width constraint in the .mw-ui-language-selector .language CSS rule. In this way items can expand to fill the column.
    Screenshot 2021-12-22 at 14.52.27.png (1×2 px, 387 KB)
  • The breakpoints may need adjustment since the narrow screen mode seems to be used for window sizes that does not seem so narrow.
  • Labels for language items are not aligned with the text in the search bar. The measurements in the spec should result in the text for the search bar and the language to follow a straight vertical scan line. However there seems to be some unintended padding/margin there making it not to be the case:
test.m.wikipedia.org_wiki_Special_ContentTranslation(iPhone 6_7_8) (1).png (1×750 px, 33 KB)
test.m.wikipedia.org_wiki_Special_ContentTranslation(iPad Pro).png (2×2 px, 373 KB)
Pginer-WMF changed the task status from Open to In Progress.Jan 21 2022, 11:41 AM
santhosh changed the task status from In Progress to Open.Feb 8 2022, 11:16 AM
santhosh removed santhosh as the assignee of this task.

Unassigning from myself and moving to Sprint to pick up later by me or others.

Change 799819 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX Language Selector: Use fullscreen mode only for small screens

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

Change 799819 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX Language Selector: Use fullscreen mode only for small screens

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

Change 801170 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20220530

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

Change 801170 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20220530

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

  • In enlarged /wider widows the dialog does not stretch further
  • When windows are enlarged the dialog does not get dragged out of position
  • When windows are shrinked it adjusts abit but still maintains its position closer to the language
  • In all cases users are conveniently able to search for a language and scroll through available languages

Testing: QA PASS