Page MenuHomePhabricator

Echo should progressively enhance existing notification icon rather than creating its own
Closed, ResolvedPublicBUG REPORT

Description

Echo currently maintains 2 versions of the badge that users interact with:

  • The initial server side rendered version (usually rendered by skins))
  • A client side OOUI version that is rendered when the badge is clicked (replacing the existing version)

We've accumulated various technical debt over the years of skins having to maintain their own styles whenever the OOUI button is rendered

Proposed solution

Please progressively enhance the existing button rather than replacing it.

QA

  • When clicking the button a PopupWidget should be shown pointing to the existing button
  • mw.hook should be used to update the notification count

Requirement

Echo should enhance the server-rendered notification and inbox icons in Vector skin by attaching the PopupWidget to them directly, instead of replacing them with new OOUI buttons on client-side render.

BDD

Feature: Progressive enhancement of Echo notification UI

Scenario: Notification button is progressively enhanced
Given I am using the Vector skin
When I click the Notifications button in the top right
Then a PopupWidget appears pointing to the same button without replacing it

Scenario: Inbox button is progressively enhanced
Given I am using the Vector skin
When I click the Inbox button in the top right
Then a PopupWidget appears pointing to the same button without replacing it

Test Steps

Test Case 1: Notification button enhanced with PopupWidget

  1. Visit any page on https://en.wikipedia.beta.wmflabs.org while logged in and using the Vector skin.
  2. Open DevTools and inspect the notification bell element.
  3. Confirm that it is *not* re-rendered or replaced with a new button on page load.
  4. Click the notification (bell) icon.
  5. AC1: A PopupWidget appears anchored to the existing button.

Test Case 2: Inbox button enhanced with PopupWidget

  1. Stay logged in on Vector skin on any page (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page).
  2. Inspect the inbox icon.
  3. Confirm the element is not re-rendered on click.
  4. Click the inbox (tray/mail) icon.
  5. AC2: A PopupWidget appears pointing to the original inbox button.

QA Results - Prod

ACStatusDetails
1T343838#10868217
2T343838#10868217

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Something has changed in either Vector or Codex. I think we just need to add background-repeat: no-repeat; background-position: center somewhere.
From a quick glance I think something changed in the implementation of .vector-icon

Change #1128000 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Echo@master] POC: Stop replacing the Echo icon, progressively enhance instead

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

Jdlrobson-WMF changed the task status from Open to In Progress.Apr 3 2025, 6:42 PM

Change #1143914 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Drop code that switches Echo OOUI icons back to Codex

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

Change #1128000 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Stop replacing the Echo icon, progressively enhance instead

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

Change #1143914 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Drop code that switches Echo OOUI icons back to Codex

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

Change #1146025 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/Echo@master] Remove some more unused code for replacing the badge icons

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

Change #1146025 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Remove some more unused code for replacing the badge icons

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

Jdlrobson-WMF updated the task description. (Show Details)
Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Sonoma
Browser: Chrome
Device: MS
Emulated Device: N/A

Test Artifact(s): See screenshots attached in Phabricator comment.

Test Steps

Test Case 1: Notification button enhanced with PopupWidget

  1. Log in to https://en.wikipedia.beta.wmflabs.org using the Vector skin.
  2. Open DevTools and inspect the notification bell icon.
  3. Confirm the element is not replaced after page load.
  4. Click the notification bell.
  5. AC1: A PopupWidget appears anchored to the original notification icon.
screenshot 344.png (557×1 px, 200 KB)
screenshot 346.png (557×1 px, 144 KB)

Test Case 2: Inbox button enhanced with PopupWidget

  1. Stay on the same page.
  2. Inspect the inbox (envelope) icon in DevTools.
  3. Confirm the icon is not replaced or re-rendered.
  4. Click the inbox icon.
  5. AC2: A PopupWidget appears pointing to the original inbox icon.
screenshot 345.png (557×1 px, 222 KB)
screenshot 347.png (557×1 px, 139 KB)