Page MenuHomePhabricator

Sticky header: Add user menu to sticky header
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

In T289716: Create sticky header skeleton we are building the skeleton for the sticky header. This task will cover adding the user menu to the sticky header

Acceptance criteria

  • The user menu is cloned into to the sticky header.
  • The sticky header user menu must have unique IDs for all elements to support our ability to click track and distinguish clicks to the original user menu compared with the new user menu. It is suggested that we suffix/prefix with "-sticky" / "sticky-"
  • Any gadgets that load late must also be added to the sticky header via mw.hook( 'util.addPortletLink' ). See QA for edge case this protects against.

Prototype

https://di-community-round-2.web.app/Audre_Lorde

QA

Test 1

  • Make sure all items in the sticky header mirror the menu items outside the sticky header. There should be no visual differences between the two
  • Enable the clock gadget and make sure it is present in the sticky header.

Test 2 - late loading gadget

Make sure the sticky header is visible.
Run the following code in your JavaScript console.

setTimeout( function () {
mw.util.addPortletLink('p-personal', 'Edward', 'Edward')
}, 10000  )

Wait ten seconds, and verify that a new link "Edward" appears in both menus.

Test 3 - verify all click tracking IDs are unique.

Load the sticky header.
Run the following code in your developer console

var keys = Array.from($('nav [id],[data-event-name]').map((i,a) => {return a.getAttribute('data-event-name') || a.getAttribute('id') }));
 keys.length === (new Set( keys )).size

Confirm that it is "true"

Developer notes

A placeholder for the user menu has been provided.
Before the sticky header is displayed inside stickyHeader.js ensure the new user menu is copied across to avoid any visible visual change from the user's perspective

Sign off steps

QA Results - Beta

ACStatusDetails
1T289816#7387884 changed to PASS per T289816#7388790
2T289816#7387884 changed to N/A per T289816#7388597
3T289816#7387884

QA Results - Prod

ACStatusDetails
1T289816#7387887 changed to PASS per T289816#7388790
2T289816#7387887 changed to N/A per T289816#7388597
3T289816#7387887

Event Timeline

ovasileva created this task.

@cjming just talked to Alex about the notices, alerts in the dropdown, just to clarify this is out of scope for this task (no need to add these to sticky header yet):

Screen Shot 2021-09-08 at 10.47.47 AM.png (224×352 px, 12 KB)

notices, alerts in the dropdown, just to clarify this is out of scope for this task (no need to add these to sticky header yet)

cool - thanks for the heads up

Jdlrobson updated the task description. (Show Details)

Change 720318 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/Vector@master] Add user menu to sticky header

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

cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
cjming subscribed.

Change 720318 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add user menu to sticky header

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

Test Result - Beta

Status:
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

❌ AC1: Test 1
Make sure all items in the sticky header mirror the menu items outside the sticky header. There should be no visual differences between the two
Enable the clock gadget and make sure it is present in the sticky header.
❓ Logged Out
The "Create account" link is missing". I'm not sure if it was meant to be included.

Screen Shot 2021-09-29 at 6.47.06 AM.png (374×1 px, 98 KB)
Screen Shot 2021-09-29 at 6.47.19 AM.png (374×1 px, 169 KB)

❌ Logged In
The Clock doesn't appear

Screen Shot 2021-09-29 at 6.49.26 AM.png (374×1 px, 135 KB)
Screen Shot 2021-09-29 at 6.49.38 AM.png (374×1 px, 137 KB)

❌ AC2: Test 2 - late loading gadget
Make sure the sticky header is visible.
Run the following code in your JavaScript console.

setTimeout( function () {
mw.util.addPortletLink('p-personal', 'Edward', 'Edward')
}, 10000 )
Wait ten seconds, and verify that a new link "Edward" appears in both menus.

Screen Shot 2021-09-29 at 6.57.08 AM.png (412×1 px, 135 KB)
Screen Shot 2021-09-29 at 6.58.03 AM.png (412×1 px, 181 KB)

✅ AC3: Test 3 - verify all click tracking IDs are unique.
Load the sticky header.
Run the following code in your developer console

Screen Shot 2021-09-29 at 6.59.45 AM.png (541×1 px, 274 KB)

Test Result - Prod

Status:
Environment: enwiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

❌ AC1: Test 1
Make sure all items in the sticky header mirror the menu items outside the sticky header. There should be no visual differences between the two
Enable the clock gadget and make sure it is present in the sticky header.
❓ Logged Out
The "Create account" link is missing".

Screen Shot 2021-09-29 at 7.01.26 AM.png (541×1 px, 237 KB)
Screen Shot 2021-09-29 at 7.01.41 AM.png (541×1 px, 218 KB)

❌ Logged In
The Clock, and Uploaded Media do not appear.

Screen Shot 2021-09-29 at 7.04.28 AM.png (541×1 px, 214 KB)
Screen Shot 2021-09-29 at 7.04.38 AM.png (541×1 px, 215 KB)

✅ AC2: Test 2 - late loading gadget
Make sure the sticky header is visible.
Run the following code in your JavaScript console.

setTimeout( function () {
mw.util.addPortletLink('p-personal', 'Edward', 'Edward')
}, 10000 )
Wait ten seconds, and verify that a new link "Edward" appears in both menus.

Screen Shot 2021-09-29 at 7.08.16 AM.png (592×1 px, 183 KB)
Screen Shot 2021-09-29 at 7.08.29 AM.png (592×1 px, 214 KB)

✅ AC3: Test 3 - verify all click tracking IDs are unique.
Load the sticky header.
Run the following code in your developer console

Screen Shot 2021-09-29 at 7.09.40 AM.png (592×1 px, 219 KB)

Edtadros subscribed.

@Jdlrobson Please take a look at the Beta and Prod results. The "Create account" link may be by design, but the clock gadget doesn't show up in AC1. AC2 passes in Prod, they are at different versions though.

@Edtadros cc @Jdlrobson the clock gadget is a known issue -- we decided recently to remove gadget-injected items from the user menu in T291426

updated QA steps

The Clock, and Uploaded Media do not appear.

This should be considered a pass. We intentionally do not copy across items added via JavaScript. I believe there is an open bug relating to "Uploaded Media". Clock can be fixed on wiki (and has been done on eu.wikipedia.org). @ovasileva do you want to create tasks for any of this as part of sign off?

Regarding " The "Create account" link is missing"."

This is a feature for logged-in users only, so they should never see/need this link.

Edtadros updated the task description. (Show Details)

Thanks @cjming and @Jdlrobson. Passing and moving to Ready for Signoff.

The Clock, and Uploaded Media do not appear.

This should be considered a pass. We intentionally do not copy across items added via JavaScript. I believe there is an open bug relating to "Uploaded Media". Clock can be fixed on wiki (and has been done on eu.wikipedia.org). @ovasileva do you want to create tasks for any of this as part of sign off?

This is expected and will be tracked as a part of our conversations around what to do with gadgets in the sticky header

Regarding " The "Create account" link is missing"."

This is a feature for logged-in users only, so they should never see/need this link.

Everything else looks good! Resolving.

Wasn't the link to the user page itself supposed to be part of this user menu as well? At least it was in the prototype. Right now there is no way to get to the user page from the sticky header.

Thank you for pointing that out @XanonymusX! This was an oversight on our part. User links will be added in T292557: Sticky header: Add user page link to user menu in sticky header

Another issue with the user menu I have noticed recently: while the single options in the dropdown usually have a tooltip, the final one (logOut) doesn't, so User menu is shown instead.

Also, when compared to my usual user menu, in the sticky header there are still the two options Translations (cx-language) and Uploads (cx-imageGallery) missing. Is it planned to add these two? Not sure if it is related to the sticky header, but for a couple of days now, these two options have been formatted differently in the user menu compared to the rest (since they do not have the mw-list-item class). EDIT: That is T293507, apparently.

Another issue with the user menu I have noticed recently: while the single options in the dropdown usually have a tooltip, the final one (logOut) doesn't, so User menu is shown instead.

Also, when compared to my usual user menu, in the sticky header there are still the two options Translations (cx-language) and Uploads (cx-imageGallery) missing. Is it planned to add these two? Not sure if it is related to the sticky header, but for a couple of days now, these two options have been formatted differently in the user menu compared to the rest (since they do not have the mw-list-item class). EDIT: That is T293507, apparently.

Thanks for the questions @XanonymusX! For the final version, the translations and uploads links should be available in the user menu within the sticky header. The fix for the formatting issue is on this weeks train and will be available everywhere by Thursday. I will open a task to track adding the tooltip to the logout link.

Olga, It's alright a patch is up to fix the tooltip problem.

Olga, It's alright a patch is up to fix the tooltip problem.

Looks good now!