Page MenuHomePhabricator

New user links: Guided tours displayed incorrectly
Closed, ResolvedPublic

Description

Done (1) Recent changes tour and Homepage tours popups are misplaced

Screen Shot 2021-07-19 at 2.10.13 PM.png (1×1 px, 107 KB)
Screen Shot 2021-07-12 at 4.14.06 PM.png (1×1 px, 192 KB)

(2) Homepage tour (growthexperiments-tour-homepage-mentorship) dialog overflows the viewport - the screenshot below is done for the width ~1770 (the issue is also present for the RC tour).

Screen Shot 2021-07-28 at 3.35.52 PM.png (1×3 px, 695 KB)

DONE (3) Homepage tour dialog (growthexperiments-tour-homepage-mentorship) points to the badge icon instead of the username link

Screen Shot 2021-07-28 at 3.26.38 PM.png (758×1 px, 130 KB)

QA Results - Beta

ACStatusDetails
1T287646#7271153
2T287646#7271153

QA Results -Prod

ACStatusDetails
1T287646#7271157
2T287646#7271157

Event Timeline

Thanks, @Etonkovidova. FYI @RHo.

@ovasileva -- please let me know if we'll need to adjust our GuidedTours or if this can be fixed on your end. I'm not sure if there are other GuidedTours out there (not administered by our team) that could get thrown off by the new user links.

@MMiller_WMF it's very likely this will require a change in GuidedTours from how we've handled this in other extensions.

@Etonkovidova could you provide some replication steps for how to see this? I've not used the extension before so am not clear on how to replicate this to investigate further.

@Etonkovidova could you provide some replication steps for how to see this? I've not used the extension before so am not clear on how to replicate this to investigate further.

Steps to reproduce for Homepage tours:

  • enable both options in Special:Preferences-User profile (the first tab) - Newcomer homepage
  • enable in Special:Preferences-Editing - Enable the editor help panel option
  • the following in the Console will trigger Homepage tours
new mw.Api().saveOptions( {
    'growthexperiments-tour-homepage-welcome': '0',
    'growthexperiments-tour-homepage-mentorship': '0',
    'growthexperiments-tour-homepage-discovery': '0'
} ).done( function() { window.location.reload() } );

I can't reproduce the exact error; to me, these guiders just appear in the middle of the page, detached. The reason for that is that #pt-userpage, used for targeting that link in these guiders, but also all kinds of tools and gadgets, has been renamed to #ca-userpage. ca is normally reserved for content tabs (like the talk page tab) vs. pt for personal toolbar items, so I assume this was by accident.

(F34568633 even has the order of the toolbar items scrambled. No idea how that would happen.)

Notice

  • the task screenshots are done on betalabs. testwiki wmf.16 looks different, I'll re-check betalabs and edit the descripion.
  • the popups lost their pointing on testwiki wmf.16. The text provides sufficient info to instruct users where they should click. The quesiton is: is tit acceptable behavior or not?
  • the real issue is with Mentor reply

Comparison of Homepage tours - present production (enwiki wmf.15) and testwiki wmf.16 with New user links.

enwiki wmf.15testwiki wmf.16 with New user links
on a random page
Screen Shot 2021-07-29 at 1.22.07 PM.png (664×1 px, 123 KB)
Screen Shot 2021-07-29 at 1.18.08 PM.png (762×2 px, 206 KB)
on the Homepage
Screen Shot 2021-07-29 at 1.23.39 PM.png (814×1 px, 227 KB)
Screen Shot 2021-07-29 at 1.22.20 PM.png (668×1 px, 176 KB)
Screen Shot 2021-07-29 at 1.18.31 PM.png (842×2 px, 256 KB)
Screen Shot 2021-07-29 at 2.11.56 PM.png (808×2 px, 258 KB)
Mentor reply
Screen Shot 2021-07-29 at 1.28.35 PM.png (626×2 px, 186 KB)
Screen Shot 2021-07-29 at 2.08.22 PM.png (1×1 px, 291 KB)

I can't reproduce the exact error; to me, these guiders just appear in the middle of the page, detached. The reason for that is that #pt-userpage, used for targeting that link in these guiders, but also all kinds of tools and gadgets, has been renamed to #ca-userpage. ca is normally reserved for content tabs (like the talk page tab) vs. pt for personal toolbar items, so I assume this was by accident.

As per my previous comment, I'll re-check betalabs, esp

Screen Shot 2021-07-12 at 4.14.06 PM.png (1×1 px, 192 KB)

The RecentChanges guider points to #pt-preferences, which is invisible with the menu closed, so it seems to float in nothingness. I guess that guider needs to be updated to point to the dropdown and have slightly different text. The relevant code is WikimediaMessages > modules/rcfilters-intro-tour.js.

In general, since this update changes a number of personal toolbar links behind a dropdown, I think it would be worth grepping for the relevant ids in the codebase to see if anything is affected, and to communicate to tech ambassadors, Tech News etc that gadgets might be affected.

The other thing I'd check (not related to this task) is whether mw.utils.addPortletLink, which is used in a ton of gadgets, remains functional, especially when adding inside the dropdown.

I'm not seeing a pokey arrow in the replication steps on desktop resolution (only when I shrink the window):

Screen Shot 2021-07-29 at 2.52.39 PM.png (926×1 px, 222 KB)

Do I need to do anything else to see it, or is that part of the bug?

The other thing I'd check (not related to this task) is whether mw.utils.addPortletLink, which is used in a ton of gadgets, remains functional, especially when adding inside the dropdown.

This continues to work. It was part of the specification for this feature.

The reason for that is that #pt-userpage, used for targeting that link in these guiders, but also all kinds of tools and gadgets, has been renamed to #ca-userpage. ca is normally reserved for content tabs (like the talk page tab) vs. pt for personal toolbar items, so I assume this was by accident.

When ca- appears it's usually because legacy code has been invoked due to a non-existent ID. The new ID should likely be pt-userpage-btn. There are two user links now in the page, so we'll also need to adapt this code to point to the visible one.

I'm not seeing a pokey arrow in the replication steps on desktop resolution (only when I shrink the window):
Do I need to do anything else to see it, or is that part of the bug?

That's part of the bug, yes. The guider doesn't find the element it should attach to so it falls back to a generic dialog appearance.

The RecentChanges guider points to #pt-preferences, which is invisible with the menu closed, so it seems to float in nothingness. I guess that guider needs to be updated to point to the dropdown and have slightly different text. The relevant code is WikimediaMessages > modules/rcfilters-intro-tour.js.

RecentChanges landed with the Growth team on the maintainers wheel of fortune so we should probably do that. What do I need to do to enable the compressed personal toolbar locally? I skimmed Skin:Vector but none of the settings seemed relevant.

$wgVectorConsolidateUserLinks = [ 'logged_in' => true, 'logged_out' => true ];

This is a temporary feature flag so we don't advertise those on MediaWiki.org

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

[mediawiki/core@master] Update user page link element ID

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

Not sure how to set these tours up, but the above patch changes the element ID to something more logical per @Tgr's suggestion.

For the user link, we'd need to point the arrow to pt-userpage AND pt-userpage-2 (after above patch) depending on which is visible. Is the code smart enough to allow multiple elements to point at?

For the hidden links, perhaps this could be as simple as forcing open the dropdown menu using:

$('#p-personal input').prop('checked', true)

?

I don't understand why multiple IDs are needed. In what situation would both userpage links be rendered?

GuidedTours tours take a jQuery selector, so they should handle a list of ids fine. I'd expect other things to break though. Just from a quick search, tests for Wikibase, WikibaseMediaInfo and core reference it, the Gravatar extension styles it.

For the hidden links, perhaps this could be as simple as forcing open the dropdown menu

That would be one way, or it could just point to the main menu botton (I think we do the same in Minerva).

What's the best way to detect that this is needed? Is the body.skin-vector-consolidated-user-links class stable?

I don't understand why multiple IDs are needed. In what situation would both userpage links be rendered?

So there are actually 2 user menu buttons now in the HTML - one in the dropdown (shown to mobile users, viewport < 500px) and one outside (shown when resolution is large enough e.g. desktop). They look different so it didn't make sense to use the same ones and swap them via JavaScript so we use CSS to toggle between the two.

What's the best way to detect that this is needed? Is the body.skin-vector-consolidated-user-links class stable?

The skin-vector-consolidated-user-links is temporary so I'd suggest using vector-user-linksclass which is tied to the component and not going anywhere.

Change 708871 merged by jenkins-bot:

[mediawiki/core@master] Update user page link element ID

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

Change 709240 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Fix guider positioning

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

With the patch:

old personal toolbar
T287646-old-notice.png (326×882 px, 33 KB)
T287646-old-user.png (332×912 px, 40 KB)
compact personal toolbar
T287646-compact-notice.png (371×713 px, 28 KB)
T287646-compact-user.png (344×713 px, 32 KB)
compact w/ narrow screen
T287646-compact-narrow-notice.png (347×574 px, 26 KB)
T287646-compact-narrow-user.png (346×574 px, 37 KB)

On a sufficiently narrow screen things get messed up, but that's not related to either the patch or the Vector change - the guider code is just not very sophisticated.

Change 709241 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/WikimediaMessages@master] Update recentchanges/watchlist guided tour for Vector changes

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

Change 709241 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Update recentchanges/watchlist guided tour for Vector changes

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

Change 709240 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Fix guider positioning

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

Thanks for the reviews, @Jdlrobson!

From a quick search for the attachTo keyword used for guider positioning, the only other affected guider seems to be for Flow opt-in, so we should probably fix that as well.

In the longer term, it would be nice to migrate the guider library in GuidedTours to Vue, and improve its diagonal positioning and tip positioning logic in the process. That would be a breaking change though that would require checking and possibly adapting all code locations where a guider is used.

I tested the WikimediaMessages change with:

new mw.Api().saveOption( 'rcenhancedfilters-seen-tour', 0 );
mw.loader.using('ext.guidedTour.tour.RcFiltersIntro').then(()=>location.reload())

after the change I got the following for WikimediaMessages:

Screen Shot 2021-08-02 at 7.44.02 AM.png (514×1 px, 110 KB)

Screen Shot 2021-08-02 at 7.47.36 AM.png (556×1 px, 126 KB)

and for the GrowthExperiments change:

Screen Shot 2021-08-02 at 8.04.15 AM.png (548×2 px, 670 KB)

Screen Shot 2021-08-02 at 8.04.30 AM.png (606×980 px, 69 KB)

Screen Shot 2021-08-02 at 8.05.05 AM.png (468×2 px, 397 KB)

@RHo with the current patches (see screenshots above), the guider points to the user toolbar dropdown whenever it references something inside it (the username / user page link, preferences, or beta settings), and the text of the guider tells the user which link to click. Is that satisfactory? As Jon said, the other option would be to programmatically open the dropdown and point the guider (with 'rightTop' tip positioning, I guess?) to the specific item.

@RHo with the current patches (see screenshots above), the guider points to the user toolbar dropdown whenever it references something inside it (the username / user page link, preferences, or beta settings), and the text of the guider tells the user which link to click. Is that satisfactory? As Jon said, the other option would be to programmatically open the dropdown and point the guider (with 'rightTop' tip positioning, I guess?) to the specific item.

Hi @Tgr - do you mean the alternative could be something like the following:

image.png (682×1 px, 112 KB)

I do think that would be preferred. But at the same time the user links avatar icon menu without the separate user name link only happens at narrower browser widths, so it's not terrible to only point to the closed avatar icon menu item for now. Spoke with @ovasileva and we would be fine to have this done as a follow up.

@Etonkovidova - since reproduction steps are a bit complex, do you think you could help us with the QA for this task?

Change 709937 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/Flow@master] Fix guider for Vector consolidated user links

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

Test steps for the Flow patch: make sure your talk page has Flow enabled, set <wiki id>Flow_optIn_guidedTour cookie to truthy value, load your talk page.
Normally it's only shown right after enabling Flow on your talk page via the beta feature. As such, it's rare enough that I don't think it needs to be backported.

Hi @Tgr - do you mean the alternative could be something like the following:

image.png (682×1 px, 112 KB)

I do think that would be preferred.

I tried doing this, but at the widths where the userpage link gets moved into the dropdown (<720px) the guider does not fit into the space to the left of the dropdown, and ends up overlapping it and looking horribly, so just pointing to the dropdown opener icon is more useful.

Pointing to items inside the dropdown would make sense for items other than the userpage (those are always inside) on wider screens, but for GrowthExperiments those aren't used - only notifications (which is never inside the dropdown) and userpage (which is only inside for narrow screens). Flow and WikimediaMessages do use them but I don't think those guiders are too important for the new user experience.

Hi @Tgr - do you mean the alternative could be something like the following:

image.png (682×1 px, 112 KB)

I do think that would be preferred. But at the same time the user links avatar icon menu without the separate user name link only happens at narrower browser widths, so it's not terrible to only point to the closed avatar icon menu item for now. Spoke with @ovasileva and we would be fine to have this done as a follow up.

I tried doing this, but at the widths where the userpage link gets moved into the dropdown (<720px) the guider does not fit into the space to the left of the dropdown, and ends up overlapping it and looking horribly, so just pointing to the dropdown opener icon is more useful.

Pointing to items inside the dropdown would make sense for items other than the userpage (those are always inside) on wider screens, but for GrowthExperiments those aren't used - only notifications (which is never inside the dropdown) and userpage (which is only inside for narrow screens). Flow and WikimediaMessages do use them but I don't think those guiders are too important for the new user experience.

Right, I thought it might get a bit messy and not worth pursuing right now considering it is for the narrower widths and pointing to the user dropdown seems good enough for that case. Earlier I agreed with @ovasileva that it would be a follow up task, but seems it isn't worth doing that. Instead, we could just monitor for any noticeable drops in homepage discovery, however unlikely – FYI @nettrom_WMF and @MMiller_WMF.

Thanks for fixing this, @Tgr! And yes, @RHo, skipping that change and just monitoring sounds fine to me.

Test Result - Beta

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

Test Artifact(s):

QA Steps

Follow the steps from T287646#7247313
Enable both options in Special:Preferences-User profile (the first tab) - Newcomer homepage
and in Special:Preferences-Editing - Enable the editor help panel option
the following in the Console will trigger Homepage tours

new mw.Api().saveOptions( {
    'growthexperiments-tour-homepage-welcome': '0',
    'growthexperiments-tour-homepage-mentorship': '0',
    'growthexperiments-tour-homepage-discovery': '0'
} ).done( function() { window.location.reload() } );

✅ AC1: When username is not collapsed in the User Links menu, the popup should point to the center of the username.

Screen Shot 2021-08-09 at 5.10.06 PM.png (694×881 px, 139 KB)

Screen Shot 2021-08-09 at 5.11.45 PM.png (694×881 px, 161 KB)

✅ AC2: When username is in the User Links menu, the popup should point to the center of the menu icon.
Screen Shot 2021-08-09 at 5.14.28 PM.png (692×716 px, 104 KB)

Screen Shot 2021-08-09 at 5.13.57 PM.png (716×719 px, 122 KB)

Edtadros added a subscriber: Edtadros.

Test Result - Prod

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

Test Artifact(s):

QA Steps

Follow the steps from T287646#7247313
Enable both options in Special:Preferences-User profile (the first tab) - Newcomer homepage
and in Special:Preferences-Editing - Enable the editor help panel option
the following in the Console will trigger Homepage tours

new mw.Api().saveOptions( {
    'growthexperiments-tour-homepage-welcome': '0',
    'growthexperiments-tour-homepage-mentorship': '0',
    'growthexperiments-tour-homepage-discovery': '0'
} ).done( function() { window.location.reload() } );

✅ AC1: When username is not collapsed in the User Links menu, the popup should point to the center of the username.

Screen Shot 2021-08-09 at 5.29.07 PM.png (691×1 px, 236 KB)

Screen Shot 2021-08-09 at 5.28.35 PM.png (696×1 px, 190 KB)

Screen Shot 2021-08-09 at 5.27.56 PM.png (691×1 px, 347 KB)

✅ AC2: When username is in the User Links menu, the popup should point to the center of the menu icon.

Screen Shot 2021-08-09 at 5.26.08 PM.png (694×647 px, 105 KB)

Screen Shot 2021-08-09 at 5.26.57 PM.png (693×648 px, 132 KB)

Screen Shot 2021-08-09 at 5.25.07 PM.png (689×648 px, 228 KB)

Edtadros updated the task description. (Show Details)

Looks good, resolving. @MMiller_WMF - feel free to re-open if there are any issues

There is still a (less important) fix for Flow needing review.

There is still a (less important) fix for Flow needing review.

Got it. Sorry about that. In that case, I will untag the Web team's backlog from this, but feel free to ping us if there's anything from our side that's still necessary.

Thanks @ovasileva! No assistance needed, just wanted to keep it in our "needs code review" column.

Change 709937 merged by jenkins-bot:

[mediawiki/extensions/Flow@master] Fix guider for Vector consolidated user links

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

@Etonkovidova - since reproduction steps are a bit complex, do you think you could help us with the QA for this task?

Tested in production wmf.19 - all looks fine.

@Edtadros referred to the instructions in T287646#724731, but I'm adding them here for better visibility:

  • Steps to trigger Homepage tours:**
    • enable both options in Special:Preferences-User profile (the first tab) - Newcomer homepage
    • enable in Special:Preferences-Editing - Enable the editor help panel option the following in the Console will trigger Homepage tours
new mw.Api().saveOptions( {
    'growthexperiments-tour-homepage-welcome': '0',
    'growthexperiments-tour-homepage-mentorship': '0',
    'growthexperiments-tour-homepage-discovery': '0'
} ).done( function() { window.location.reload() } );

Steps to trigger Recent changes/Watchlist tours:
First method:

  • in Preferences click on "Restore all default settings (in all sections)"
  • visiting Special:RecentCahnges or Special:Watchlist pages will trigger the tours

Second method:

  • for RC page:
new mw.Api().saveOptions( {
    'rcenhancedfilters-seen-tour': '0',
} ).done( function() { window.location.reload() } );
  • for Watchlist
new mw.Api().saveOptions( {
    'wlenhancedfilters-seen-tour': '0',
} ).done( function() { window.location.reload() } );