Page MenuHomePhabricator

[PageTools] Make the new main menu pinnable
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
Jdlrobson
Sep 15 2022, 4:24 PM
Referenced Files
F36421149: Screenshot 2023-01-22 at 7.55.54 PM.png
Jan 23 2023, 3:56 AM
F36421148: Screenshot 2023-01-22 at 7.56.07 PM.png
Jan 23 2023, 3:56 AM
F36103454: Screen Recording 2023-01-10 at 8.01.31 PM.mov.gif
Jan 23 2023, 3:56 AM
F36103446: Screenshot 2023-01-10 at 7.59.56 PM.png
Jan 23 2023, 3:56 AM
Restricted File
Jan 11 2023, 3:53 AM
Restricted File
Jan 11 2023, 3:53 AM
F36004156: Screenshot 2023-01-05 at 6.44.58 PM.png
Jan 6 2023, 2:46 AM
F36004140: Screen Recording 2023-01-05 at 6.27.03 PM.mov.gif
Jan 6 2023, 2:46 AM

Description

NOTE: Blockers: T317899, T317897

We will make the page tools pinnable. When working on this, the more menu and table of contents should both be pinnable with reusable code.
https://vector-2022.web.app/Moth

TODO

  • When pinned

Screen Shot 2022-09-15 at 5.06.00 PM.png (745×463 px, 174 KB)

  • When not pinned

Screen Shot 2022-09-15 at 5.05.40 PM.png (630×540 px, 164 KB)

  • The pinnable state should be stored and persist for logged in users. Suggestion: reuse the existing preference PREF_KEY_SIDEBAR_VISIBLE
  • The menu should default to pinned for logged-in users and unpinned to logged-out users
  • When pinned the main menu is contained by a landmark, and there is only a single landmark for the main menu
  • INSTRUMENTATION: When pinned, clicks to links inside the menu should be different to when in the dropdown. DesktopWebUIClickTracking. When unpinned, the main menu should be tracked with the event name n-mainpage-description.dropdown and when pinned the event should be n-mainpage-description.pinned. This will allow us to determine from clicks which menu the click occurred inside. Ideally this should be generalized for the pinning functionality e.g. should also apply to items in the table of contents and the end column.
  • Once done, mark the appropriate field for that event in the instrumentation spec: https://docs.google.com/spreadsheets/d/18FstayDXt-PKfy7qxL2AQ_dMjn59YdF9d2wHaS1vjTg/edit#gid=0
  • When logged in the default state of the main menu should be persistent. Move SkinVector22:isMainMenuVisible into VectorComponentMainMenu.php

QA steps

  1. Persistence

1a) Logged out: There should be no option to pin the main menu
1b) Logged in: Pin sidebar to left. Wait 1s and refresh page. Expected: sidebar should remain pinned.
1c) Logged in: Pin sidebar to left. Wait 1s and click "hide". Expected: sidebar should remain hidden.

  1. Check instrumentation

1a) Click a link in main menu. Pin to sidebar. Click same link. Expected: Two different event names should be fired.

Sign off steps

  • After this work the hope is that all items are click instrumented with unique names that reflect where the were clicked. If this is not the case please create a new ticket to handle the remaining work.

QA Results - Beta

QA Results - Prod

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Jdlrobson set the point value for this task to 1.Sep 29 2022, 5:30 PM

@Jdlrobson @ovasileva discussed at offsite: we might want to hide the Move to sidebar button from logged-out people (i.e. that pin/hide functionality is only available if you're logged-in)

Jdlrobson set Due Date to Oct 31 2022, 7:00 AM.Oct 21 2022, 11:05 PM
Jdlrobson changed the subtype of this task from "Task" to "Deadline".
alexhollender_WMF renamed this task from [ArticleTools] Make the new main menu pinnable to [PageTools] Make the new main menu pinnable.Oct 25 2022, 7:27 PM
alexhollender_WMF updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
ovasileva raised the priority of this task from Medium to High.Nov 21 2022, 3:33 PM
ovasileva removed Due Date which was set to Oct 31 2022, 7:00 AM.

@Jdlrobson just spoke with @ovasileva again, and we decided for now the main menu will not be pin-able for logged-out people (so we can hide that heading+button entirely), same as page tools

Change 853415 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] [WIP] Page tools: Main menu is pinnable

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

LGoto renamed this task from [PageTools] Make the new main menu pinnable to [M] [PageTools] Make the new main menu pinnable.Dec 5 2022, 6:25 PM

We said we'd check in again on the estimation here once in flight work is done. It's not ready to be worked on

While looking into this I considered the existing behaviour of the sidebar. It goes full screen at low resolutions if pinned. We may want to explore the pinning function holistically in another task.

Change 865772 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Refactor: PageTools composes several different components

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

Change 865795 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Components: MainMenu and Pagetools use VectorComponentMenu

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

Change 866660 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Templates: Reorganize pinned containers

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

Change 866660 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Templates: Reorganize pinned containers

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

Change 865772 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Refactor: PageTools composes several different components

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

Change 865795 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Components: MainMenu and Pagetools use VectorComponentMenu

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

Change 867719 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Don't add empty table of contents to page

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

Change 867719 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Don't add empty table of contents to page

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

Change 867701 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] WIP: Refactor page tools, main menu, and TOC components

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

Change 868170 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update main menu templates and classes to be consistent with other pinnable elements

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

Change 868168 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Rename VectorComponentPinnedContainer to VectorComponentPinnableContainer to match template files

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

Change 868169 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Remove -pinnable-element postfix from PinnableElement.mustache

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

bwang removed bwang as the assignee of this task.Dec 15 2022, 12:12 AM
bwang subscribed.

Change 867701 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Refactor page tools, main menu, and TOC components

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

Change 868475 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] WIP: Use features.js for main menu pinning functionality

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

Change 868168 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Rename VectorComponentPinnedContainer to VectorComponentPinnableContainer to match template files

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

Change 868169 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Remove -pinnable-element postfix from PinnableElement.mustache

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

Change 868185 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Clean up cached HTML code

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

Change 868170 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update main menu templates and classes to be consistent with other pinnable elements

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

Change 868475 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Use features.js for main menu pinning functionality

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

Change 868185 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Clean up cached HTML code

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Persistence
✅ AC1: 1a) Logged out: There should be no option to pin the main menu

Screenshot 2023-01-05 at 6.28.10 PM.png (713×989 px, 197 KB)

✅ AC2: 1b) Logged in: Pin sidebar to left. Wait 1s and refresh page. Expected: sidebar should remain pinned.
Screen Recording 2023-01-05 at 6.25.49 PM.mov.gif (784×1 px, 923 KB)

✅ AC3: 1c) Logged in: Pin sidebar to left. Wait 1s and click "hide" and refresh page. Expected: sidebar should remain hidden.
Screen Recording 2023-01-05 at 6.27.03 PM.mov.gif (784×1 px, 888 KB)

Check instrumentation
✅ AC4: 1a) Click a link in main menu. Pin to sidebar. Click same link. Expected: Two different event names should be fired.
{F36103420}

{F36103421}

We're looking for events for desktopwebuiactionstracking.
For the random page link you should be seeing n-randompage.vector-main-menu.pinned for pinned menus, and n-randompage.vector-main-menu.unpinned for unpinned.

Change 853415 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] [WIP] Page tools: Main menu is pinnable

Reason:

Done in https://gerrit.wikimedia.org/r/868475

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

Jdlrobson renamed this task from [M] [PageTools] Make the new main menu pinnable to [PageTools] Make the new main menu pinnable.Jan 17 2023, 5:51 PM
Jdlrobson changed the point value for this task from 1 to 3.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki, frwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Persistence
✅ AC1: 1a) Logged out: There should be no option to pin the main menu

Screenshot 2023-01-10 at 7.59.56 PM.png (888×1 px, 361 KB)

✅ AC2: 1b) Logged in: Pin sidebar to left. Wait 1s and refresh page. Expected: sidebar should remain pinned.
Screen Recording 2023-01-10 at 8.01.31 PM.mov.gif (852×966 px, 1 MB)

✅ AC3: 1c) Logged in: Pin sidebar to left. Wait 1s and click "hide" and refresh page. Expected: sidebar should remain hidden.

Check instrumentation
✅ AC4: 1a) Click a link in main menu. Pin to sidebar. Click same link. Expected: Two different event names should be fired.

Screenshot 2023-01-22 at 7.56.07 PM.png (343×769 px, 71 KB)

Screenshot 2023-01-22 at 7.55.54 PM.png (348×803 px, 69 KB)

Looks good, resolving