(Go: >> BACK << -|- >> HOME <<)

Page MenuHomePhabricator

CX2: Prevent to navigate away to source wiki when clicking on image
Closed, ResolvedPublic

Description

When image is clicked on source column, page navigates to source wiki instead of adapting image in translation column. This is not happening in CX1, so specific to CX2.

Event Timeline

Pginer-WMF renamed this task from CX2: Page navigates away to source wiki when clicking on image to CX2: Prevent to navigate away to source wiki when clicking on image.Mar 22 2018, 10:58 AM
Pginer-WMF triaged this task as Medium priority.
Pginer-WMF moved this task from Backlog to Priority backlog on the Language-2018-Jan-Mar board.

Change 423361 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] CX2: Fix page navigation when clicked on image link

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

Petar.petkovic subscribed.

This change deals with clicking on block images, but not with clicking on images inside infoboxes. Clicking on images in infoboxes will be done as part of template work.

Change 423361 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] CX2: Fix page navigation when clicked on image link

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

@santhosh
Checking in cx2-testing - e.g. "Claude Monet" (translation from English to Spanish). Click on the first image in the source article - the page re-loads to https://en.wikipedia.org/wiki/File:Claude_Monet_-_Camille.JPG.

<figure class="ve-ce-branchNode ve-ce-mwBlockImageNode ve-ce-mwBlockImageNode-type-thumb ve-ce-focusableNode mw-halign-left" typeof="mw:Image/Thumb" contenteditable="false" style="width: 202px; height: auto;"><a class="image" href="http://en.wikipedia.org/wiki/File:Claude_Monet_-_Camille.JPG"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Claude_Monet_-_Camille.JPG/200px-Claude_Monet_-_Camille.JPG" style="width: 200px; height: 312px;" class="ve-ce-mwBlockImageNode-thumbimage"></a>

The same action in cx-testing will display the image in the translation column:

<figure class="mw-halign-left" id="mwLg" typeof="mw:Image/Thumb"><a href="./File:Claude_Monet_-_Camille.JPG" id="mwLw"><img data-file-height="5829" data-file-type="bitmap" data-file-width="3734" height="312" id="mwMA" resource="./File:Claude_Monet_-_Camille.JPG" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Claude_Monet_-_Camille.JPG/200px-Claude_Monet_-_Camille.JPG" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Claude_Monet_-_Camille.JPG/400px-Claude_Monet_-_Camille.JPG 2x, //upload.wikimedia.org/wikipedia/commons/thumb/e/e8/Claude_Monet_-_Camille.JPG/300px-Claude_Monet_-_Camille.JPG 1.5x" width="200"></a>

<figure class="ve-ce-branchNode ve-ce-mwBlockImageNode ve-ce-mwBlockImageNode-type-thumb ve-ce-focusableNode mw-halign-left"

This is not a CX figure node. It should have <figure class="ve-ce-branchNode ve-ce-mwBlockImageNode ve-ce-mwBlockImageNode-type-thumb ve-ce-focusableNode ve-ce-cxBlockImageNode mw-halign-left" as classes. Need to check what is wrong with cx-testing.

@Etonkovidova You can test now. cxserver was not up to date.

The patch https://gerrit.wikimedia.org/r/#/c/423361/ does the following:"When image is clicked on source column, page navigates to source wiki.
Prevent that by opening the image in new tab." This phab task is about making click on an image in cx2 to behave as in cx-testing and current production : click on an image will adapt it to the translate column.

@santhosh - is it a change in functionality?

in CX2, clicking on source sections won't add them to translation column. The 'add translation' click is the only way to do that. I think that is a sensible change, simple, one and only one way to do translation.

The scope of my fix was to avoid navigating away from the translation editor when clicked intentionally or accidentally in source column image.

@Pginer-WMF Please validate this and create tickets if there are more things to do.

@Pginer-WMF Please validate this and create tickets if there are more things to do.

This makes sense. Clicking to add the source paragraph has some drawbacks since it may get in the way of exploration or copying&pasting. Let's start by supporting only the default way to add the paragraphs, and reconsider based on observation of user behaviour.

Thanks, @santhosh and @Pginer-WMF. I agree- let's keep the scope of the ticket as it is in the patch and re-evaluate later if some changes are needed:

The scope of my fix was to avoid navigating away from the translation editor when clicked intentionally or accidentally in source column image.

Closing the task as Resolved.

Pginer-WMF moved this task from Done to Priority backlog on the Language-2018-Apr-June board.

There seems to be a regression with this. I could reproduce the issue with the images on Plants in culture and Plants in space.

@Pginer-WMF I re-checked how clicking on images in articles Plants in culture and Plants in space behaves (translating them from English to Russian) - all seems to be ok. Clicking on images (directly) (Chrome, Mac) with the left mouse click, opens a new tab with the image file info. Am I missing something here?

However, there is a case (which I missed while testing) - clicking on images that are part of Infobox template, for examples, will load a source wiki page for that image file - e.g. start translating 'Claude Monet' article (from English to any language), click on the first image - the page - https://en.wikipedia.org/wiki/File:Claude_Monet_1899_Nadar_crop.jpg - will load in the same tab.

@Pginer-WMF I re-checked how clicking on images in articles Plants in culture and Plants in space behaves (translating them from English to Russian) - all seems to be ok. Clicking on images (directly) (Chrome, Mac) with the left mouse click, opens a new tab with the image file info. Am I missing something here?

Clicking on images in the source should not open them. That will allow later to select them in order to copy them. In editor environments (such as Visual Editor), images and links are selected when clicking them instead of open directly. Although the source article is not editable in CX, the user may do other operations on it such as copying content where opening the content can get in the way.

However, there is a case (which I missed while testing) - clicking on images that are part of Infobox template, for examples, will load a source wiki page for that image file - e.g. start translating 'Claude Monet' article (from English to any language), click on the first image - the page - https://en.wikipedia.org/wiki/File:Claude_Monet_1899_Nadar_crop.jpg - will load in the same tab.

that seems a related problem. Opening in the same tab is especially problematic since unsaved content can get lost.

Change 437916 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Disable all link clicks in source content

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

Change 437916 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Disable all link clicks in source content

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

Etonkovidova closed this task as Resolved.EditedJun 26 2018, 9:53 PM

Checked the fix in cx2.