Page MenuHomePhabricator

Wikilove and DiscussionTools do not get along
Closed, ResolvedPublicBUG REPORT

Description

DiscussionTools puts its subscribe links in the wikilove popup which looks odd. See screenshot from just now on mediawiki.org.

wikilove.png (1×2 px, 260 KB)

Event Timeline

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

Interesting. To begin with, the preview sends action=parse & format=json & formatversion=2 & contentmodel=wikitext & prop=text & disableeditsection=true & pst=true & text=<whatever> (spaces added for clarity), i.e. both disableeditsection and pst are set, which means that whatever happens, it’s DiscussionTools’ fault, not WikiLove’s, as one of these (IIRC currently pst) should disable the buttons.

Based on the configuration, I get varyingly broken result:

PageShow discussion activity preference ENABLEDShow discussion activity preference DISABLED
User talk:Clump (Flow talk page on mediawiki.org)❌ Both button-like and link-like affordances appear❌ Both button-like and link-like affordances appear
User talk:Bawolff (wikitext talk page on mediawiki.org)❗ Button-like affordance appears❗ Link-like affordance appears
Szerkesztővita:Tgr (wikitext talk page on huwiki)✅ Nothing appears✅ Nothing appears

Wikilove should add preview=1 to its API query, which will hide all interactive elements added by DiscussionTools (including the reply and subscribe buttons).

[While we're there, it should probably also add sectionpreview=1, which will change how references work in the preview, in the unlikely case someone uses them in a talk page message; this has no effect on DiscussionTools though.]

(…) i.e. both disableeditsection and pst are set, which means that whatever happens, it’s DiscussionTools’ fault, not WikiLove’s, as one of these (IIRC currently pst) should disable the buttons.

disableeditsection used to disable DiscussionTools interactive elements, but we changed this back in T314260, because that caused them to not appear on old revisions of pages, and we wanted to show them there.

I agree that it's not very untuitive that preview=1 would do this, but I think it's the best thing we have. We had a short discussion about this recently on T314623 and my impression was that everyone grudgingly accepted that this is how it works. I'm open to changing this if anyone comes up with a better solution.

Based on the configuration, I get varyingly broken result:

PageShow discussion activity preference ENABLEDShow discussion activity preference DISABLED
User talk:Clump (Flow talk page on mediawiki.org)❌ Both button-like and link-like affordances appear❌ Both button-like and link-like affordances appear

This happens because we always include both kinds of affordances in the HTML (to avoid splitting the parser cache, and to allow toggling between them without reloading the page), and then use CSS to hide the wrong one. This CSS is only loaded on wikitext pages, because DiscussionTools only works on wikitext pages. I think Wikilove is wrong to render the preview using the regular wikitext parser here, but I guess Flow doesn't expose a preview API. With the preview=1 fix, both affordances should disappear on this page too, anyway.

PageShow discussion activity preference ENABLEDShow discussion activity preference DISABLED
Szerkesztővita:Tgr (wikitext talk page on huwiki)✅ Nothing appears✅ Nothing appears

This happens because Wikilove doesn't set the page title when parsing, which means that the default title "API" is used, which is in the main namespace, which is not a discussion namespace on hu.wp (but it is on MediaWiki.org). This should be fixed too to get consistent styling for headings when you have enabled DiscussionTools visual enhancements ("Show discussion activity").


I'll probably write a patch next week, but if anyone else feels like maintaining Wikilove, feel free to send one for review ;)

Change 851659 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/WikiLove@master] Set sectionpreview=true when parsing preview

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

Change 851659 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@master] Set sectionpreview=true when parsing preview

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

Change 852927 had a related patch set uploaded (by Tacsipacsi; author: Tacsipacsi):

[mediawiki/extensions/WikiLove@master] Set page title on preview, pass section header as is

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

Change 852927 merged by jenkins-bot:

[mediawiki/extensions/WikiLove@master] Set page title on preview, pass section header as is

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

ppelberg claimed this task.