Page MenuHomePhabricator

[SPIKE] Explore adding interwiki links link back to sidebar
Closed, ResolvedPublic

Description

Background

We would like to explore adding the link to add interwiki links to Wikidata back into the sidebar as a temporary solution until the release of the new version of the ULS. See T282026: Discussion: Unable to quickly add interwiki links via Wikidata’s "Add link" interface for more context.

Acceptance Criteria

  • Explore options for adding interwiki links to bottom of sidebar
  • potential copy: "Add links to other languages"
  • Link behavior:
  • if page has wikidata ID, navigate to the corresponding section in wikidata
  • if page does not have a wikidata ID, display the "Link with page" modal

Screen Shot 2021-07-15 at 9.30.42 AM.png (648×1 px, 107 KB)

Developer notes

The link is added here:
https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/35c9b0291754aeb246207735650e4079b51005d8/client/includes/RepoItemLinkGenerator.php#146
via this hook: https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/35c9b0291754aeb246207735650e4079b51005d8/client/includes/Hooks/SkinAfterPortletHandler.php#74

Presumably, we'd only want to do this for modern Vector (e.g. not legacy Vector). This makes this a challenge as Wikibase has no way of distinguishing between the two Vectors without using some internal Vector classes which are not marked as stable.

We can do this, but this will result in product and technical debt that we will need to pay off later. It will means later in the project we will have to come back and do this task again and handle any caching implications.

The Wikibase extension is quite complicated to set up and the team is not familiar with their extension so there's a non-trivial cost there for doing that.

Option: Apply to both legacy and modern

We could add the new link in legacy and modern. While this would lead to a duplicate item, it would arguably help with learning the new location and would drastically simplify things (no tech or product debt)

Counter proposal

I think it will actually be a lot easier to make a change in UniversalLanguageSelector extension. This would also be more future proof and allow us not to have to revisit this at a later date.

With a few modifications we could do the following to surface the add language link:

Screen Shot 2021-07-15 at 9.12.39 AM.png (1×1 px, 207 KB)

Note, this doesn't help the situation where there is no language button. We'd need to revisit T276950. Perhaps we can reconsider showing the language button on pages with no languages, given there would now be an action?

Screen Shot 2021-07-15 at 9.36.14 AM.png (1×784 px, 58 KB)

Thoughts?

Event Timeline

ovasileva triaged this task as Medium priority.Jul 14 2021, 4:14 PM

@ovasileva I wonder if this would make sense within the Page tools section, below the Wikidata item link?

image.png (735×1 px, 454 KB)

I don't think the Wikidata Item link in the sidebar is sufficient. The existing functionality is there exactly to avoid sending you to Wikidata where possible and instead to the operation locally on the Wikipedia.

In T286659#7212738, @alexhollender wrote:

@ovasileva I wonder if this would make sense within the Page tools section, below the Wikidata item link?

image.png (735×1 px, 454 KB)

+1. I think this could work.

I don't think the Wikidata Item link in the sidebar is sufficient. The existing functionality is there exactly to avoid sending you to Wikidata where possible and instead to the operation locally on the Wikipedia.

@Lydia_Pintscher thanks for this context. I was not aware that it's possible to do this on Wikipedia, I thought it always took you to Wikidata. Would it be possible for you to provide a screenshot and/or a link for how to see that functionality?

@alexhollender I think I found the answer: https://en.wikipedia.org/wiki/Fred_Carter_(convict)?useskinversion=1

Screen Shot 2021-07-14 at 12.30.07 PM.png (718×1 px, 120 KB)

Only applies to pages without a Wikidata ID (thanks Amir / Ladsgroup )

Hey :)

Yes sorry. This dialog is what I was talking about. We currently show it if the article is not connected to an Item at all or if the article is connected to an Item where the only sitelink is the one for the article you are on. Here is a random article that is connected to an Item but only has this article in the sitelinks: https://ceb.wikipedia.org/wiki/Big_Coulee_(walog_sa_Tinipong_Bansa,_Montana,_Judith_Basin_County,_lat_46,91,_long_-109,78)

I hope this helps. Please let me know if you need more.

Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson subscribed.

We talked about the several options here and decided we didn't want to modify the existing ULS. The assumption on the long term is the new ULS will have this feature and show on pages without other languages. We've thus settled on doing one of two things:

(1) Have 2 links in the sidebar for legacy and modern Vector

In the Wikibase extension we'll add an additional link to the sidebar for Vector "Add links to other languages" which would behave identically to the existing "Add links" link.
In Vector we'll add a style to make sure only one of those is shown at a time.
This may require some changes to the wire up JavaScript to make sure both buttons are functionally showing the dialog.

For this option we'd need some help from WMDE as nobody in the team has a working Wikibase install and we noted that this would be a big time suck for us to get up and running and familiar with the project.

On the longer term we imagine this link might be in the sidebar as well as the ULS dialog so this would prepare for that eventuality.

(2) Add JavaScript to modern Vector which puts the link in the sidebar (hack)

We (reading web) are happy to take on some technical debt and using a JavaScript hack move the existing link to the toolbox menu. We'd change our logic to hide the language button via CSS. This hack would exist until the language team has done their bit and WMDE will not need to be involved. The downside of this approach is that the link will not show for any users not running JavaScript but we determined this to be a small number of impacted user.

@Lydia_Pintscher which of these options is preferable to you? Do WMDE want to be involved in the solution or not?

Thanks! I am not sure I have a strong opinion either way. I would love to hear what @Addshore and @Ladsgroup think for example.

The first option has this downside that for connected pages to wikidata items (majority of Wikipedia articles) you will see two links to the exactly same thing (the wikidata item):

image.png (168×123 px, 7 KB)

The second one seems more sensible for now (maybe later we can have some design research on it and find a better home).