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
AC | Status | Details |
---|---|---|
1 | ✅ | T373566#10150677 |
2 | ✅ | T373566#10150677 |
3 | ✅ | T373566#10150677 |
QA Results - PROD
AC | Status | Details |
---|---|---|
1 | ✅ | T373566#10177454 |
2 | ✅ | T373566#10177454 |
3 | ✅ | T373566#10177454 |