Page MenuHomePhabricator

Investigate feasibility of styling Special:Preferences sections as menu items instead of scrollable tabs on mobile web [8hr]
Closed, ResolvedPublicSpike

Description

We are exploring different ways of displaying Special:Preferences on mobile web so that the visual style is more intuitive to users. The current style, where each section is a tab as part of a scrollable bar, is unintuitive on mobile.

To find a better layout we are considering a menu style, where the tabs would be arranged vertically and open up sub-menus. This style would only apply on mobile, and we are not currently planning on making changes to the desktop view. We want to understand whether it is technically feasible to lay the page out like this on mobile without changing the desktop page, and without creating an entirely new mobile-specific Special page.

Example designs

iPhone 8 - 102.png (911×375 px, 48 KB)
iPhone 8 - 103.png (927×375 px, 43 KB)

Questions

  • What is the technical feasibility of implementing a menu design like those sketched above for Special:Preferences on mobile devices (i.e. in the MinervaNeue skin)?
  • The designs above implement a list view menu layout. Currently there is no such menu demonstrated here. One layout we might consider, and is available currently in OOUI, is the BookletLayout show below:

Screen Shot 2022-06-08 at 11.12.40 AM.png (670×2 px, 65 KB)

  • The front end layout is based on Handlebars templating which means we can create a list item view in a HandleBars template and reuse as needed.
  • Desktop and mobile both share the same preference page - which requires making changes to mediawiki core (heaviest lift). However since MobileFrontEnd provides a way to overwrite/re-route core pages specifically for mobile, we may be able to create a MobileFrontEnd specific SpecialPreferences page( slightly less heavy lift)
  • We have icons available to be used here
  • Could we implement this design without also redesigning the desktop Preferences layout?
  • We could implement this design without redesign and hook into the mobile page logic to present a mobile friendly <template> version in list view.
  • Yes, MobileFrontEnd might provide a way for us to create a mobile specific version of preferences with css/js injection.
  • Otherwise due to the tightly coupled nature of this menu in mediawiki core as demonstrated here and here a refactor would be needed.

Event Timeline

Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptMay 26 2022, 10:07 AM
Restricted Application added a subscriber: Masumrezarock100. · View Herald Transcript
jsn.sherman subscribed.

@eigyan per our conversation, please follow up on this piece:

The front end layout is based on Handlebars templating which means we can create a list item view in a HandleBars template and reuse as needed.
[...]
We could implement this design without redesign and hook into the mobile page logic to present a mobile friendly <template> version in list view.

with a little more investigation to ensure that we can actually make the change to just that subset of page section content and alter the markup as desired.

Just thinking about it: It would also need to be elastic enough that it could accommodate for changes in what preferences exist based on installation/removal of extensions and skins.

This feedback is coming from a place of ignorance about how skins work, not from a place of knowing any different from what you're suggesting.

@eigyan
I'd recommend taking a look at seeing how far we could go by just using custom css/js for the mobile target on Special:Preferences.

The MobileFrontend extension lets us do that fairly easily. For instance, check out the custom resources specified for mobile diff or nearby pages. extension.json will point you in the right direction to see the files and directories that would need to be created to do this kind of customization for preferences
https://gerrit.wikimedia.org/g/mediawiki/extensions/MobileFrontend/+/5f2381ce714d0e6173670a91ddcdb8bbdde9d0ea/extension.json

eigyan updated the task description. (Show Details)
eigyan updated the task description. (Show Details)

@jsn.sherman this is the documentation I have been looking for. Many thanks Sir!

No problem!

I'm just making a note: while digging through things to understand how to customize things generally, I found the spot where all the OOUI tab business is getting setup for preferences:
https://gerrit.wikimedia.org/g/mediawiki/core/+/fa2c1cf12294e093eaad7d81ebc3507f9e58d4c2/includes/specials/forms/PreferencesFormOOUI.php
which is called here:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/fa2c1cf12294e093eaad7d81ebc3507f9e58d4c2/includes/specials/SpecialPreferences.php#130
That's generating the markup for the selectors in the ooui js code.
I temporarily disabled js for my local environment just to see what the markup looks like just with css

image.png (7×375 px, 613 KB)

This looks good to me! It's worth noting that the booklet layout is available in js ooui, but not php ooui, which is where the tab panels are currently created in preferences. I don't know if that is a big deal, but it looks like we'd be shifting the layouts around in the stack.