Page MenuHomePhabricator

Fix add discussion button on mobile
Closed, ResolvedPublic

Description

MobileFrontend doesn't display new section links. Talk page overlays have new section links, but it's tricky to find them from the talk page itself, and __NEWSECTIONLINK__ can be placed on content pages (e.g. village pump), where the talk overlay trick doesn't work at all. It's even worse because MF automatically adds a section edit summary without an option to remove it, so it ends up in misleading edit summaries when someone tries to create a new section on mobile by editing the last section.

Replication steps

Upon visiting https://en.m.wikipedia.org/wiki/Talk:Sandwich?mobileaction=beta there should be a "Add discussion" button at the bottom of the page if you are logged in.

It's possible that the JS is returning early.
An ideal fix would refactor the initialisation logic into one single function call and remove the return statements.

Acceptance criteria

The logic in skins.minerva.talk does not seem to be working. Please debug and fix it:
https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/master/resources/skins.minerva.talk/init.js#L74

Developer notes

This was broken by {rEMFR77d27d5c8a7d: Don't use .data for TalkOverlay and sanity check the returned title} which made the talk script terminate early if a talk icon was not present in the page.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 12 2017, 8:13 PM

@Tacsipacsi seems like you're describing multiple problems here. Am I correct? Can you also provide steps to reproduce the problems?

What are the multiple problems? I see one problem here​: there is no new section link on mobile talk pages (talk page means here any page which has a new section tab on Vector skin). Steps to reproduce: open any talk page on mobile (or using Minerva skin), and try to find the new section button. You won’t.

Jdlrobson renamed this task from Add new section link on mobile to Fix add discussion button on mobile.Jul 13 2017, 4:15 PM
Jdlrobson triaged this task as Medium priority.
Jdlrobson updated the task description. (Show Details)
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJul 13 2017, 4:15 PM
Jdlrobson moved this task from Backlog to Bugs on the MinervaNeue board.Jul 13 2017, 4:48 PM
Jdlrobson updated the task description. (Show Details)Aug 7 2017, 2:41 PM
Jdlrobson added a subscriber: Jdlrobson.

Happy to mentor this task

Happy to mentor this task

@Jdlrobson Thanks for accepting to mentor this task. I will ping you on IRC so we can talk about it.

Restricted Application added a subscriber: jeblad. · View Herald TranscriptAug 25 2017, 1:48 PM
jeblad removed a subscriber: jeblad.Aug 25 2017, 10:04 PM
Jdlrobson updated the task description. (Show Details)Sep 28 2017, 7:49 PM

Change 381315 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Render add discussion button in PHP not JS

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

Jdlrobson moved this task from Inbox to Doing on the User-Jdlrobson board.Sep 29 2017, 1:23 PM
Jdlrobson moved this task from Doing to Inbox on the User-Jdlrobson board.Oct 11 2017, 11:13 PM
Jdlrobson moved this task from Inbox to Done on the User-Jdlrobson board.Oct 16 2017, 10:46 PM

Change 381315 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Render add discussion button in PHP not JS

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

@Tacsipacsi seems like you're describing multiple problems here. Am I correct? Can you also provide steps to reproduce the problems?

It looks like it’s really multiple problems as one has been fixed (the new section button appears on talk (odd namespace) pages), while the other not (the button still doesn’t appear on even namespace pages with __NEWSECTIONLINK__ magic word, but does appear on odd namespace pages with __NONEWSECTIONLINK__).

NONEWSECTIONLINK and NEWSECTIONLINK are not supported by the Minerva skin (this is true for most of the behavioural magic words). Note that the Minerva skin does not have the tabs that other skins have so is not subject to the same rules. I've updated https://m.mediawiki.org/wiki/Help:Magic_words to capture this.

Jdlrobson closed this task as Resolved.Oct 17 2017, 11:35 PM
Jdlrobson claimed this task.

https://m.mediawiki.org/wiki/Help_talk:Magic_words now shows the add discussion button.