CX2: Better communicate the default status in the Automatic Translation card
Closed, ResolvedPublic

Description

The Automatic Translation card (T188247) allows to select between MT services. There is always one option that is used by default, and users can chose a different one to be the default. Currently the action to "Keep as default" is surfaced when the user selects an option that is not the default. However there is no indication of which is the current default, or visual confirmation that the change of default took place.

In order to clarify the default status, the following is proposed:

  • Add a "default" label next to the default item in the drop-down options.
  • Highlight the dropdown for a second when the "Keep as default" action takes effect.

In this way, users can check and confirm which is the default service by looking at the list, and they will understand better than the default option changed. Meanwhile, users happy with the use of the default will get no additional signal.

Pginer-WMF triaged this task as Normal priority.

Change 441023 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/ContentTranslation@master] CX2: Better communicate the default status in MT card

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

Nikerabbit moved this task from Priority backlog to In Review on the Language-2018-Apr-June board.

@Pginer-WMF @Petar.petkovic asks whether the following is a problem (position of text "default" when there is lack of space inside the menu):

I'm looking for feedback which of the following to choose:

  • needs to be fixed in the current patch
  • can be fixed in a follow-up patch in this task
  • can be fixed later, a follow-up tasks will be filed
  • it's okay

I also assume a sufficient fix would be to make the dropdown match the width of the input.

@Pginer-WMF @Petar.petkovic asks whether the following is a problem (position of text "default" when there is lack of space inside the menu):

Yes. this is a problem that we want to avoid.

I'm looking for feedback which of the following to choose:

  • needs to be fixed in the current patch
  • can be fixed in a follow-up patch in this task
  • can be fixed later, a follow-up tasks will be filed
  • it's okay

A follow-up patch for the current task is ok.

I also assume a sufficient fix would be to make the dropdown match the width of the input.

Yes. That should work well. In addition to making the drop-down wider to accomodate the content, there are also a couple details that would help to make sure the "default" text does not get mixed as part of the main label when labels are long:

  • A separation to the left of the "default" label of at least 12px. In case of the main label still not fitting the available space, it can be cropped with ellipsis.
  • The "default" label should use a 14px font.
  • When it is not part of the active element, the "default" label will be in Base20 (#54595D) color. For the active element it is blue (#36C) instead.

If it is hard to customize some of the styling aspects, we can skip the adjustments.

I illustrated below the result of applying the styling adjustments, although making the menu wider would solve the issues for most cases.

Change 441531 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Make MT menu have the full width of the handle

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

Change 441531 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Make MT menu have the full width of the handle

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

Change 441023 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] CX2: Better communicate the default status in MT card

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

Change 441819 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/ContentTranslation@master] CX2: Tweak styles of "default" indicator

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

Latest patch should implement everything except ellipsis truncation. I tried flexbox but the flex-parent was outgrowing the parent widths (one of the parents is an a element styled as display: table) and I was not able to figure out how to stop that. If anyone feels up to the challenge, please take over for that part.

We should style the secondary text the same as OOUI menus:

...specifically it should be #72777d regardless of activity state

We should style the secondary text the same as OOUI menus:

...specifically it should be #72777d regardless of activity state

Thanks for pointing to this @Esanders. It makes sense to consider this in the context of the process of component standardisation, so @Volker_E may want to take a look. We may want to consider whether (a) status indicators (such as "default" here) can become more prominent than more passive information (such as keyboard shortcuts) and (b) which grey to use for secondary content.

I think the different alternatives could work well for this particular case, but I'd prefer checking with @Volker_E, and creating a follow-up ticket if changes are needed.

Change 441819 merged by Petar.petkovic:
[mediawiki/extensions/ContentTranslation@master] CX2: Tweak styles of "default" indicator

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

Change 443060 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Truncate preferred tool name

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

Latest patch should implement everything except ellipsis truncation. I tried flexbox but the flex-parent was outgrowing the parent widths (one of the parents is an a element styled as display: table) and I was not able to figure out how to stop that. If anyone feels up to the challenge, please take over for that part.

Submitted a patch to do the truncation.

Change 443060 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Truncate preferred tool name

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

Vvjjkkii renamed this task from CX2: Better communicate the default status in the Automatic Translation card to 2wbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii removed Nikerabbit as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot assigned this task to Nikerabbit.
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot renamed this task from 2wbaaaaaaa to CX2: Better communicate the default status in the Automatic Translation card.
CommunityTechBot added a subscriber: Aklapper.

@Petar.petkovic - switching to "Don't use machine translation" option displays multiple Console error Uncaught TypeError: Cannot read property 'getModel' of undefined - the mouse pointer focus is lost in the paragraph and it's not possible to type there.

Also, it's not possible to switch to other machine translation options - Apertium or Yandex, so verifying how default can be changed cannot be currently done.

@Petar.petkovic - switching to "Don't use machine translation" option displays multiple Console error Uncaught TypeError: Cannot read property 'getModel' of undefined - the mouse pointer focus is lost in the paragraph and it's not possible to type there.

Also, it's not possible to switch to other machine translation options - Apertium or Yandex, so verifying how default can be changed cannot be currently done.

I've seen this error and was trying to come up with steps to reproduce, but not successfully. Can you try different articles and report if there are clear steps?

Since I wasn't able to switch MT options, I've cleared the local storage value for default MT option to make it work and haven't seen the error afterwards.

Etonkovidova closed this task as Resolved.Jul 7 2018, 12:48 AM

Yes, you're right - Uncaught TypeError: Cannot read property 'getModel' of undefined Console error seems to be specific to certain lang pair translation - e.g. translating to English or from English will always produce this error. This is unrelated to the fix in this phab task. I filed it as a separate ticket - T199011: CX2: Paragraph becomes unusable when switching to 'Don't use machine translation' or 'Use source text'

The default option for translation is persistent between user sessions and it's saved per translated article.

Petar.petkovic moved this task from QA to Done on the Language-2018-Apr-June board.Jul 7 2018, 9:03 AM