Page MenuHomePhabricator

Remove donate link in sidebar for anonymous users on Vector
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

Followup to T372757 - we want to show the donate link in the sidebar only when it isn't shown in the user menu

This will likely need to be handled in VectorComponentMainMenu or a similar class*
*alternatively, https://www.mediawiki.org/wiki/Manual:Hooks/SkinBuildSidebar might be of use here - in an ideal world we would centralize this logic to the wikimediamessages repo since it is WMF specific

User story

As an anonymous user of wikipedia, I don't want to be overwhelmed with calls to donate when the new one is already so prominent

Requirements

  • for anon users, the donate link is removed from the sidebar (wherever it is located as it varies by wiki)
  • for logged in users, it is still present in its intended location

Acceptance criteria

  • requirements are met, in multiple wikipedias (French has an example of an edge case)

Communication criteria - does this need an announcement or discussion?

I don't believe this needs communication separate from the communication with the fundraising team about this overall effort

Rollback plan

Open question whether this should be behind a feature flag like T372757 - either way it should be cleanly revertible

Derived Requirement

Ensure that the donate link is only displayed in the sidebar for logged-in users, and for anonymous users, it is removed from the sidebar when it is prominently displayed elsewhere (e.g., the user menu). This should be implemented across multiple Wikipedias, accounting for wiki-specific variations.

BDD

Feature: Display Donate Link for Logged-In Users Only in Sidebar

Scenario: Hide donate link in sidebar for anonymous users

Given the user is an anonymous visitor to Wikipedia
And the donate link is prominently displayed in another location (e.g., user menu)
When the user views the sidebar
Then the donate link should not be visible in the sidebar

Scenario: Display donate link in sidebar for logged-in users

Given the user is logged into their Wikipedia account
When the user views the sidebar
Then the donate link should be visible in its intended location in the sidebar

Scenario: Verify donate link behavior on multiple Wikipedias

Given the user is on different Wikipedia language versions (e.g., French, English)
When the user views the sidebar as an anonymous or logged-in user
Then the donate link should behave according to the requirements
Test Steps

Test Case 1: Verify Donate Link Hidden for Anonymous Users

Navigate to Wikipedia without being logged in (as an anonymous user).
Confirm the donate link is prominently displayed elsewhere, such as in the user menu.
✅❓❌⬜ AC1: Verify the donate link is not visible in the sidebar.

Test Case 2: Verify Donate Link Shown for Logged-In Users

Log in to your Wikipedia account.
Navigate to the sidebar on any Wikipedia page.
✅❓❌⬜ AC2: Verify the donate link is visible in its intended location in the sidebar.

Test Case 3: Verify Donate Link Behavior Across Multiple Wikipedias

As an anonymous and logged-in user, navigate to different Wikipedia language versions (e.g., French, English).
Check the sidebar for the presence or absence of the donate link.
✅❓❌⬜ AC3: Ensure the donate link is hidden for anonymous users and visible for logged-in users, adhering to language-specific variations where necessary.

These test steps ensure that the donate link is handled correctly for both anonymous and logged-in users, across multiple Wikipedias, with consistent placement and visibility based on user status.

QA Results - Beta

ACStatusDetails
1T373566#10150677
2T373566#10150677
3T373566#10150677

QA Results - PROD

ACStatusDetails
1T373566#10177454
2T373566#10177454
3T373566#10177454

Event Timeline

Jdlrobson set the point value for this task to 3.Aug 29 2024, 5:52 PM

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

[mediawiki/extensions/WikimediaMessages@master] Remove donate link from sidebar menu when it is added to the user menu

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

bwang removed bwang as the assignee of this task.Sep 4 2024, 7:19 PM
bwang moved this task from Doing to Code Review on the Web-Team-Backlog (FY2024-25 Q1 Sprint 5) board.
bwang subscribed.

Change #1070661 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Remove donate link from sidebar menu when it is added to the user menu

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

Change #1071249 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/extensions/WikimediaMessages@master] Check if donate link is being moved before removing

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

Change #1071249 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Check if donate link is being moved before removing

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

Change #1071282 had a related patch set uploaded (by Stoyofuku-wmf; author: Bernard Wang):

[mediawiki/extensions/WikimediaMessages@wmf/1.43.0-wmf.21] Remove donate link from sidebar menu when it is added to the user menu

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

Change #1071283 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/extensions/WikimediaMessages@wmf/1.43.0-wmf.21] Check if donate link is being moved before removing

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

Change #1071283 abandoned by Stoyofuku-wmf:

[mediawiki/extensions/WikimediaMessages@wmf/1.43.0-wmf.21] Check if donate link is being moved before removing

Reason:

Merge conflict

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

Change #1071282 abandoned by Stoyofuku-wmf:

[mediawiki/extensions/WikimediaMessages@wmf/1.43.0-wmf.21] Remove donate link from sidebar menu when it is added to the user menu

Reason:

can't figure out how to pair these two and it's after 5pm on a Friday - will figure this out Monday morning with a fresh brain

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

Change #1072314 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/extensions/WikimediaMessages@master] Remove bugged sidebar hook for donate link

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

Change #1072314 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Remove bugged sidebar hook for donate link

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

Change #1072793 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/extensions/WikimediaMessages@master] Remove donate link in sidebar when it's been moved

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

For Olga: status of this one is that we had to do a little scramble this week because we figured out the hook we were using had a bug in it (more accurately, we introduced a bug by using it). The correct hook is now in code review, and will hopefully wrap up this ticket

Change #1072793 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Remove donate link in sidebar when it's been moved

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

Should be testable on beta cluster shortly.

GMikesell-WMF updated Other Assignee, added: Edtadros.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF subscribed.

@Jdlrobson can you please review the issues below, thanks!

Test Result - Beta

Status: ❌ AC1 & AC3
Environment: Beta
OS: macOS Sonoma 14.6.1
Browser: Chrome 128
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Donate Link Hidden for Anonymous Users

Navigate to Wikipedia without being logged in (as an anonymous user).
Confirm the donate link is prominently displayed elsewhere, such as in the user menu.
❌ AC1: Verify the donate link is not visible in the sidebar.

Donate link is still visible on the sidebar

2024-09-16_11-19-43.png (1×1 px, 457 KB)

Test Case 2: Verify Donate Link Shown for Logged-In Users

Log in to your Wikipedia account.
Navigate to the sidebar on any Wikipedia page.
✅ AC2: Verify the donate link is visible in its intended location in the sidebar.

2024-09-16_11-24-00.png (906×1 px, 376 KB)

Test Case 3: Verify Donate Link Behavior Across Multiple Wikipedias

As an anonymous and logged-in user, navigate to different Wikipedia language versions (e.g., French, English).
Check the sidebar for the presence or absence of the donate link.
❌ AC3: Ensure the donate link is hidden for anonymous users and visible for logged-in users, adhering to language-specific variations where necessary.

French does not have a Beta but German does.

✅ Logged in❌Anonymous
2024-09-16_11-28-39.png (679×1 px, 186 KB)
2024-09-16_11-31-32.png (540×1 px, 179 KB)

French does not have a Beta but German does.

@GMikesell-WMF please test on the new Vector skin not the old skin! You'll need to append ?useskin=vector-2022 at the end of the URL.
Also please use an anonymous account - not a temporary account - these will be treated as logged in users.

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Sonoma 14.6.1
Browser: Chrome 128
Device: MBA
Emulated Device: NA

Test Artifact(s):
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Batman&useskin=vector-2022
https://de.wikipedia.beta.wmflabs.org/w/index.php?title=Related_test&useskin=vector-2022

Test Steps

Test Case 1: Verify Donate Link Hidden for Anonymous Users

Navigate to Wikipedia without being logged in (as an anonymous user).
Confirm the donate link is prominently displayed elsewhere, such as in the user menu.
✅ AC1: Verify the donate link is not visible in the sidebar.

2024-09-16_12-32-35.png (817×1 px, 313 KB)

Test Case 2: Verify Donate Link Shown for Logged-In Users

Log in to your Wikipedia account.
Navigate to the sidebar on any Wikipedia page.
✅ AC2: Verify the donate link is visible in its intended location in the sidebar.

2024-09-16_12-32-06.png (514×1 px, 169 KB)

Test Case 3: Verify Donate Link Behavior Across Multiple Wikipedias

As an anonymous and logged-in user, navigate to different Wikipedia language versions (e.g., French, English).
Check the sidebar for the presence or absence of the donate link.
✅ AC3: Ensure the donate link is hidden for anonymous users and visible for logged-in users, adhering to language-specific variations where necessary.

✅ Logged in✅Anonymous
2024-09-16_12-29-14.png (783×1 px, 140 KB)
2024-09-16_12-28-27.png (946×1 px, 138 KB)
GMikesell-WMF updated Other Assignee, removed: Edtadros.
GMikesell-WMF updated the task description. (Show Details)

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: macOS Sonoma 15.0
Browser: Chrome 129
Device: MBA
Emulated Device: NA

Test Artifact(s):
https://en.wikipedia.org/w/index.php?title=Batman&useskin=vector-2022
https://fr.wikipedia.org/wiki/Batman?useskin=vector-2022

Test Steps

Test Case 1: Verify Donate Link Hidden for Anonymous Users

Navigate to Wikipedia without being logged in (as an anonymous user).
Confirm the donate link is prominently displayed elsewhere, such as in the user menu.
✅ AC1: Verify the donate link is not visible in the sidebar.

2024-09-25_12-39-53.png (550×1 px, 356 KB)

Test Case 2: Verify Donate Link Shown for Logged-In Users

Log in to your Wikipedia account.
Navigate to the sidebar on any Wikipedia page.
✅ AC2: Verify the donate link is visible in its intended location in the sidebar.

2024-09-25_12-41-27.png (622×1 px, 424 KB)

Test Case 3: Verify Donate Link Behavior Across Multiple Wikipedias

As an anonymous and logged-in user, navigate to different Wikipedia language versions (e.g., French, English).
Check the sidebar for the presence or absence of the donate link.
✅ AC3: Ensure the donate link is hidden for anonymous users and visible for logged-in users, adhering to language-specific variations where necessary.
https://fr.wikipedia.org/wiki/Batman?useskin=vector-2022
gifs

✅ Logged in✅Anonymous
2024-09-25_12-48-44.mp4.gif (690×1 px, 1 MB)
2024-09-25_12-47-53.mp4.gif (602×1 px, 884 KB)