Page MenuHomePhabricator

Create centralNotice campaign for Easter Egg launch notifications
Open, HighPublic1 Estimated Story Points

Description

Background

We need to notify users when easter eggs / birthday mode becomes available on Minerva. We also know from Usability testing that readers have no problem finding the appearance settings in Minerva once they know they exist.

This should be very similar to what we did with Dark mode: T361047: Minerva Night Mode launch notifications

User story

As a reader on Minerva, I want to know that easter eggs are available and how to turn them on.

Requirements
  • Promotional notification shown as soon as possible to logged and logged out readers on Minerva where the configuration is enabled
  • 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.
  • Notification uses Codex Dialog component and follows its mobile behaviour.
Design

Figma link: https://www.figma.com/design/wr6JE07aP6jaXNHWW04qzg/Easter-eggs?node-id=5-110&t=BUaUXs3wCpTQf4IE-1

Screenshot 2025-11-13 at 1.42.40 PM.png (1×2 px, 473 KB)

Event Timeline

Change #1236718 had a related patch set uploaded (by ATitkov; author: ATitkov):

[mediawiki/extensions/WP25EasterEggs@master] Implement launch banner for Minerva skin

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

Banner code

<script> 
    const CNContext = mw.centralNotice.kvStore.contexts.GLOBAL;
    const CNBannerKey = 'impression_diet_wp25eastereggs-minerva-launch-banner';
    const impressions = mw.centralNotice.kvStore.getItem( CNBannerKey, CNContext );

    if ( impressions.seenCount === 1 ) {
        mw.loader.using( 'ext.wp25EasterEggs.minervaLaunchBanner', function( require ) {
            require( 'ext.wp25EasterEggs.minervaLaunchBanner')();
        } );
    }
</script>

In order to test locally, one can run the following in the js console

mw.loader.using( 'ext.wp25EasterEggs.minervaLaunchBanner', function( require ) {
    require( 'ext.wp25EasterEggs.minervaLaunchBanner')();
} );

There is still one missing part - the banner is supposed to be displayed only on Minerva

For the banner code above, should the if condition be if ( impressions.seenCount === 0 ) or <1? Just want to double check bc I'm not familiar with Central Notice

The code used for the banner was partially taken from here https://phabricator.wikimedia.org/T361047#9839444 which was setup with "maximum impressions any individual will see" being 2.

So IIUC impressions.seenCount accounts for the current view of the banner by the user, thus having impressions.seenCount === 1 on first view.

There is still one missing part - the banner is supposed to be displayed only on Minerva

The CNB campaign will handle that part

Hi @Ejegg! I have been helping @ATitkov and some others in P&T prepare centralnotice banners to promote the Easter Egg feature they're building.

They're using javascript to display the banner, you can see the banner code a couple comments up. I thought you might be able to answer this one specific question:

Will mw.centralNotice.kvStore.getItem( CNBannerKey, CNContext ); in their code return seenCount 0 or 1 on the first banner impression?

@spatton and @ATitkov that should be 1 by the time any in-banner code gets to read it.

The seenCount is incremented and stored in the 'preBannerHandler':
https://phabricator.wikimedia.org/diffusion/ECNO/browse/wmf_deploy/resources/subscribing/ext.centralNotice.impressionDiet.js#L123

Then the pre-banner hooks are called before the banner code is loaded into the page:
https://phabricator.wikimedia.org/diffusion/ECNO/browse/wmf_deploy/resources/ext.centralNotice.display/index.js#L476

@spatton and @Ejegg thank you for making it clear! Much appreciated!

Change #1236718 merged by jenkins-bot:

[mediawiki/extensions/WP25EasterEggs@master] Implement launch banner for Minerva skin

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

Jdlrobson-WMF set the point value for this task to 1.Feb 10 2026, 6:33 PM

Change #1240241 had a related patch set uploaded (by ATitkov; author: ATitkov):

[mediawiki/extensions/WP25EasterEggs@master] Remove launch banner for Minerva skin

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

Thank you @Volker_E for catching!! There is indeed a patch for review 🙃

Tested on enwiki beta with

mw.loader.using( 'ext.wp25EasterEggs.minervaLaunchBanner', function( require ) {
    require( 'ext.wp25EasterEggs.minervaLaunchBanner')();
} );

Screenshot 2026-02-20 at 6.05.05 PM.png (686×1 px, 161 KB)

Testing note to test in production:

  • check if a modal is displayed, as per design, not an overlay:

Screenshot 2026-02-20 at 5.40.59 PM.png (736×344 px, 39 KB)

Change #1240241 merged by jenkins-bot:

[mediawiki/extensions/WP25EasterEggs@master] Remove launch banner for Minerva skin

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