Page MenuHomePhabricator

Create centralNotice campaign for Minerva Night Mode launch notifications
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

This is a follow-up task to T361047. In that task, a dialog informing users of the new dark-mode feature was created. There was some discussion about how to present that dialog according to the following requirements:

- Promotional notification shown as soon as possible to logged and logged out readers who enrol in night mode "automatically"

  • Promotional notification shown on second page load in a session to logged in and logged out readers who have day mode devices
  • Notification only appears once, and is not shown again after it has been dismissed, regardless of the logged in or out status of the reader.

It was determined that this behaviour could be achieved by running the promotional notification as a CentralNotice banner and campaign, using the "impression diet" feature. This task concerns creating and testing that centralNotice campaign.

User story

  • As a reader with a device in dark mode, I want to know that night mode has been launched, so that I can change my dark mode settings if I wish.
  • As a reader whose device is not in dark mode, I want to hear about night mode launching so that I can try it out if I want.
  • As a Wikipedian, if I see this notice more than once, I will not be pleased.

Requirements

Create a centralNotice campaign that can show a banner like the following:
https://meta.wikimedia.org/wiki/Main_Page?banner=sgrabarczuk_test

The banner should be shown:

  • On the users first pageview if they are in dark-mode
  • On the users second pageview if they are in light-mode
  • After the banner has been shown once, it should never be shown again.

Both the campaign configuration and the banner code should work together to achieve these goals.

Campaign configuration using "impression diet" feature
https://meta.wikimedia.org/w/index.php?title=Special:CentralNotice&subaction=noticeDetail&notice=sgrabarczuk_test

Screenshot 2024-05-24 at 12.27.36 PM.png (869×1 px, 165 KB)

Banner code (referencing "impression diet" key)
https://meta.wikimedia.org/wiki/Special:CentralNoticeBanners/edit/sgrabarczuk_test

banner
<script>
    const CNContext = mw.centralNotice.kvStore.contexts.GLOBAL;
    const CNBannerKey = 'impression_diet_minerva-dark-mode-banner';
    const impressions = mw.centralNotice.kvStore.getItem( CNBannerKey, CNContext ) || {};
    const matchMediaDark = window.matchMedia( '(prefers-color-scheme: dark)' );
    const clientPrefDark = document.documentElement.classList.contains( 'skin-theme-clientpref-night' );
    const clientPrefAuto = document.documentElement.classList.contains( 'skin-theme-clientpref-auto' );
    const isPageInDarkMode = ( clientPrefDark || ( clientPrefAuto && matchMediaDark ) );

    // Show banner for testing purposes when there's a query param of "banner" 
    if ( window.location.search.match( 'banner' ) !== null ) {
        mw.loader.using( 'skins.minerva.DarkModeLaunchBanner', function( require ) {
            require( 'skins.minerva.DarkModeLaunchBanner')();
        } );
    }

    // Show banner on first impression in dark-mode, or on second impression in light mode
    if ( ( isPageInDarkMode && impressions.seenCount === 1 ) ||
         ( !isPageInDarkMode && impressions.seenCount === 2 ) ) {
        mw.loader.using( 'skins.minerva.DarkModeLaunchBanner', function( require ) {
            require( 'skins.minerva.DarkModeLaunchBanner')();
        } );
    }
</script>

Banner configuration

Dates: July 1 - July 15
Copy: Dark mode for reading is now available! Please go to menu > settings to turn it on.

BDD

Feature: Minerva Night Mode Launch Notification

Scenario: Display CentralNotice campaign for Night Mode launch

Given a user is visiting a Wikimedia project
When the CentralNotice campaign is active
Then the user should see a notification about the Minerva Night Mode launch

Test Steps

Test Case 1: Verify Notification Display

  1. Activate the CentralNotice campaign for Minerva Night Mode.
  2. Visit a Wikimedia project.
  3. ✅❓❌⬜ AC1: Confirm the notification about the Minerva Night Mode launch is displayed.

Design

Minerva notification on the left, Vector on the right

image.png (1×1 px, 516 KB)

Minerva Copy:

Wikipedia’s new colors
Try dark mode today
Wikipedia is now available in dark mode. Try it out by tapping on “Settings” in the main menu.
Go to Settings

Vector copy:

Wikipedia’s new colors
Try dark mode today
Wikipedia is now available in dark mode. Try it out by clicking “Dark” in the “Color” section of the Appearance menu on the right.

Acceptance criteria

  • The banner code has been reviewed.
  • A CentralNotice campaign that can display the promotional notification per the requirements has been created.
  • The campaign has been tested and confirmed that it only shows the banner once.
  • We've determined the parameters of this campaign
    • how long do we want this campaign to be active
    • Who is the audience for this campaign (all users?)
    • When do we want to launch this campaign (when we launch dark-mode generally? during beta phase, when we switch the default to automatic?)

Communication criteria - does this need an announcement or discussion?

  • A modal dialog can be disruptive to users, so some on-wiki discussion notifying users of this banner might be required.

Rollback plan

  • The campaign can be disabled instantly.

This task was created by Version 1.0.0 of the Web team task template using phabulous

QA Results - PROD

ACStatusDetails
1T366296#9988564

Event Timeline

Jdlrobson subscribed.

The deployment plan for this is not completely clear.
Estimations were 2, 5, 3, 3, 3 and 1 for QA.
We hope to get some clarity from Olga on Monday before moving this to estimation.

@cmadeo mentioned that Comms and legal would probably want to look at these notifications before we launch @ovasileva .

Open questions:

  • Need dates for campaign
  • Need to know whether comms want to review the copy
  • Verify it works on vector - are any design changes needed?
  • Audience - is this for everybody? And for how long?

Olga to decide if this is a blocker for deployment, and get answers for the open questions.

Tentative answers

  • Need dates for campaign
    • TBD
  • Need to know whether comms want to review the copy
    • We can verify the copy ourselves
  • Verify it works on vector - are any design changes needed?
    • Can someone help me set up a way to see this in vector/minerva? Generally, I think we'll probably start with only displaying this in Minerva
  • Audience - is this for everybody? And for how long?
    • This would be for logged-out users only and would run for 2 weeks after deployment on Minerva.

Moving to next sprint specifically to:

ovasileva raised the priority of this task from Medium to High.Jun 17 2024, 12:22 PM

Moving to next sprint specifically to:

I also want a final QA pass on the banners themselves.

I looked at the banners with Olga and we wrote copy for Minerva and Vector. I updated the task description accordingly. Moving to ready for estimation.

ovasileva set the point value for this task to 1.Jun 18 2024, 4:30 PM

Giving an estimate for the copy change. For vector, we'll have a separate ticket with the copy.

Jdlrobson lowered the priority of this task from High to Medium.Jun 20 2024, 4:55 PM

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

[mediawiki/skins/MinervaNeue@master] Update copy for night mode launch campaign

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

Change #1048542 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Update copy for night mode launch campaign

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

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

[mediawiki/skins/MinervaNeue@master] Add tests for the banner description

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

@Jdrewniak - we were discussing the banner targeting and wanted to see if we'll be showing the banner to anyone that already has dark mode (for example, people that have opted in). Is this possible? What is the current behavior?

Not @Jdrewniak but, I believe as it's currently set up people who have night mode turned on (beta feature, etc) will receive the banner, but currently the wording is identical to the copy for day mode

The banner is now running on English Wikipedia and zh Wikipedia for both logged-in and logged-out mobile users.

I've disabled the banners - we're being pinged, documentation updates are needed, and running the banners makes it all seem more urgent than it could be.

(We are tracking the restoring of the banners in T369541 now)

@Jdlrobson How would I be able to test this in Beta and PROD? I see the banner in https://meta.wikimedia.org/wiki/Main_Page?banner=sgrabarczuk_test. Do I have to create a new user to be able to see the banner?

@Jdlrobson How would I be able to test this in Beta and PROD? I see the banner in https://meta.wikimedia.org/wiki/Main_Page?banner=sgrabarczuk_test. Do I have to create a new user to be able to see the banner?

Nope that's it! You've tested in production with that URL

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Notification Display

  1. Activate the CentralNotice campaign for Minerva Night Mode.
  2. Visit a Wikimedia project (ex. https://meta.wikimedia.org/wiki/Main_Page?banner=sgrabarczuk_test).
  3. AC1: Confirm the notification about the Minerva Night Mode launch is displayed.
VectorMinerva
2024-07-16_16-05-31.mp4.gif (896×1 px, 1 MB)
2024-07-16_16-06-09.mp4.gif (920×926 px, 1 MB)
GMikesell-WMF added a project: Verified.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF subscribed.

We were running the banners between July 10, 11:10 UTC and July 18, 16:40 UTC on enwiki and zhwiki for both logged-in and logged-out.

ovasileva claimed this task.

Change #1048593 abandoned by Stoyofuku-wmf:

[mediawiki/skins/MinervaNeue@master] Add tests for the banner description

Reason:

We're done with this banner campaign, so leaving this for now

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