Page MenuHomePhabricator

Create the simple summary banner
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
Jdlrobson-WMF
Feb 26 2025, 10:32 PM
Referenced Files
F58856387: screenshot 125.png
Mar 18 2025, 1:11 AM
F58856386: screenshot 126.png
Mar 18 2025, 1:11 AM
F58856383: screenshot 124.png
Mar 18 2025, 1:11 AM
F58856341: screenshot 123.png
Mar 18 2025, 1:11 AM
F58856337: screenshot 122.png
Mar 18 2025, 1:11 AM
F58856106: screenshot 121.png
Mar 18 2025, 1:11 AM
F58856017: screenshot 120.png
Mar 18 2025, 1:11 AM
F58507633: Screenshot 2025-02-26 at 2.35.03 PM.png
Feb 26 2025, 10:35 PM

Description

Background

If we introduce a pre-generated summary feature as an opt-in feature on a the mobile site of a production wiki, we will be able to measure a CTR greater than 4%, ensure no negative effects to session length, pageviews, or internal referrals, and use this data to decide how and if we will further scale the summary feature."

To get started on this we need to have an entry point and an incremental code base to work on.

User story

As a user I see a banner at the top of mobile page views

Requirements

  • All code lives in the new ArticleSummaries extension created in T386476.
  • The banner does not show to browsers where JavaScript is not supported (either disabled or an old browser e.g. IE11)

[]x The banner makes use of the ArticleSummariesEnabled feature flag and is only shown when that flag is enabled.

  • The banner only shows on the Minerva skin.
  • A banner is shown at the top of pages which have a simple summary available. For now given we do not have simple summaries, this will be provided by a function hasSimpleSummaries( Title $title ) which returns a boolean.
  • The banner should only display on articles which do not contain a hatnote or ambox. To keep things simple here, this should be detected by checking the article HTML for the presence of the word "hatnote" or "ambox". When a banner is excluded on a page, we log a message using the follwoing code:
$logger = LoggerFactory::getInstance( 'ArticleSummaries' );
$logger->warning( 'ArticleSummaries not supported on this page.' );
  • The banner for now should use the current date for the message "Machine generated on". This will be wired up later.
  • The banner can be localized.

BDD

Feature: Display simple summary banner under specific conditions  

  Scenario: Banner displays for eligible articles  
    Given I am using a JavaScript-enabled browser  
    And the ArticleSummariesEnabled feature flag is enabled  
    And I am viewing a page using the Minerva skin  
    And the function hasSimpleSummaries( Title $title ) returns true  
    And the article does not contain "hatnote" or "ambox" in its HTML  
    When I view the page  
    Then the simple summary banner is displayed at the top  
    And the banner message includes today’s date with "Machine generated on"  
    And the banner is localized  

  Scenario: Banner does not display when JS is disabled  
    Given I have disabled JavaScript in my browser  
    When I view any article page  
    Then the simple summary banner is not displayed  

  Scenario: Banner does not display on non-Minerva skins  
    Given I am viewing a page using a non-Minerva skin  
    When I view the page  
    Then the simple summary banner is not displayed  

  Scenario: Banner does not display if hatnote or ambox is present  
    Given I am using a JavaScript-enabled browser with ArticleSummariesEnabled flag active  
    And I view an article that contains "hatnote" or "ambox" in the HTML  
    When I view the page  
    Then the simple summary banner is not displayed  
    And a warning log message "ArticleSummaries not supported on this page." is recorded

Test Steps

Test Case 1: Verify summary banner displays on eligible article

  1. Visit https://mylists.wmcloud.org/index.php/Main_Page in mobile view with JavaScript enabled.
  2. Ensure you are logged out.
  3. Confirm the Minerva skin is used.
  4. AC1: Confirm the simple summary banner appears at the top of the page.
  5. AC2: Confirm the banner text includes today’s date and the phrase “Machine generated on”.
  6. Append ?uselang=qqx to the URL.
  7. AC3: Confirm all banner text is no longer in English (i.e., keys are shown for localization).

Test Case 2: Verify banner does not display when hatnote is present

  1. Visit https://mylists.wmcloud.org/index.php/Hatnote in mobile view with JavaScript enabled.
  2. Ensure you are logged out and using Minerva skin.
  3. AC4: Confirm the simple summary banner is not displayed.
  4. AC5: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”

Test Case 3: Verify banner does not display when ambox is present

  1. Visit https://mylists.wmcloud.org/index.php/Ambox in mobile view with JavaScript enabled.
  2. Ensure you are logged out and using Minerva skin.
  3. AC6: Confirm the simple summary banner is not displayed.
  4. AC7: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”

Test Case 4: Verify banner does not display when JavaScript is disabled

  1. Disable JavaScript in the browser settings.
  2. Visit https://mylists.wmcloud.org/index.php/Main_Page.
  3. AC8: Confirm the simple summary banner is not displayed.

Test Case 5: Verify banner does not display on non-Minerva skins

  1. Visit https://mylists.wmcloud.org/index.php/Main_Page?useskin=vector.
  2. AC9: Confirm the simple summary banner is not displayed.

Design

Screenshot 2025-02-26 at 2.35.03 PM.png (772×1,602 px, 411 KB)

Acceptance criteria

See requirements.

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

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

Details

Event Timeline

Jdlrobson-WMF reopened this task as In Progress.
Jdlrobson-WMF claimed this task.
Jdlrobson-WMF moved this task from Incoming to Q3 on the Web-Team board.
Jdlrobson-WMF changed the task status from In Progress to Open.Mar 3 2025, 5:03 PM
Jdlrobson-WMF set the point value for this task to 3.
Jdlrobson-WMF moved this task from Q3 to Sprint Backlog on the Web-Team board.
Jdlrobson-WMF lowered the priority of this task from High to Medium.Mar 7 2025, 1:22 AM

Change #1126575 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/extensions/ArticleSummaries@master] Create the simple summary banner

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

Change #1126575 merged by Jdlrobson:

[mediawiki/extensions/ArticleSummaries@master] Create the simple summary banner

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

Jdlrobson-WMF added a subscriber: LMora-WMF.

For QA we can use https://mylists.wmcloud.org/index.php/Main_Page

Edtadros subscribed.

Test Steps

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: Beta (mylists.wmcloud.org)
OS: macOS
Browser: Chrome
Device: MS

Test Case 1: Verify summary banner displays on eligible article

  1. Visit https://mylists.wmcloud.org/index.php/Main_Page in mobile view with JavaScript enabled.
  2. Ensure you are logged out.
  3. Confirm the Minerva skin is used.
  4. ✅ AC1: Confirm the simple summary banner appears at the top of the page.
  5. ❓ AC2: Confirm the banner text includes today’s date and the phrase “Machine generated on”.

@Jdlrobson-WMF The requirement states the date should default to today's or the current date, but instead it looks like a placeholder.

screenshot 120.png (1,024×243 px, 30 KB)

  1. Append ?uselang=qqx to the URL.
  2. ❓AC3: Confirm all banner text is no longer in English (i.e., keys are shown for localization).

Is this what is expected?

screenshot 121.png (1,033×246 px, 32 KB)

Test Case 2: Verify banner does not display when hatnote is present

  1. Visit https://mylists.wmcloud.org/index.php/Hatnote in mobile view with JavaScript enabled.
  2. Ensure you are logged out and using Minerva skin.
  3. ✅ AC4: Confirm the simple summary banner is not displayed.

screenshot 122.png (1,343×877 px, 118 KB)

  1. ❓ AC5: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”

I don't beleve the log message is something I can validate.

Test Case 3: Verify banner does not display when ambox is present

  1. Visit https://mylists.wmcloud.org/index.php/Ambox in mobile view with JavaScript enabled.
  2. Ensure you are logged out and using Minerva skin.
  3. ✅AC6: Confirm the simple summary banner is not displayed.

screenshot 123.png (1,345×979 px, 150 KB)

  1. ❓AC7: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”

I don't beleve the log message is something I can validate.

Test Case 4: Verify banner does not display when JavaScript is disabled

  1. Disable JavaScript in the browser settings.
  2. Visit https://mylists.wmcloud.org/index.php/Main_Page.
  3. ✅ AC8: Confirm the simple summary banner is not displayed.

screenshot 124.png (1,343×359 px, 48 KB)

Test Case 5: Verify banner does not display on non-Minerva skins

  1. Visit https://mylists.wmcloud.org/index.php/Main_Page?useskin=vector.
  2. ✅ AC9: Confirm the simple summary banner is not displayed.

screenshot 126.png (1,331×604 px, 134 KB)

screenshot 125.png (1,331×589 px, 132 KB)

❓ AC2: Confirm the banner text includes today’s date and the phrase “Machine generated on”.

That's a pass.

❓AC3: Confirm all banner text is no longer in English (i.e., keys are shown for localization).

Is this what is expected?

Yes as expected. Also a pass.

❓AC7: Confirm that a warning log message is recorded: “ArticleSummaries not supported on this page.”

@LMora-WMF looks like we forgot this one.