Page MenuHomePhabricator

Hovercards and NavPopups conflict
Closed, ResolvedPublic

Description

Hovercards disables itself when a gadget called Navigation_Popups is loaded, but there is no reason for the NavPopups gadget to be called that: the people copying it to another wiki might localize the name (e.g. on the Hungarian Wikipedia it's called Latszer). That results on both popups being shown, which can be somewhat jarring:

Event Timeline

Tgr created this task.May 18 2016, 3:11 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 18 2016, 3:11 PM
Tgr updated the task description. (Show Details)May 18 2016, 3:16 PM
Tgr added a comment.May 18 2016, 3:19 PM

I'm not 100% sure but the recent occurrence might have been something like:

  • open a page with both enabled
  • disable navpopups in another tab
  • hover

Maybe Hovercards checks whether NavPopups is enabled at the moment of hovering, not whether it was enabled at the time of the page load?

This should fix this: T135693

How is this different from T135628 ? Confused.

Tgr added a comment.May 19 2016, 6:27 PM

This is about the two showing up at the same time. That suggests some error in the logic that is likely to remain even if you flip the priorities.

Tgr raised the priority of this task from Normal to High.EditedJun 2 2016, 9:09 PM

This seems to be happening all the time now. Steps to reproduce:

  • visit huwiki in incognito browser
  • register account
  • visit preferences, enable Hovercards and NavPopups, save
  • visit recent changes (or whatever)
  • hover over some article

Both popups will show.
(Chrome 50.0.2661.86 on Ubuntu 14.04)

Change 292487 had a related patch set uploaded (by Bmansurov):
Do not show Hovercards when NavPopups gadget is enabled on huwiki

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

Temporary fix has been created. A long term proper fix is still needed. Some suggestions from IRC:

17:41 tgr: in general, I think using wikidata is neat if the WD community is up for it
17:43 tgr: iw-link the gadget definition pages (e.g. https://en.wikipedia.org/wiki/MediaWiki:Gadget-Navigation_popups ) to each other and that gives you the RL module name

@Tgr please feel free to add your other suggestions here.

Change 292487 merged by jenkins-bot:
Do not show Hovercards when NavPopups gadget is enabled on huwiki

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

Change 292497 had a related patch set uploaded (by Dereckson):
Do not show Hovercards when NavPopups gadget is enabled on huwiki

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

Change 292497 merged by jenkins-bot:
Do not show Hovercards when NavPopups gadget is enabled on huwiki

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

@bmansurov @Tgr What about having a config variable like $wgPopupsDisableWhenGadget = "latszer"; with a default of "Navigation_popups"?

It will mean checking the gadget name on every wiki we want to deploy, but it is flexible to change per wiki.

I don't like adding more config variables, but I also don't like an extension checking adhoc for gadgets and we're doing it, so this seems like a sensible solution.

Thoughts?

Tgr added a comment.EditedJun 3 2016, 9:41 AM

It's probably more scalable to use a system message: define a message key like poups-navpoup-gadget-name with Navigation_popups as the English text and {{notranslate}} in qqq, ask editors (e.g. on the wikitech-ambassadors list) to put the gadget name on the corresponding MediaWiki page, and use $msg->inContentLanguage() to load it.

@bmansurov @Tgr What about having a config variable like $wgPopupsDisableWhenGadget = "latszer"; with a default of "Navigation_popups"?
It will mean checking the gadget name on every wiki we want to deploy, but it is flexible to change per wiki.
I don't like adding more config variables, but I also don't like an extension checking adhoc for gadgets and we're doing it, so this seems like a sensible solution.
Thoughts?

What would happen when we want to enable Popups for all wikis? I think this approach maybe one of the last resorts.

Can someone update the description. I'm a little confused with why this wasn't fixed.
This shouldn't be possible - the Hovercards code is not invoked when the gadget is enabled.

Tgr updated the task description. (Show Details)Aug 29 2016, 4:16 AM

Thanks @Tgr
The logic for checking if Hovercards is enabled is here:
https://github.com/wikimedia/mediawiki-extensions-Popups/blob/master/resources/ext.popups.targets/desktopTarget.js#L7

I don't see any check against Navigation_Popups - it seems strictly feature detection. What am I missing?

Tgr added a comment.Aug 29 2016, 9:53 PM

@bmansurov fixed this in 827e1db I think?

Yes, although not perfect, it solves the problem. The solution is not good because we need to check whether the NavPopups gadget is enabled each time the user hovers over a link. @Tgr, do you think we should find an alternative solution and repurpose this task or can we close it as invalid/fixed?

Jdlrobson closed this task as Resolved.Aug 29 2016, 10:10 PM
Jdlrobson claimed this task.

As written this is solved.

Tgr added a comment.Aug 29 2016, 10:13 PM

If you want to avoid loading the Hovercards JS when NavPopups is enabled, you need a better way to detect it, but that should probably have its own task. If you don't care about that, I don't see much disadvantage to checking on every hover.

CKoerner_WMF reopened this task as Open.Oct 4 2017, 2:54 PM
CKoerner_WMF added a subscriber: CKoerner_WMF.

This appears to still be happening, at least on the Italian Wikipedia.

Steps to reproduce:

  1. Visit it.wikipedia.org
  2. Log in
  3. Enable Popup di navigazione (NavPopups) in user preferences
    1. https://it.wikipedia.org/wiki/Speciale:Preferenze#mw-prefsection-gadgets
  4. Visit an article and hover over a link.

Both features appear, sometimes overlapping.

Expected behavior: After enabling NavPopups gadget, Page Previews should be suppressed.

I reopened this task as it appeared to be the most recent. Happy to open a new task if desired.

Elitre added a subscriber: Elitre.Oct 4 2017, 2:55 PM
Jdlrobson closed this task as Resolved.Oct 17 2017, 9:12 PM

Thanks! I've opened up T178438 with more specifics to avoid confusion with the Hungarian case.