Page MenuHomePhabricator

Reorganize the links module to support more complex link related usecases
Closed, ResolvedPublic1 Story Points

Event Timeline

santhosh created this task.Feb 25 2015, 2:43 PM
santhosh raised the priority of this task from to High.
santhosh updated the task description. (Show Details)
santhosh added a subscriber: santhosh.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 25 2015, 2:43 PM
santhosh claimed this task.Feb 25 2015, 2:44 PM
santhosh moved this task from Backlog to In Progress on the LE-Sprint-83 board.Feb 25 2015, 2:59 PM
Arrbee set Security to None.Feb 26 2015, 3:10 PM
Arrbee edited a custom field.
Arrbee edited projects, added LE-Sprint-84; removed LE-Sprint-83.Mar 10 2015, 9:39 AM
Arrbee edited a custom field.
santhosh edited a custom field.Mar 11 2015, 7:29 AM
santhosh edited a custom field.
santhosh moved this task from Backlog to In Progress on the LE-Sprint-86 board.Apr 20 2015, 5:37 AM
santhosh edited a custom field.
Arrbee moved this task from Long term to CX5 on the ContentTranslation board.Apr 20 2015, 6:06 AM

Change 204738 had a related patch set uploaded (by Santhosh):
[WIP] Rewriting link module

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

santhosh moved this task from In Progress to In Review on the LE-Sprint-86 board.Apr 28 2015, 10:03 AM
Arrbee edited projects, added LE-Sprint-87; removed LE-Sprint-86.May 25 2015, 8:10 AM
Arrbee moved this task from Backlog to In Review on the LE-Sprint-87 board.May 25 2015, 8:14 AM

Following issues reported by Niklas in CR

  1. I have same problem as Amir: when selecting (not already linked) word in source column, no card is shown and only api query done is for dictionary.
  1. When clicking blue link in target column, the link card may claim the page does not exist (<s>I assume this happens when link text is not the same as link target</s> Maybe if the page name has a space?).
  1. Opening links with shift+click is no longer possible.
  1. Link highlighting is "stuck" visible even if cursor is moved away. It only gets discarded when clicking another link or making a selection.
  1. Shift+middleclick only works in source column
  1. When hovering a link on the source column, a hand cursor is shown. When hovering a link on the target column, normal text cursor is shown.
  1. (Probably not in scope of this patch) Clicking external link does nothing (and there is no indicator if a link is external)
  1. Red link in link card opens CX translation apge of article named such in source language to the target language.
  1. Maybe related to 2, but sometimes when selecting a word in target column, link card is not shown at all. I see no difference in responses, so maybe it is a race condition?
  1. When creating a link on target column, you can click the link card for the source language and create a red link. Feels confusing.
  1. When typing a page name which is a redirect, selecting it, using the link card to create a link with the target name, then in publishing the link points to the redirect. I think it would be better if it pointed directly to the target page.

I am replying here, because many of these are about features than code.

  1. I have same problem as Amir: when selecting (not already linked) word in source column, no card is shown and only api query done is for dictionary.

Intentional. Selecting text(not link) in source column does not do a search for link. I don't find a case where it is useful and figure out what can be done with such a card. In the master version, we show a card if the selected text is a valid title in source wiki. But I dont see it useful for translation. I am open for a discussion in this specific case, but in a separate ticket.

  1. When clicking blue link in target column, the link card may claim the page does not exist (<s>I assume this happens when link text is not the same as link target</s> Maybe if the page name has a space?).

This need an example to check.

  1. Opening links with shift+click is no longer possible.

Fixed

  1. Link highlighting is "stuck" visible even if cursor is moved away. It only gets discarded when clicking another link or making a selection.

Fixed

  1. Shift+middleclick only works in source column

Fixed

  1. When hovering a link on the source column, a hand cursor is shown. When hovering a link on the target column, normal text cursor is shown.

Fixed

  1. (Probably not in scope of this patch) Clicking external link does nothing (and there is no indicator if a link is external)

Out of scope

  1. Red link in link card opens CX translation apge of article named such in source language to the target language.

Isn't it the expected result. We wanted redlinks provide a new CX instance to translate

  1. Maybe related to 2, but sometimes when selecting a word in target column, link card is not shown at all. I see no difference in responses, so maybe it is a race condition?

Not sure, an example can help

  1. When creating a link on target column, you can click the link card for the source language and create a red link. Feels confusing.

T90562 Emphasise links that can be adapted when the user selects some text

  1. When typing a page name which is a redirect, selecting it, using the link card to create a link with the target name, then in publishing the link points to the redirect. I think it would be better if it pointed directly to the target page.

This can be a new ticket, because I dont think it was either addressed in master also.

  1. I have same problem as Amir: when selecting (not already linked) word in source column, no card is shown and only api query done is for dictionary.

Intentional. Selecting text(not link) in source column does not do a search for link. I don't find a case where it is useful and figure out what can be done with such a card. In the master version, we show a card if the selected text is a valid title in source wiki. But I dont see it useful for translation. I am open for a discussion in this specific case, but in a separate ticket.

Good that we had this one clarified. Makes sense.

  1. When clicking blue link in target column, the link card may claim the page does not exist (<s>I assume this happens when link text is not the same as link target</s> Maybe if the page name has a space?).

This need an example to check.

I am using this as an example for this and rest of this comment: page=Mikko+Alatalo&from=en&to=sv&targettitle=Mikko+Alatalo

I can no longer reproduce this with link "Center Party" in the target column.

  1. Opening links with shift+click is no longer possible.

Fixed

Works in source column now, not in target column.

  1. Red link in link card opens CX translation apge of article named such in source language to the target language.

Isn't it the expected result. We wanted redlinks provide a new CX instance to translate

Assuming there would not be article glass (ice cream) in svwiki yet, if I create a red link glass and try to translate it, it would suggest translation of the glass (material) article. Given that it opens the article selector, this is probably acceptable as the user can correct the source.

  1. Maybe related to 2, but sometimes when selecting a word in target column, link card is not shown at all. I see no difference in responses, so maybe it is a race condition?

Not sure, an example can help

Same page, double clicking primarily does not open link card while double clicking succesful does.

  1. When creating a link on target column, you can click the link card for the source language and create a red link. Feels confusing.

T90562 Emphasise links that can be adapted when the user selects some text

On quick look I do not see how that task is related at all. But you have fixed this already.

  1. When creating red link to multi word expression, link card shows underscores instead of spaces.
  1. Opening links with shift+click is no longer possible.

Fixed

Works in source column now, not in target column.

In an editable area, if you press shift and click, it selects the content from the click to end of that section or previous click. Not overriding this behavior since I believe it is required while editing content. Link exploration is anyway available from the Link card.

  1. Red link in link card opens CX translation apge of article named such in source language to the target language.

Isn't it the expected result. We wanted redlinks provide a new CX instance to translate

Assuming there would not be article glass (ice cream) in svwiki yet, if I create a red link glass and try to translate it, it would suggest translation of the glass (material) article. Given that it opens the article selector, this is probably acceptable as the user can correct the source.

For missing link, I am not sure what else we can do.

  1. Maybe related to 2, but sometimes when selecting a word in target column, link card is not shown at all. I see no difference in responses, so maybe it is a race condition?

Not sure, an example can help

Same page, double clicking primarily does not open link card while double clicking succesful does.

http://en.wikipedia.org/w/api.php?action=query&format=json&titles=successful&prop=pageimages&piprop=thumbnail&pithumbsize=150&redirects=true

{"query":{"normalized":[{"from":"successful","to":"Successful"}],"redirects":[{"from":"Successful","to":"Success"}],"pages":{"2595998":{"pageid":2595998,"ns":0,"title":"Success"}}}}

http://en.wikipedia.org/w/api.php?action=query&format=json&titles=primarily&prop=pageimages&piprop=thumbnail&pithumbsize=150&redirects=true

{"query":{"normalized":[{"from":"primarily","to":"Primarily"}],"pages":{"-1":{"ns":0,"title":"Primarily","missing":""}}}}
  1. When creating red link to multi word expression, link card shows underscores instead of spaces.

Did you mean this? I see space in link card for the multi word "Folk music"

  1. Maybe related to 2, but sometimes when selecting a word in target column, link card is not shown at all. I see no difference in responses, so maybe it is a race condition?

Not sure, an example can help

Same page, double clicking primarily does not open link card while double clicking succesful does.

So let's clarify the expected behavior here. For me the current behavior does not make sense:

  1. Click a word on target column; exists neither in source or target language -> no link card is shown
  2. Click a word on target column; exists in source but not in target language -> cards create red link in target, access page in source are shown
  3. Click a word on target column; exists in target but not in source language -> cards create blue link in target, create red link in source are shown
  4. Click a word on target column; exists both in target and in source language -> cards create blue link in target, access page in source are shown

1 and 4 are ok. For 3 I would definitely not suggest red link creation in source language. For consistency I would make 2 behave like 1 until we enable red link creation for all words.

  1. When creating red link to multi word expression, link card shows underscores instead of spaces.

Did you mean this? I see space in link card for the multi word "Folk music"

@Nikerabbit, I fixed the issue about Football_stadium. Could you please help me to reproduce case #3 -create red link in source are shown. I will require an example.

So the behavior I see with latest patchset (27) is:

  1. Click a word on target column; exists neither in source or target language -> no link card is shown
  2. Click a word on target column; exists in source but not in target language -> no link card is shown
  3. Click a word on target column; exists in target but not in source language -> create blue link in target only is shown

Click a word on target column; exists both in target and in source language -> cards create blue link in target, access page in source are shown [1]

[1] for example if I link glass in Swedish, the source page is now "Ice cream" in English, rather than the articles about the material, as was in earlier patchsets.

This seems better behavior than the previous one to me. Is this also the expected behavior?

@Nikerabbit, make sense to me. Anyway I wanted a full UX review from @Pginer-WMF once it start living in production to tune all these.

Change 204738 merged by jenkins-bot:
Rewrite the links module

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

Nikerabbit closed this task as Resolved.Jun 9 2015, 12:23 PM

See https://docs.google.com/a/wikimedia.org/document/d/1tpIT5aFKg860gX7T2os53nG4geM_YcLWJg0ksIKe5Xs/edit?usp=drive_web

If this document is complete, please copy the text to mediawiki.org or upload as PDF to Commons.

KartikMistry moved this task from In Review to Done on the LE-Sprint-87 board.Jun 10 2015, 3:09 AM