Page MenuHomePhabricator

Allow configuration of the Minerva menu
Open, MediumPublicFeature

Assigned To
None
Authored By
Jidanni
Apr 3 2014, 4:35 AM
Referenced Files
F5319974: Screen Shot 2017-01-20 at 12.08.59 PM.png
Jan 20 2017, 8:11 PM
Tokens
"Like" token, awarded by Kghbln."Like" token, awarded by Reception123."Like" token, awarded by Jdlrobson."Mountain of Wealth" token, awarded by Qgil.

Description

Currently the menu contains various links but is not customisable either via MediaWiki:Sidebar or LocalSettings.php

This is due to the limited space available in the menu (it was not designed as a dumping ground for links) and the fact that links are more complex than they are in Vector e.g. they feature an icon/are more limited in how they can be laid out.

It should also be possible for mobile versions of skins (for example ?useskin=vector&useformat=mobile) to invoke these menus if wished)


Version: unspecified
Severity: enhancement
URL: http://lists.wikimedia.org/pipermail/mobile-l/2014-April/006882.html
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=63419

related requests

https://m.mediawiki.org/wiki/Topic:Uiervvqroaxj4ya9

Event Timeline

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

I think the problem is that for most using a hook is a bit overkill. Most 3rd parties want to people to edit an interface menu page or copy and paste something to LocalSettings.

The menu in other skins is configured via a mediawiki message (the logic is pretty complicated - check out SkinTemplate::buildContentNavigationUrls and/or https://www.mediawiki.org/wiki/Manual:Interface/Sidebar.

The problem with this approach for mobile is it is very limiting - it doesn't take into account icons for example or EventLogging and where text for items in a menu may be different from the page title (for example in mobile because of limited space we show a logout icon with no text). It also assumes all skins will have exactly the same menu, which is not practical for mobile - if you have a separate mobile experience it makes sense that the menu may be different.

I think at the very least we should strive to define the menu as a config option.

e.g.

'MFMenu' => { 'discovery': [], 'personal': [] ]

I'd rather not go down the message route, given it is wikitext there is far more that could go wrong. If we can derive icon values from keys/page titles, even better.

Just curious: what is the problem of offering the same approach as MediaWiki:Sidebar, just for mobile?

https://www.mediawiki.org/wiki/Manual:Interface/Sidebar

@QuimGil see https://phabricator.wikimedia.org/T65459#2760218
In case that wasn't clear, my worry with the interface sidebar approach is that it is more complicated. If we were to do that, I'd suggest we add tests and refactor the code in core beforehand. We could then add a MediaWiki:Mobile sidebar page that reused the logic and extended it to support the additional properties of our mobile menus.

Adding a config variable to control this would be considerably less work.

Just curious: what is the problem of offering the same approach as MediaWiki:Sidebar, just for mobile?

https://www.mediawiki.org/wiki/Manual:Interface/Sidebar

This! When you click the "hamburger" it pulls up the menu in a slide-out screen anyway, so why not make it as flexible and configurable for the end user as MediaWiki:Sidebar ?

Just curious: what is the problem of offering the same approach as MediaWiki:Sidebar, just for mobile?

https://www.mediawiki.org/wiki/Manual:Interface/Sidebar

From a technical perspective, I doubt there are any blockers. I'd like to hear from @Nirzar/Design.

Most of the discussion here and on https://www.mediawiki.org/wiki/Extension_talk:MobileFrontend seems to be about modifying the sidebar with PHP, but as a Wikipedia admin I need to do it with JavaScript. Is there an event that is fired when #mw-mf-page-left is done? If not, wouldn't it be easy to add such an event, so that mw.hook can be used to modify the sidebar?

Can you elaborate on the use case @Nirmos ? Why would you want to add a link via JavaScript?

What I meant was that this page and https://www.mediawiki.org/wiki/Extension_talk:MobileFrontend keeps referring to PHP files like LocalSettings that I can't modify anyway.

On Swedish Wikipedia (sv.wikipedia) there is a huge amount of bot created articles. The main criticism against these articles (at least from readers) is that Special:Slumpsida (Special:Random) in the sidebar is useless because 9/10 articles are created by bots. So, User:Prolineserver created a tool on tools.wmflabs that excludes bot created articles, and we have a link to that next to Special:Random. https://sv.wikipedia.org/wiki/MediaWiki:Gadget-ExkluderaRobotskapadeSidor.js does that nicely for the desktop version, and https://sv.wikipedia.org/wiki/MediaWiki:Gadget-ExkluderaRobotskapadeSidorMobil.js attempted to do the same for the mobile version, but I've removed it.

The important detail here is that I need to be able to add the link on the same line, so any PHP solution is unlikely to be sufficient anyway. Is there a reason not to add a mw.hook when the sidebar is done? It's one line of code, right?

mw.hook( 'mf-sidebardone' ).fire();

Thanks for sharing the use case!

Adding a link to the mobile menu would be a little problematic as the whole menu item is supposed to be tappable. Using JS would also not work for a variety of users who we send to this page: https://en.m.wikipedia.org/wiki/Special:MobileMenu

A PHP or a MediaWiki:Sidebar mobile approach would be better here, as you'd be able to add a small icon to the right just as we do with the username:

Screen Shot 2017-01-20 at 12.08.59 PM.png (169×251 px, 15 KB)

(imagine replacing Jdlrobson with Random and the power icon to the right with the new bot excluded link)

Side note: Is there an argument to be made that the exclude bot link should be default on mobile where the majority of users are readers (due to the difficulty of mobile editing)?

Still relevant, but mostly of use to third parties which is why there's been little movement here.

Jdlrobson renamed this task from Allow configuration of the mobilefrontend menu and allow it to apply to any skin in mobile mode to Allow configuration of the Minerva menu.Nov 22 2017, 5:57 PM

I recommend looking into what BlueSky does, both for icons and customisability. Essentially you probably want to create a second navigation interface message structured like the sidebar with an extra |item for icon specifying, with a parser that functions similarly to a simplified version of the sidebar parser that outputs a standard portlet/set of portlets. This approach allows for onwiki customisation both for the rendered html (editing the mediawiki namespace interface message) and js overrides using the standard addportletlink etc functions, which work with pretty much anything following the expected structure.

...may also want to add a config variable so third party sites can just throw in their sidebar instead of having an entirely separate menu.

@ovasileva @Jdlrobson just came across this in the design backlog, wanted to call it out since it's something we've been talking about with Advanced Mobile Contributions.

Can you elaborate on the use case @Nirmos ? Why would you want to add a link via JavaScript?

IMO, there should be a way to customize this menu using user JavaScript files (common.js / minerva.js). Using userscripts is the only way I see for an individual user to customize this menu for his / her needs.

Can you elaborate on the use case @Nirmos ? Why would you want to add a link via JavaScript?

IMO, there should be a way to customize this menu using user JavaScript files (common.js / minerva.js). Using userscripts is the only way I see for an individual user to customize this menu for his / her needs.

Got it. This task is purely from the sysop perspective. Customising via JS gadgets is captured in another bug:

T231925: Minerva should support skin agnostic mw.util.addPortletLink or similar

Great idea, mw.util.addPortletLink can be used customize this menu.

I have no idea why this MW-1.27-release (WMF-deploy-2016-01-12_(1.27.0-wmf.10)) tag is still here.

I'd welcome the possibility to customise the mobile sidebar menu:

  1. To be able to translate the menu item (in nia.wp's case, the menu items are half in Indonesian and half Nias);
  2. To add basic community links (announcement, village pump, sandbox, community portal and help).

@Slaia: Hi. This task is only about making customization possible. Specific content in the sidebar of specific websites is off-topic for this task. Thanks.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:23 PM
Aklapper removed subscribers: Nirzar, wikibugs-l-list.

The task [Open] [Feature] T65459 Allow configuration of the Minerva menu was already resolved by Extension:MinervaMenu that worked like charm until MW 1.39 when the hook MobileMenu was depreciated. The task can be resolved again by updating the orphaned extension MinervaMenu in line with the current hooks.