= Open questions
Before we move this to upcoming we need to update the task with the following:
[] EventLogging: Right now 50% of all clicks to main menu are tracked. Do we need to oversample for AMC? Do we need to know whether the user is in AMC mode? If so please create a task asking for that as we'll need to make schema/sampling changes.
[] Are these menu changes AMC only? Please state if so, and make clear what stable should look like after these changes. Are we maintaining 2 menus?
== User Story
As an advanced editor, I want the ability to access useful pages quickly. [Demo here](https://mobile-contributions.firebaseapp.com/nav4-side-nav.html).
== Description
We will be adding several items to the menu.
== Acceptance criteria
[] The main menu will contain the following pages:
- Main page
- Nearby
- Random
- ------------------------
- User page/logout
- Watchlist
- Contributions
- ------------------------
- (+) Recent changes
- (+) Special pages
- (+) Community portal
- ------------------------
- Settings
[] The community portal URL is customisable. It should be loaded from the message [[ https://en.wikipedia.org/wiki/MediaWiki:Portal-url | 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 (no schema modification needed), for the following:
- (+) Recent changes `event-name="recentchanges"`
- (+) Special pages `event-name="specialpages"`
- (+) Community portal `event-name="community-portal"`
== Designs
| full | iOS | Android
| {F28258012} | {F28258014} | {F28258039}
== Design notes
- 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
== Developer notes
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.
== Analytics
* 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)
= QA steps
Verify events show for all the newly added items, but also the existing items.
- Main page
- Nearby
- Random
- User page/logout
- Watchlist
- Contributions
- Settings