Category overlay in the MobileFrontend extension should refresh after a category was added to a page

MediaWiki has an extension called MobileFrontend which uses a skin called Minerva-Neue. You can see them in action when you go to (for example) instead of (note the "m" instead of "www" in the URL).

Steps to see the problem:

  1. Make sure you are on mobile and have categories:
  2. Navigate to
  3. Tap "Categories" at the bottom of the article
  4. Add the Dog article to the Pets Category
  5. Click "Save"

Problem to solve:

After adding the new category, the user does not see it in the list of categories until the user completely closes the categories page and returns back to categories again.

The problem is caused by the CategoryGateway. The _loadCategories function is called by the event handler, but the CategoryGateway is saved as an instance variable of the class, so it has been used before.

When the event listener category-added is called, the Gateway's property canContinue is false because of the first call. The first call to the function getCategories happened when the CategoryOverlay was loaded at the start.

You are expected to provide a patch in Wikimedia Gerrit which re-renders the full template, plus also adds a testcase for this! See for how to set up Git and Gerrit.

Please look at the Phabricator task for more information!

Task tags

  • javascript

Students who completed this task


Task type

  • code Code