Page MenuHomePhabricator

Migrate ResourceLoader Icons in Minerva to use Codex
Closed, ResolvedPublic3 Estimated Story Points

Description

This is follow up T363920

Background

Migrating to Codex icons ensures consistency with icon styles and usage across skins/extensions, and allows to remove extra CSS and special icon cases
While we don't do this we waste time addressing issues such as T365951.

User story

As a developer, I want icons to be more maintainable and less prone to breaking, which will affect the end user

Design

  • no visual changes

Acceptance criteria

  • The modules for icons have been removed. In its place, a Codex CSS mixin is used to render icons.
  • There is no increase in CSS bytes shipped, as we are using a URL to an SVG rather than an embedded data URI (a solution that should be provided by T358246)
  • In night mode, all icons would behave correctly thanks to CSS variables, rather than a CSS filter (invert).

Communication criteria - does this need an announcement or discussion?

  • No

Sign off

  • Setup ticket for follow up task to remove need for ResourceLoader/ImageModule altogether.

QA

Ensure that icons in minerva are using mask image.

Requirement

Ensure that all icons in the Minerva skin are migrated to Codex, specifically focusing on the use of mask-image to render icons. This migration should improve consistency and maintainability while ensuring the correct behavior of icons in both light and night modes.

BDD

Feature: Migrate ResourceLoader Icons to Codex in Minerva

  Scenario: Icons in Minerva use mask-image
    Given icons are rendered in Minerva
    When the user views the page
    Then icons should be rendered using `mask-image`

Test Steps

Test Case 1: Verify Icons Use mask-image in Minerva

  1. Visit any page using the Minerva skin.
  2. Open the browser’s Developer Tools
  3. Navigate to the "Elements" tab to inspect the page's HTML and CSS.
  4. Select an icon element.
  5. In the "Styles" pane, look for the mask-image property within the applied CSS rules.
  6. AC1: Confirm that the mask-image property is present and applied to the icon elements.

QA Results - Beta

ACStatusDetails
1T374145#10220385

QA Results - Prod

ACStatusDetails
1T374145#10248980

Event Timeline

ovasileva lowered the priority of this task from High to Medium.Sep 16 2024, 5:34 PM

Change #1075343 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/MinervaNeue@master] Add mask image

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

Change #1076251 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/GrowthExperiments@master] Migrate Growth icons to Codex

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

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

[mediawiki/extensions/GrowthExperiments@master] Switch GrowthExperiments to use standard Codex icon

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

Change #1076253 abandoned by Jdlrobson:

[mediawiki/extensions/GrowthExperiments@master] Switch GrowthExperiments to use standard Codex icon

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

Blocked on a CI issue with Growth experiments

16:17:59 There was 1 failure:
16:17:59 
16:17:59 1) ArticlePlaceholder\Tests\AboutTopicRendererTest::testLanguageLinks
16:17:59 Failed asserting that two arrays are identical.
16:17:59 --- Expected
16:17:59 +++ Actual
16:17:59 @@ @@
16:17:59  Array &0 (
16:17:59 -    'eo' => 'eo:Unicorn'
16:17:59 +    0 => 'eo:Unicorn'
16:17:59  )
16:17:59 
16:17:59 /workspace/src/extensions/ArticlePlaceholder/tests/phpunit/includes/AboutTopicRendererTest.php:119

Change #1076251 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Migrate Growth icons to Codex

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

Change #1075343 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Update Minerva skin to use Codex icons

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

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

[mediawiki/skins/MinervaNeue@master] Disable unused icon variants

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

Change #1077757 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Disable unused icon variants

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

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Icons Use mask-image in Minerva

  1. Visit any page using the Minerva skin.
  2. Open the browser’s Developer Tools
  3. Navigate to the "Elements" tab to inspect the page's HTML and CSS.
  4. Select an icon element.
  5. In the "Styles" pane, look for the mask-image property within the applied CSS rules.
  6. AC1: Confirm that the mask-image property is present and applied to the icon elements.

screenshot 68.png (1×1 px, 628 KB)

Jdlrobson claimed this task.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS
Browser: Chrome
Device: MS
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Icons Use mask-image in Minerva

  1. Visit any page using the Minerva skin.
  2. Open the browser’s Developer Tools
  3. Navigate to the "Elements" tab to inspect the page's HTML and CSS.
  4. Select an icon element.
  5. In the "Styles" pane, look for the mask-image property within the applied CSS rules.
  6. AC1: Confirm that the mask-image property is present and applied to the icon elements.

screenshot 112.png (1×1 px, 473 KB)