Page MenuHomePhabricator

CX2: Adjust when to check warnings for a paragraph
Closed, ResolvedPublic

Description

Content Translation shows a warning when translation paragraphs contain too much content that has not been modified (T190279). With the current approach, the checks are not done immediately, but postponed until the user edits a paragraph. This approach is one step to prevent showing the issues too early, but still has some limitations (illustrated in the animation below):

  • Users adding several paragraphs in a sequence, receive the feedback about the paragraphs being problematically too late, not discouraging them from adding more unreviewed paragraphs.
  • Users editing a paragraph get a warning for the current paragraph they are trying to improve too early, not giving them a chance to make a good translation before the warning is shown.

Jul-30-2018 12-36-19.gif (314×480 px, 2 MB)

In order to avoid the problems described above, a strategy that surfaces the issues when needed but does not get in the way of users trying to edit the initial translation of a paragraph is proposed. The approach combines all the three behaviours described below:

Check other pending paragraphs when a new paragraph is added to the translation.

When a paragraph is added to the translation, we can assume that the user is done with other paragraphs that were added before, and issues can be shown for them.

In this way, adding three paragraphs in a row will show the warning for the first paragraph when the second is added; and warnings for the second paragraph will be shown when the third paragraph is added. Note that the paragraph being added is not checked immediately, and that this approach surfaces warnings for all paragraphs except for the last added paragraph (which will be covered by the approaches listed below).

CX-check-on-next.png (640×2 px, 50 KB)

Check pending paragraphs when input focus moves out of a paragraph.

The input focus moving away from the current paragraph is another indicator that the work is completed. It may not be the case, but the user will be less surprised if the warning mark appears after completing this editing action than getting it after the first modification.

CX-check-on-blur.png (640×2 px, 47 KB)

Delay the check of the current paragraph after the user starts editing it.

The previous strategies should cover most of the cases, but they can leave the current paragraph unchecked which may be problematic if the user tries to publish unaware of the warning for it. We can show a warning for the current paragraph, if there is some time of inactivity after the user started modifying it. For example, if the user adds a paragraph and starts editing remains 15 seconds without making any modification, the issue can be shown.

If this adds too much complexity, we can consider measuring only the time since the first edit on the paragraph, ignoring whether there have been further modifications in between, but using a longer time period as a reference.

CX-check-on-edit.png (640×2 px, 47 KB)

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Pginer-WMF renamed this task from CX2: Adjust when to show warnings for a paragraph to CX2: Adjust when to check warnings for a paragraph.Jul 30 2018, 11:51 AM

Change 454798 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Validate pending paragraphs when new paragraph is added

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

Change 454798 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Validate pending paragraphs when new paragraph is added

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

Petar.petkovic subscribed.

Merged patch only deals with the first proposed edit - "Check other pending paragraphs when a new paragraph is added to the translation". Other two requirements are yet to be implemented.

After QA, this ticket should be moved to Backlog, if some other patch isn't published in the meantime.

After QA, this ticket should be moved to Backlog, if some other patch isn't published in the meantime.

The initial scenario is supported. As the other scenarios are supported, we also need to avoid the current behaviour of showing the warning at the initial modification the user makes to the paragraph. Since that defeats the purpose of postponing the warnings until the user is given a chance to edit the new paragraph.

Change 457821 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Delay the validation of the current paragraph after the user editings

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

Change 457821 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Delay the validation of the current paragraph after the user editings

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

Petar.petkovic moved this task from In Review to QA on the Language-2018-July-September board.

The merged patch completes the third requirement - "Delay the check of the current paragraph after the user starts editing it".

After QA, this ticket should be moved to Backlog, if some other patch isn't published in the meantime.

Etonkovidova subscribed.

Two scenarios are working smoothly and covers the functionality of the Unmodified warning quite sufficiently:

(1) Only one paragraph has been translated (MT/source) - the warning is not shown - trying to publish, the warning appears and the translation cannot be published.

(2) The warning appears only when a user starts translating with MT source options the next paragraph.

Moving the ticket back to the Backlog for "Delay the check of the current paragraph after the user starts editing it."

@santhosh there is no patch attached to this ticket which is in review phase. What is the reason for moving the ticket?

@santhosh there is no patch attached to this ticket which is in review phase. What is the reason for moving the ticket?

It was moved to backlog by Elena for "Delay the check of the current paragraph after the user starts editing it.", but that patch was in review

Change 492287 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Check pending paragraphs when input focus changes

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

Change 492287 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Check pending paragraphs when input focus changes

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

Checked in cx2-testing and in produciton (wmf.19) for the last spec:

We can show a warning for the current paragraph, if there is some time of inactivity after the user started modifying it. For example, if the user adds a paragraph and starts editing remains 15 seconds without making any modification, the issue can be shown.

All works as expected - for the currently translated paragraph, the warning will be shown after 15 sec of inactivity, i.e. a users clicks in the paragraph, adds some editing, and then stops for 15 sec. The warning will also will be shown if a user does not perform any action in the translated paragraph, but then clicks in the tool panel.
The warning will not be shown if a user translates the paragraph and does not do anything (no editing, no any other actions) which is the expected behavior.

@Etonkovidova actually the part described with "Check pending paragraphs when input focus moves out of a paragraph" should be tested. I have noticed some unexpected behavior where issue card does not close when input focus moves away, thus returning this to In progress.

@Petar.petkovic Can you confirm which parts are pending to implement for this ticket?
Thanks!

@Petar.petkovic Can you confirm which parts are pending to implement for this ticket?

Sure! I was implementing "Check pending paragraphs when input focus moves out of a paragraph" part of this ticket and made some changes on how focus change event triggers MT abuse checks. Code changes that I made sometimes cause wrong issue card to be displayed and stuck, which is kind of a regression. I think moving input focus still makes MT abuse warning checks, so separate ticket could probably be created for wrong issue card problem, but I would like to keep this one until regression is fixed.

Change 518165 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Don't destoy and recreate mw.cx.tools.IssueTrackingTool

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

Change 518165 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Don't destoy and recreate mw.cx.tools.IssueTrackingTool

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

Check other pending paragraphs when a new paragraph is added to the translation.

Working as expected

Check pending paragraphs when input focus moves out of a paragraph.

not working, the warning shows when the focus returns to the paragraph https://drive.google.com/file/d/1Z0FtZbMHU2aLQw2fSV6TIXjgPzmTpJfp/view?usp=sharing

Delay the check of the current paragraph after the user starts editing it.

not working, the warning never shows if we don't do anything after the translation

Delay the check of the current paragraph after the user starts editing it.

not working, the warning never shows if we don't do anything after the translation

The behavior is as described in the ticket. If you just add paragraph and don't perform any action, the MT abuse check will not happen. But, if you add paragraph and type one word and don't do anything else, after 15 seconds, the warning appears.

Change 525770 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Validate MT abuse on blur instead on focus

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

Change 525770 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Validate MT abuse on blur instead on focus

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