Page MenuHomePhabricator

Wikidata.org: On mobile, sections stays expanded even it's disabled in settings
Closed, ResolvedPublic3 Estimated Story Points

Description

We want to change the setting wgMFCollapseSectionsByDefault to true on Wikidata per investigation in T263537.

Previous content:

When mobile "Expand all sections" setting in mobile false, sections are not collapsed

This is visible on wikidata.org where wgMFCollapseSectionsByDefault is false.

Steps to Reproduce:
  1. Go to your settings (Special:MobileOptions), and see that "Expand all sections" option appears
  2. Check that option is turned OFF by default
  3. Go to a page with sections. Example: https://m.wikidata.org/wiki/WD:AN. Observe that the sections are expanded.
Expected behavior

Both pages should have collapsed sections
OR
"Expand all sections" button in Special:MobileOptions should be turned ON by default as wgMFCollapseSectionsByDefault is false

Note: Even though one can access Special:MobileOptions, the actual option is only shown on devices detected to be mobile and also the bug can only be seen there. Sections are always expanded on desktop irrespective of this setting.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@MaxSem That's your patch, isn't it? Do you remember why you commited it?

@Ammarpad Why it's not bug report?

As already well-explained above by multiple people, because this is not a bug. I wonder why you're not seeing this.

That said, this task currently as written is invalid. Unless it's converted to proper request for enabling the collapsing, (which itself will only be valid after getting community consensus or other appropriate means for making such changes to Wikidata)

@Masumrezarock100 @Ammarpad
Well I'm not seeing this wrong. If you care to go to settings in Mobile site there's a button ''Expand all sections''. And that button doesn't work as it says, so I wonder why it's not bug?

Plus even if I try to see it your way there's no community consensus too to make it that way. Even if there is that button should be hidden then, beacuse it is misleading (maybe another task needed).

So this task is clear that ''there's a button in settings, which doesn't work as it should be".

@Masumrezarock100 @Ammarpad
Well I'm not seeing this wrong. If you care to go to settings in Mobile site there's a button ''Expand all sections''. And that button doesn't work as it says, so I wonder why it's not bug?

I did go before commenting here. I understand what you mean, see below

Plus even if I try to see it your way there's no community consensus too to make it that way. Even if there is that button should be hidden then, beacuse it is misleading (maybe another task needed).

Not all changes on Wikimedia projects have community consensus, especially for preferences that user can disable and even more so in Wikidata project.
Plus, even if there was no consensus, the fact that this was not challenged for five years, is enough to make it a consensus itself.

So this task is clear that ''there's a button in settings, which doesn't work as it should be".

Yeah, this is what I think. A separate task for MobileFrontend: if the settings has been disabled sitewide, don't show this to end-user which gives false impression that a user can change it, when in fact no one could (like we have here).

Not all changes on Wikimedia projects have community consensus, especially for preferences that user can disable and even more so in Wikidata project.

Yeah that's what the issue is, it's not a normal feature which can be enabled/disabled, so IMO a consensus should be there.

Plus, even if there was no consensus, the fact that this was not challenged for five years, is enough to make it a consensus itself.

No I don't agree with you on this. IMO this is not challenged is because lack of use of mobile site by Wikidata users. And even if it not challenged it is really not user friendly, like if somebody go https://m.wikidata.org/wiki/Wikidata:Requests_for_deletions you can't even load that page properly with those sections expanded.

Yeah, this is what I think. A separate task for MobileFrontend: if the settings has been disabled sitewide, don't show this to end-user which gives false impression that a user can change it, when in fact no one could (like we have here).

Yeah, I originally tagged mobileFrontend but somebody removed saying mobileFrontend is doing what should be. So if you have better luck convincing them, feel free to go for another task.

According to config wgMFCollapseSectionsByDefault is set to false so MobileFrontend is doing what it's supposed to do here.

Indeed. But that option in mobile settings shouldn't appear if wgMFCollapseSectionsByDefault is set to false. It looks like a bug if we see it in that way.

OK.... I have looked into this further... I have partly struck my comment in T239195#5699077 as a result.

Summary.

  1. Mobile section collapsing is disabled by default on Wikidata.
wmf-config/InitialiseSettings.php
'wgMFCollapseSectionsByDefault' => [
	'default' => true,
	'wiktionary' => false,
	'wikidata' => false,
],

Why it's disabled is beyond the scope of this task.

  1. Setting "wgMFCollapseSectionsByDefault' => false;" means that, per default sections are to not be collapsed sitewide. BUT a user can still override this setting by going to the Special:MobileOptions and turning on the 'Expand all sections.'
  1. I investigated this by going to https://m.wikidata.org/w/index.php?title=Special:MobileOptions (note: the actual option can only be seen on mobile) and turning off "Expand all sections". It works correctly as expected: Sections are not expanded, EXCEPT on some few pages. These pages where this collapsing is not taking place have something in common, they have a particular template at the top from what I understand. (This is what needs further investigation)
  1. Going to the same special page as above (no. 3) and turning on "Expand all sections" works correctly as expected: Sections are all expanded.

I started rewriting the task description to make the issue clear.

But then I realized, Why should wgMFCollapseSectionsByDefault being false mean that this setting should not appear for "Expanding all sections"?

The current behaviour is:

  • wgMFCollapseSectionsByDefault is false so the sections on pages are not collapsed by default.
  • "Expanding all sections" is false, so MF does no expand any collapsed sections

"Expanding all sections" doesn't however say that when it is disabled, it will actually collapse sections, it will just do nothing, and leave the page as the default, which on wikidata, seems to be expanded.

Pinging @Jdlrobson again to see if he has any thoughts here as I kind of agree that everything is working as expected, but perhaps there is something for having a collapse by default option in the settings or something like that.

Addshore renamed this task from Wikidata: On Minerva skin section always stays expanded even it's disabled in settings to "Expanding all sections" setting and wgMFCollapseSectionsByDefault interaction is slightly unexpected..Nov 28 2019, 10:24 AM
Addshore updated the task description. (Show Details)
Addshore moved this task from needs discussion or investigation to monitoring on the Wikidata board.
Addshore moved this task from Incoming to Monitoring on the Wikidata Mobile board.

Mild comment conflict (at the same time) with @Ammarpad there, but it looks like they investigated more than I did!

Ammarpad renamed this task from "Expanding all sections" setting and wgMFCollapseSectionsByDefault interaction is slightly unexpected. to Wikidata: On mobile, some sections stays expanded even it's disabled in settings .Nov 28 2019, 10:33 AM

Thanks, Addshore. Renamed the task back, this configuration setting is working correctly, the edge case is something else.

I have updated the task to state what's actually happening here. The templates obstructing the collapsing might be many and that is what needs further investigation. But in brief I found https://www.wikidata.org/wiki/Template:Editnotice and Template:Welcome to be the most common ones.

Now go to a page which DOES NOT have Template:Editnotice at the top but do have sections. Example https://m.wikidata.org/wiki/User_talk:Pigsonthewing. Observe that the sections are collapsed.

@Ammarpad I can't reproduce this. For me it's always expanded on all pages.

And it looks like this task is turning towards hiding that button if wgMFCollapseSectionsByDefault is false by default, which is not why I filled this report.

Even it's gonna stay false by default, that button in settings should be turned on by default as if someone wants them collapsed they can turn it off.

I have updated the description as I have checked on multiple mobile devices and none have sections collapsed in any state (not even on pages that don't have Template:Editnotice).

I started rewriting the task description to make the issue clear.

But then I realized, Why should wgMFCollapseSectionsByDefault being false mean that this setting should not appear for "Expanding all sections"?

The expanding all sections setting is basically a client side JS override of wgMFCollapseSectionsByDefault. If wgMFCollapseSectionsByDefault is false, there is no need for this setting and its existence on Special:MobileOptions is confusing and should likely be removed.

Pinging @Jdlrobson again to see if he has any thoughts here as I kind of agree that everything is working as expected, but perhaps there is something for having a collapse by default option in the settings or something like that.

I'd rather not add further complications here :)

1997kB renamed this task from Wikidata: On mobile, some sections stays expanded even it's disabled in settings to Wikidata: On mobile, sections stays expanded even it's disabled in settings .Dec 12 2019, 10:37 AM

@Addshore Does this require onwiki discussion or discussion here on phab?

Aklapper renamed this task from Wikidata: On mobile, sections stays expanded even it's disabled in settings to Wikidata.org: On mobile, sections stays expanded even it's disabled in settings .Apr 23 2020, 9:50 AM

@Addshore Does this require onwiki discussion or discussion here on phab?

If the desire is to have the default behaviour changed on Wikidata then I will ping @Lea_Lacroix_WMDE and @Lydia_Pintscher here.

If the desire if to only hide the button (which from T239195#5699582 i see it is not) then reading web product should be poked. :)

If the desire if to only hide the button (which from T239195#5699582 i see it is not) then reading web product should be poked. :)

Happy to review a patch for that

In our wikis, some users are asking about this behavior too. Their expectations are completely as same as @1997kB's comments. More specifically, they are expecting as follows while
$wgMFCollapseSectionsByDefault is disabled:

  • "Expanding all sections" button in settings should be turned on by default to expand sections by default.
  • "Expanding all sections" button SHOULD EXIST in settings, because some users want to collapse sections by default.
    • In other words, users don't hope that this button will be removed.

@Jdlrobson, @Addshore Why do you think that "Expanding all sections button" should be removed? @1997kB didn't say so in any of his/her comments. Please reread them.

@Ochaochaocha3 I am coming at this from a software engineer point of view, not a user point of view. The Wikidata.org situation where sections are expanded by default is different from all other wikis where sections are collapsed by default. Therefore the setting you are using as not been actively tested or designed with that in mind. The setting was only ever designed to expand sections by default not to do the opposite. Therefore to get it to work requires rethinking and possibly completely rewriting what is actually a very little used feature. AS maintainer I have no desire to add additional complexity to the codebase.

So as far as I'm concerned this is a product decision which is what T239195#6079940 suggests. Either Wikidata matches the configuration of other projects and collapses sections on mobile by default or I will have this option removed.

FWIW my personal preference is the former. I would like to remove the wgMFCollapseSectionsByDefault configuration option from MobileFrontend. If that happens the settings you and @1997kB are referring to will work as expected however people who like the sections expanded will now need to set the setting.

I just discussed this with Adam and we said we should try and see if changing the global setting has a negative effect on the mobile view of Wikidata. If that's ok then we can just remove it.
My gut feeling is that we added it as part of the improvements made around 2014 by Bene to have an acceptable mobile view for Wikidata but since none of us can recollect the details let's give it a try.

Any updates here? Is there anything blocking the associated configuration patch? Happy to help if necessary.

Sorry I thought you were going to handle the patch and didn't prioritize the task accordingly. If you want to upload the patch please do. Otherwise we'll handle it in camp.

I can help with code review but I'd rather campsite took care of this as I'm not 100% familiar with the wikidata interface and wouldn't feel comfortable testing it.

I could swear I was able to reproduce this issue earlier, either yesterday or today – but now I can’t anymore. Instead, regardless of “expand all sections” option in Special:MobileOptions, sections on User_talk:1997kB always become collapsed when I load the page, whether I’m logged in or in a private window. I tried setting wgMFCollapseSectionsByDefault to true on a debug server, and it didn’t seem to make any difference.

Can anyone else still reproduce this issue, or figure out what’s going on?

Possibly related to T263832, or to the “heavy-duty work going on with MobileFrontend sections around that time” that may have caused that issue; adding back MobileFrontend since I feel like the extension isn’t obeying the config setting anymore. (Or maybe I’m just having a severe case of Friday brains. Fixing the UBN comes first, anyways – this issue can surely wait until next week.)

Strange, I still get collapsed sections (click the thumbnail to play the gif):

Peek 2020-09-28 14-57.gif (700×420 px, 1 MB)

Click on "Read as wiki page" while you are on talk page. Alternatively you can see this more clearly on https://m.wikidata.org/wiki/WD:AN

After clicking read as wiki page difference can be seen when you will compare it with https://meta.m.wikimedia.org/wiki/User_talk:1997kB

Lydia_Pintscher updated the task description. (Show Details)
Lydia_Pintscher set the point value for this task to 3.

Change 633772 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Don't show the mobile option when sections are already expanded

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

Change 634039 had a related patch set uploaded (by Itamar Givon; owner: Itamar Givon):
[operations/mediawiki-config@master] Set Wikidata MF to collapse sections by default

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

FWIW I tried this locally and was not positive it actually succeeded:

  1. Set the $wgMFCollapseSectionsByDefault flag to true
  2. "Expanding all section" option was off

My main page includes a section, and that section was expanded - as a default, but I would expect it to be collapsed.

My main page includes a section, and that section was expanded - as a default, but I would expect it to be collapsed.

I can confirm Itamar's observation. I have verified that wgMFCollapseSectionsByDefault correctly makes its way into MobileFrontend but despite some digging into it could not establish a scenario (taking care to simulate a proper mobile scenario and the impact of widescreen devices) where its false value makes page sections shown collapsed by default.

This probably has something to do with this quote by @Jdlrobson

The setting was only ever designed to expand sections by default not to do the opposite. Therefore to get it to work requires rethinking and possibly completely rewriting what is actually a very little used feature.

It would be interesting what's the state about this at the moment - and if we should expect https://gerrit.wikimedia.org/r/633772/ to act as a solution (I did not see an impact; it being checked out or not).

https://gerrit.wikimedia.org/r/633772/ simply hides the option from the settings page: https://en.m.wikipedia.org/wiki/Special:MobileOptions

Screen Shot 2020-10-15 at 7.42.50 AM.png (1×894 px, 102 KB)

The settings will only appear and work on mobile devices ( screen resolution < 720px) and is meant to override the default behaviour on mobile. It does not impact talk pages.. On a tablet sections will always be expanded.

I can confirm https://gerrit.wikimedia.org/r/634039 is the correct fix here. https://gerrit.wikimedia.org/r/633772/ just removes confusion by what the feature is supposed to do.

I get collapsed sections on localhost, even on the main page with just one section (“getting started”), as long as the screen is narrow enough. That’s with the default setting of wgMFCollapseSectionsByDefault (i. e. I didn’t touch my LocalSettings.php), because true is the default and that’s the value we want to restore.

Fascinating. Tried it with the same page I created last Thu when messing with it and now the sections are shown as collapsed. I don't comprehend what happened but confirm Lucas' observation.

Screenshot_2020-10-19 Foo bar - docker-default.png (553×388 px, 13 KB)

Change 634039 merged by jenkins-bot:
[operations/mediawiki-config@master] Set Wikidata MF to collapse sections by default

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

Mentioned in SAL (#wikimedia-operations) [2020-10-20T11:15:13Z] <lucaswerkmeister-wmde@deploy1001> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:634039|Set Wikidata MF to collapse sections by default (T239195)]] (duration: 00m 56s)

Change 633772 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Don't show the mobile option when sections are already expanded

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