Page MenuHomePhabricator

mw-changeslist-legend should not be present on RecentChanges in Minerva skin
Closed, ResolvedPublic

Description

MediaWiki's RecentChanges Special page has a legend that doesn't render well on the Minerva skin in the MobileFrontend extension.

.mw-changeslist-legend should be hidden in this skin under @deviceWidthTablet, using the ResourceLoader skinStyles property.

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 15 2015, 8:00 PM
Jdlrobson triaged this task as Low priority.Sep 15 2015, 8:18 PM
Jdlrobson moved this task from Backlog to Bugs on the MobileFrontend board.Nov 4 2015, 5:24 PM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 27 2016, 4:23 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

Do I understand correctly, that the task can be completed just by adding a new css rule to skins.minerva.special.styles/common.less file, which will set display property to none, checking using media query that page width is smaller than @deviceWidthTablet ?

Instead of hiding it why not fix it to display nicely...? Maybe even collapsed by default for minerva.

The task says:

.mw-changeslist-legend should be hidden in this skin

But it is not a problem to fix it to display correctly, and I think it would be better than just hiding too.

Just a bit of progress report. Looks like I finally found the problem and made the legend render properly.
After a few hours of analyzing css and js of desktop and mobile pages, viewing diffs and grep-ing, I understood what the reason of the problem is. So legend doesn't render well because modules mediawiki.special.changeslist.legend, mediawiki.special.changeslist and mediawiki.special.changeslist.legend.js are not added to mobile version. Actually, they are added to the list of modules, which need to be loaded, but related js and css files are not loaded and not sent to client.
The solution, which I found is:

  1. Add needed css and js files to the resources folder in MobileFrontend extension.
  2. Modify js, so legend is collapsed by default on mobile devices
  3. Add missing modules to ResourceModules in extension.json file in MobileFrontend.

After these steps, legend is rendered properly (see screenshot below).

But I am not sure if this is the easiest possible sollution of the problem. Maybe I need to think of better ways of fixing this bug?

Great to see the progress and your analysis! :)

First of all: You, in general, don't need to copy code from mediawikiI/core to MobileFrontend, just to make sure, that it can be loaded. Simply adjust the module definition in the Resources.php file to contain a target key which is an array, e.g. [ 'mobile', 'desktop' ] :)

Secondly: I think this should be all. The legend looks well-styled now and given, that a recurring user can collapse the list by default (by clicking the "Collapse" link), I think this should be fine :)

@Florian Thank you for your reply! As I expected, there was an easier sollution. I will modify Resources.php file and upload changes to Gerrit soon.
Additionally, I have noticed, that the module mediawiki.special.recentchanges doesn't get loaded on mobile too. As the result, namespace checkboxes don't get disabled, when all namespace is selected. I think this bug is related to the one, we are working now on at the moment. So I think I will fix it too.
And I agree with your second point. Anyway, if anything needs to be changed later, please tell me and I will return and do it.

Change 329117 had a related patch set uploaded (by Phantom42):
Fix rendering issues on RecentChanges Special page

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

I uploaded patch to Gerrit, as you can see above. Additionally, I fixed styles of changes list too (for example, changes numbers are now colored). If anything is wrong - tell and I will fix it.

Florian closed this task as Resolved.Dec 25 2016, 5:41 PM
Florian assigned this task to nikitavbv.

Change 329117 merged by jenkins-bot:
Fix rendering issues on RecentChanges Special page

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