Page MenuHomePhabricator

Change blank user page to mirror mobile experience (Allow customisations of Article::getSubstituteContent for different namespaces)
Open, MediumPublic

Description

Pulling out the discussion from https://phabricator.wikimedia.org/T248141#5988111

This might make sense to make a core feature at some point (or its own tiny extension, bundled with core). If we do, we'll need to resolve the tech debt around the handling of placeholders for pages that do not yet exist. The different handlers that exist for this in core are currently being bypassed, which likely causes some long-tail extension or gadget compat issues already.

For example, we already have different defaults for most wiki pages vs file pages, and a special header for talk pages. And a variant for when there is no permission to create it.

  • noarticletext
  • noarticletext-nopermission
  • talkpageheader
  • filepage-nofile-link

And there's more on the extension hooks side as well, such as the hooks used by ArticlePlaceholder and GlobalUserPage, which also handle pages that don't "exist".

Having first-class support for user pages here would certainly make sense. Figuring out where it properly fits in between all these will be a bit more difficult though, so probably best for a later task :)

On mobile when a user visits a user page that doesn't exist they are prompted to create one. This helps new users understand that their user page is a place they can express themselves and something they can edit

Screen Shot 2020-03-23 at 11.24.10 AM.png (798×1 px, 98 KB)

During the bug T248141 this code leaked to desktop and prompted the question - why is this mobile only?

Developer notes

We'd like to port the code in MobileFrontend into core and generalise it.
Looking at the existing code, I'd suggest with refactoring showMissingArticle so that it always uses getSubstituteContent.
From there possibly a new Content class e.g. BlankPageContent could be created.

Once such an architecture is in place BlankUserPageContent would be added and code from MobileFrontend migrated.
The two methods that need to be migrated from MobileFrontend are blankUserPageHTML, getUserPageContent and buildPageUserObject

Any advice with how to achieve this (particularly architecture) would be appreciated.

product notes

The bug was live in 1.35.0-wmf.24; 2020-03-17 and fixed in MW-1.35-notes (1.35.0-wmf.27; 2020-04-07) on all wikis. We should check if there were any train delays during that time but there is thus about 3 weeks of data we can look at to see how it impacted user page creations.

Event Timeline

Change 582891 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Light refactor of showMissingArticle method

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

Oblanco79 renamed this task from Allow customisations of Article::getSubstituteContent for different namespaces to SubstituteContent for different namespaces.Mar 26 2020, 7:12 PM
Reedy renamed this task from SubstituteContent for different namespaces to Allow customisations of Article::getSubstituteContent for different namespaces.Mar 26 2020, 10:20 PM
Jdlrobson renamed this task from Allow customisations of Article::getSubstituteContent for different namespaces to Change blank user page to mirror mobile experience (Allow customisations of Article::getSubstituteContent for different namespaces).Apr 3 2020, 4:00 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: MMiller_WMF.
ovasileva triaged this task as Medium priority.Apr 6 2020, 12:07 PM
ovasileva moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.

Change 582891 abandoned by Jdlrobson:
Light refactor of showMissingArticle method

Reason:
Abandoning now. Hopefully useful later if and when its a focus.

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

Requires product planning.

Having a more friendly user experience on desktop for user pages seems helpful with desktop improvements/growth initiatives.