As an advanced editor, I want the ability to access useful pages quickly. Demo here.
We will be adding several items to the menu.
- The changes will be AMC only. There will be no changes to stable. (this is the default for all AMC tasks, unless explicitly marked otherwise)
- The main menu will contain the following pages:
- Main page
- User page/logout
- (+) Recent changes
- (+) Special pages
- (+) Community portal
- The community portal URL is customisable. It should be loaded from the message MediaWiki:Portal-url. If the message doesn't exist, do not show it.
- The "Contributions" icon will be updated to use the article icon (for all users, including non-AMC)
- There is a feature flag and these are disabled by default in amc, stable and beta (a separate task will enable them once we've QAed and verified the instrumentation to be working).
- All links added to the main menu have a unique data-event-name in MobileWebMainMenuClickTracking (no schema modification needed), for the following:
- (+) Recent changes event-name="recentchanges"
- (+) Special pages event-name="specialpages"
- (+) Community portal event-name="community-portal"
- Currently the Contributions icon in the menu is the same as the History icon. Let's switch it (for all users) to the article icon.
- If it makes sense we should consider updating the UX of the menu based on T206354
Eventually, in conjunction with T214540, we will be removing the user items (User page/logout, Watchlist, Contributions) so don't worry about duplication.
Click tracking is pretty straightforward -since we are only adding links to the MainMenu we get it for free simply by adding a data-event-name attribute to the links we add.
All links are hardcoded, except the community portal. This is defined via https://en.wikipedia.org/wiki/MediaWiki:Sidebar
Two menus (AMC and non-AMC)
Menu data is shipped to the client in mw.config.get('wgMinervaMenuData') and for AMC this will not be cached so there should be no caching worries if we need to maintain 2 menus. The MenuBuilder class is pretty flexible; here's an example:
$menu->insert( 'contribs' ) ->addComponent( $this->msg( 'mobile-frontend-main-menu-contributions' )->escaped(), SpecialPage::getTitleFor( 'Contributions', $user->getName() )->getLocalUrl(), MinervaUI::iconClass( 'contributions', 'before' ), [ 'data-event-name' => 'contributions' ] );
No JS/CSS changes should be necessary when adding a new group.
- MainMenuClickTracking schema ID exists in MobileFrontend. We should move that to Minerva as this is confusing. But apart from that, all code is in Minerva.
- All the code for communicating with EventLogging lives in Minerva resources/skins.minerva.scripts/menu/schema.js
- 50% of clicks in the main menu are sampled (Per wgMinervaSchemaMainMenuClickTrackingSampleRate)
- Every link inside the MainMenu will be logged provided it has a event-name value (see resources/skins.minerva.scripts/menu/MainMenu.js)
Verify events show for all the newly added items, but also the existing items.
New menu can be tested on staging env: https://reading-web-staging.wmflabs.org/wiki/Main_Page
- Main page
- User page/logout
Sign off steps
- Unstall T218206