Page MenuHomePhabricator

AMC Navigation - add new links to main menu with click tracking
Open, HighPublic5 Story Points

Description

User Story

As an advanced editor, I want the ability to access useful pages quickly. Demo here.

Description

We will be adding several items to the menu.

Acceptance criteria

  • 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
    • 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 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

fulliOSAndroid

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

Sign off steps

Event Timeline

ovasileva triaged this task as High priority.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 14 2019, 4:33 PM
alexhollender added a subscriber: Jdlrobson.
Tbayer added a subscriber: Tbayer.Tue, Mar 12, 5:32 PM

maybe split scrolling into separate task.

add urls for each item

add dev notes on existing code

ovasileva renamed this task from AMC Navigation - changes to main menu, pt 1 to AMC Navigation - add new links to main menu.Wed, Mar 13, 1:46 PM
ovasileva updated the task description. (Show Details)
Jony added a comment.Thu, Mar 14, 1:29 PM

@ovasileva @alexhollender move option need to be added.

Thanks for pointing that out @Jony. I assume you're referring to the Move page action? If so, that action would be part of the page actions menu, which you can see in T216418. Currently we are not planning to include the Move page action, however if you think there's a strong case for including it on mobile it'd be great for you to add a comment on that task.

Jony added a comment.Thu, Mar 14, 2:26 PM

@alexhollender actually it is an community proposal, it was proposed on facebook discussion.

Jdlrobson renamed this task from AMC Navigation - add new links to main menu to AMC Navigation - add new links to main menu with click tracking.Fri, Mar 15, 9:45 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: pmiazga.
Jdlrobson updated the task description. (Show Details)Fri, Mar 15, 9:55 PM

@ovasileva this is mostly ready to go, but note the 2 questions at the top of the description!

ovasileva updated the task description. (Show Details)Mon, Mar 18, 4:21 PM
Jdlrobson updated the task description. (Show Details)Tue, Mar 19, 12:43 AM
Jdlrobson moved this task from Needs Analysis to Upcoming on the Readers-Web-Backlog board.

Sampling problem is now captured in T218627. This task is ready for estimation.