Page MenuHomePhabricator

Hovercards: Disambiguation text should not be displayed
Closed, ResolvedPublic

Description

When viewing a hovercard sometimes the text for a disambiguation link or hatnote shows in the hovercard.

see link to https://en.wikipedia.org/wiki/Avalanche from https://en.wikipedia.org/wiki/Geology#Applied_geology (outdated example)


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=63045
https://bugzilla.wikimedia.org/show_bug.cgi?id=63998
https://bugzilla.wikimedia.org/show_bug.cgi?id=64708

Details

Reference
bz63164

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:07 AM
bzimport added a project: Page-Previews.
bzimport set Reference to bz63164.
bzimport added a subscriber: Unknown Object (MLST).

Prateek to discuss the behavior of text extract with Max.

In navpopups, there are a large number of Regex rules to remove things that interfere with the preview. (Search for "STARTFILE: previewmaker.js" in https://en.wikipedia.org/wiki/MediaWiki:Gadget-popups.js to see the many "Previewmaker.prototype" subsections there.)

I would guess that Hovercards will need the same extensive set of 'exclusions'? (plus more, such as the {{pagebanner}} templates at the top of every WikiVoyage article.)

Digging around, it appears that Extension:TextExtracts removes elements via their CSS classes, here https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FTextExtracts/c56742eb7149ef9aa5b8cf31c62c4c71333a00f5/TextExtracts.php#L51 so possibly you just need to compile a set of additions for that? (eg. class="topbanner" for the WikiVoyage templates, and class="dablink" for the various types of hatnote.)

(In reply to Quiddity from comment #2)

In navpopups, there are a large number of Regex rules to remove things that
interfere with the preview. (Search for "STARTFILE: previewmaker.js" in
https://en.wikipedia.org/wiki/MediaWiki:Gadget-popups.js to see the many
"Previewmaker.prototype" subsections there.)

I would guess that Hovercards will need the same extensive set of
'exclusions'? (plus more, such as the {{pagebanner}} templates at the top of
every WikiVoyage article.)

Digging around, it appears that Extension:TextExtracts removes elements via
their CSS classes, here
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FTextExtracts/
c56742eb7149ef9aa5b8cf31c62c4c71333a00f5/TextExtracts.php#L51 so possibly
you just need to compile a set of additions for that? (eg. class="topbanner"
for the WikiVoyage templates, and class="dablink" for the various types of
hatnote.)

In many places disambiguation links are just entered as
" :''BLA'' " though rather than through any template meaning it can't be filtered on CSS (AFAIK).

(In reply to Lokal_Profil from comment #3)

In many places disambiguation links are just entered as
" :''BLA'' " though rather than through any template meaning it can't be
filtered on CSS (AFAIK).

True. Although, that itself is usually a flaw. I've only encountered it on wikis that didn't have the appropriate templates at all, or where a wikignome hadn't yet fixed the occurrence. Hatnotes /should/ be wrapped in CSS, for this and other reasons.

Change 125689 had a related patch set uploaded by Prtksxna:
Add classes and elements to the exclusion list

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

(In reply to Quiddity from comment #4)

(In reply to Lokal_Profil from comment #3)

In many places disambiguation links are just entered as
" :''BLA'' " though rather than through any template meaning it can't be
filtered on CSS (AFAIK).

True. Although, that itself is usually a flaw. I've only encountered it on
wikis that didn't have the appropriate templates at all, or where a
wikignome hadn't yet fixed the occurrence. Hatnotes /should/ be wrapped in
CSS, for this and other reasons.

True. Might it not be worth adding a generic ".hideFromExtracts" css-filter which local wikis can add to templates (or other classes) which they feel should be excluded. Populating TextExtracts.php with every variant we find seems like a cumbersome way to do it.

Marking "New" as the patch was rejected/diverted.
CCing MaxSem, as he has relevant knowledge.

(In reply to Lokal_Profil from comment #6)

True. Might it not be worth adding a generic ".hideFromExtracts" css-filter
which local wikis can add to templates (or other classes) which they feel
should be excluded. Populating TextExtracts.php with every variant we find
seems like a cumbersome way to do it.

(Tangent: Hmm, we do have (at Enwiki) [[MediaWiki:PDF Template Blacklist]] and [[Category:Exclude in print]], but that says it's currently broken due to bug 48052 )

I'm not sure what the current preferred method is, and whether it would be re-usable for this Hovercard purpose? I think ".noprint" is it? It's specified here: https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/skins%2Fcommon%2FcommonPrint.css#L114
But see also: https://en.wikipedia.org/wiki/MediaWiki:Print.css
Beyond that, I'm out of my depth.

Change 126226 had a related patch set uploaded by Prtksxna:
TextExtracts: Add classes and elements to the exclusion list

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

Change 125689 abandoned by Prtksxna:
Add classes and elements to the exclusion list

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

Howerdcards show elements with style="display:none", e. g. https://docs.google.com/file/d/0B8timSDHkFaWVEd4T19tLUxXNXM/edit.
I think they should be hidden even if them have no classes.

  • Bug 63998 has been marked as a duplicate of this bug. ***

Unable to recreate this on the links in the description.

The link in the description had the problem that Lokal_Profil and I discussed above (not using a template, just using indented/italic text), but someone has fixed it since then.
I just fixed a similar error, here: https://en.wikipedia.org/w/index.php?title=Physical_geography&diff=689076843&oldid=685075066

I've updated the docs, here: https://www.mediawiki.org/w/index.php?title=Beta_Features/Hovercards&diff=1931329&oldid=1921204

I think this can probably be closed as invalid - however there might be other good reasons to push the code in https://gerrit.wikimedia.org/r/#/c/125689/1/TextExtracts.php ?

Thanks!

I think this can probably be closed as invalid - however there might be other good reasons to push the code in https://gerrit.wikimedia.org/r/#/c/125689/1/TextExtracts.php ?

Won't get merged in its current form. I'll move it to mediawiki-config and update this task once its done.

Jdlrobson lowered the priority of this task from Medium to Low.Dec 7 2015, 4:44 PM
Jdlrobson subscribed.

@Jdlrobson This seems very different from T130671 which it was merged into.

That one is about showing hovercards for disambiguation pages. This one is about how to avoid showing the italicised text at the top of many articles (which normally refers to disambiguation).

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

@Lokal_Profil thanks for letting me know are you able to update the example to make the description for this task clearer?

Jdlrobson updated the task description. (Show Details)

@Lokal_Profil thanks for letting me know are you able to update the example to make the description for this task clearer?

So I went through the discussion above and I actually think it can be closed as resolved as a consequence of @Quiddity's doc update

The link in the description had the problem that Lokal_Profil and I discussed above (not using a template, just using indented/italic text), but someone has fixed it since then.
I just fixed a similar error, here: https://en.wikipedia.org/w/index.php?title=Physical_geography&diff=689076843&oldid=685075066

I've updated the docs, here: https://www.mediawiki.org/w/index.php?title=Beta_Features/Hovercards&diff=1931329&oldid=1921204

I think this can probably be closed as invalid - however there might be other good reasons to push the code in https://gerrit.wikimedia.org/r/#/c/125689/1/TextExtracts.php ?

Possibly there is still something actionable based on this comment by @Prtksxna:

I think this can probably be closed as invalid - however there might be other good reasons to push the code in https://gerrit.wikimedia.org/r/#/c/125689/1/TextExtracts.php ?

Won't get merged in its current form. I'll move it to mediawiki-config and update this task once its done.

tested in Chrome 56.0.2924.87, Firefox 51.0.1, Safari 9.1.3

  1. Go to the article for "Dog": https://en.wikipedia.beta.wmflabs.org/wiki/Dog
  2. Hover over "Man's best friend"
  3. Preview does not contain disambiguation text
  4. Select "Man's best friend"
  5. Disambiguation text appears in the article

Resolving.