Page MenuHomePhabricator

Regression: Ctrl/command clicking on a page preview opens the previewed page in a new tab _and_ redirects the user to the article in the current window
Closed, ResolvedPublic3 Estimate Story Points

Description

Summary
This appears to be a recent change in expected behavior. Previously ctrl-clicking on a preview opened the page in a new tab. Now the same happens but it also registers as having clicked the preview. The result is two tabs with the same article open. The desired outcome is a new tab open with the ctrl-clicked article and the reader is left in the original window to continue reading the current article.

Steps to reproduce

  1. Visit a wiki with Page Previews enabled.
  2. Hover over a link to activate a page preview
  3. Ctrl or command +click somewhere in the preview

Outcome: Both the current window and a new tab are directed to the target page

Expected behavior: Ctrl+clicking will open the page in the preview in a new tab. The current window will not be affected.

Tested in latest version of Safari and Chrome on the latest version of MacOS.

First reported: https://www.mediawiki.org/wiki/Topic:Ui0q8z2djjkdqapu

Developer notes

git bisect shows this was caused by https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Popups/+/442880/ (T192773)

Some possible ways to fix this behaviour as well as the issue described in T192773

  1. revert the patch for T192773 and rethink the approach for that by wrapping the entire popup including image in a link.
  2. Use window.open (seems risky as modifier keys may differ by browser)
  3. Decline this card or other card
  4. Refactor linkClick to take the ev and stopPropagation to the link element/don't open link, if any modifier key held (untested but might work but might have cause other unexpected behaviour)

Details

Related Gerrit Patches:
mediawiki/extensions/Popups : masterRevert "Whole popup area should be clickable"

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 1 2018, 8:50 PM
Jdlrobson renamed this task from Ctrl/command clicking on a page preview opens the previewed page in a new tab _and_ redirects the user to the article in the current window to Regression: Ctrl/command clicking on a page preview opens the previewed page in a new tab _and_ redirects the user to the article in the current window.Aug 2 2018, 6:46 AM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Jdlrobson.

Would benefit from a chat with the team to go over options and see whether we need a spike.

TheDJ added a subscriber: TheDJ.Aug 2 2018, 7:33 AM
ovasileva triaged this task as High priority.Aug 7 2018, 9:23 AM

Discussed during standup. If it does end up between reverting and having this bug, my preference would be to fix this at the cost of not having the whole preview clickable. @alexhollender - any thoughts on this?

ovasileva set the point value for this task to 3.Aug 7 2018, 4:18 PM

Change 451531 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/Popups@master] Revert "Whole popup area should be clickable"

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

Change 451531 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Revert "Whole popup area should be clickable"

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

Jdlrobson assigned this task to Ryasmeen.EditedAug 8 2018, 9:39 PM
Jdlrobson added a project: Product-QA.

I've reverted the original patch as this is the most straightforward and sensible thing to do right now.

QA: This should be tested on the beta cluster. Please allow 30 or so minutes before testing so that it has time to update.

cc @alexhollender - I've skipped design review for this one but please see https://phabricator.wikimedia.org/T192773#4489961 (which I just reopened)

Verified on Beta cluster.

ovasileva closed this task as Resolved.Aug 9 2018, 9:55 AM

also confirmed on the beta cluster. Thanks @Jdlrobson