Change ReferencePreviews link-clicking behaviour
Closed, ResolvedPublic2 Estimated Story Points

Description

Background
What if a reference contains a link to another page on the same wiki? The standard behavior for such links (when shown as part of the page, not in a popup) is to open in the same browser tab, and not open a new one. Only external links open in new tabs. The definition of "external" in MediaWiki core might be a little more complicated, but essentially it's "links to another domain".

As of now, all links in a ReferencePreview popup open a new tab. This might not be what users expect. This ticket here is to discuss this, and find a solution that fits the users expectations best.

Note this ticket here is not the same as T215419, but more generic. While we think T215419 is a bug, this here is more a matter of opinion.

Relevant code: https://phabricator.wikimedia.org/diffusion/EPOP/browse/master/src/ui/templates/referencePreview/referencePreview.js$61

Outcome
Follow the behaviour pattern currently implemented in T190549: Differentiate between internal, sister-wiki, interwiki, and external links visually. That means, change behaviour so that:

  • Internal, sister and inter-wiki links: open in same tab
  • External links: open in new tab

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Adding @alexhollender as the designer for Reference Previews.

@thiemowmde how we handle links seems to be a bit inconsistent (or difficult to define), see T190549 for context. Perhaps the best way to handle this is to follow what would happen if a link within the reference itself (not the reference preview) were clicked? In this case that would mean it would open in the same tab.

Other cases to possibly consider:

  • link to the same project in a different language (e.g. en.wiki > ar.wiki — not sure how often this occurs)
  • link to a different wiki project (e.g. wikipedia > wikisource — not sure how often this occurs)
  • link to an external, non-wiki site (currently opens a new tab)

Thanks a lot for the detailed response! Essentially, we definitely need to reduce the amount of new tabs that open. Good to hear we agree on that. We will continue discussing this within the WMDE-TechWish.

We have decided to follow the behaviour pattern currently implemented in T190549: Differentiate between internal, sister-wiki, interwiki, and external links visually. That means:

Internal, sister and inter-wiki links: open in same tab
External links: open in new tab

Lena_WMDE renamed this task from Should links to the same site open in new tabs? to Change ReferencePreviews link-clicking behaviour.Oct 19 2020, 8:37 AM
Lena_WMDE moved this task from Before Default to In preparation on the Reference Previews board.
Lena_WMDE set the point value for this task to 2.Oct 19 2020, 9:23 AM

Change 553106 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Popups@master] Open only external links in new tabs

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

Change 553106 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Open only external links in new tabs

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