Page MenuHomePhabricator

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

Event Timeline

santhosh raised the priority of this task from to High.
santhosh updated the task description. (Show Details)
santhosh subscribed.
Arrbee edited a custom field.

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

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

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"

CurrencyExchange-Oanda-EUR1.png (403×1 px, 52 KB)

  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"

CurrencyExchange-Oanda-EUR1.png (403×1 px, 52 KB)

pasted_file (492×1 px, 137 KB)

@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