Page MenuHomePhabricator

Icons rendered via JavaScript in Minerva should use Codex mixin
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Related: T346184

Minerva has various modules for providing icon packs. Given the limitations with the selector and variants, it is sometimes confusing which icon pack to put it in.

There are few benefits of using icon packs for modules loaded via JS (for render blocking styles they can be useful given they support use of URLs rather than data URIs) so it's suggested we remove the modules in favor of the Codex icon mixin.

TODO

  • For any icon rendered via JavaScript, use Codex mixins. This applies to the following modules:
  • skins.minerva.icons.images.scripts.misc
  • skins.minerva.icons.page.issues.uncolored
  • skins.minerva.icons.page.issues.default.color
  • skins.minerva.icons.page.issues.medium.color
  • Any icons with the mw-ui-icon-minerva prefix have the minerva-icon- prefix (if needed)
  • The following should remain icon packs, since they use "useDataURI: falsE" (or are loaded on page load):
  • skins.minerva.content.styles.images
  • skins.minerva.overflow.icons
  • skins.minerva.icons.wikimedia
  • skins.minerva.mainMenu.icons
  • skins.minerva.personalMenu.icons
  • The following modules should be updated to use useDataURI to reduce bundle size:
  • skins.minerva.mainMenu.advanced.icons
  • skins.minerva.personalMenu.icons [done in https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/979964]

QA

Manually review any Pixel "regressions" and confirm they are improvements/acceptable.

Event Timeline

Jdlrobson updated the task description. (Show Details)
Jdlrobson set the point value for this task to 3.Nov 9 2023, 6:26 PM

Will it be usable via mobile phone? The problem with codes or programming is that it is sometimes limited to browsing my desktop

Mo will start by addressing FIXMEs in the codebase.

Change 979964 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/skins/MinervaNeue@master] Icons rendered via JavaScript in Minerva should use Codex mixin

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

Change 979964 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Update modules to not use data URIs to reduce bundle size

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

  • skins.minerva.content.styles.images
  • skins.minerva.overflow.icons
  • skins.minerva.icons.wikimedia
  • skins.minerva.mainMenu.icons
  • skins.minerva.personalMenu.icons

All have "useDataURI": false

can't find mw-ui-icon-minerva in the code base seems it was cleared up previously

  • skins.minerva.icons.images.scripts.misc
  • skins.minerva.icons.page.issues.uncolored
  • skins.minerva.icons.page.issues.default.color
  • skins.minerva.icons.page.issues.medium.color

Those modules seems to be removed/replaced by skins.minerva.icons.wikimedia and it is using mixins with the "useDataURI": false option

Mo I am not seeing a patch for AC1. To be clear the AC is to get rid of those modules by using the Codex mixins. It is preferable to get icons from Codex as inline SVGs in our JavaScript code rather than relying on the OOUI icon pack.

Change 980830 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/skins/MinervaNeue@master] Icons rendered via JavaScript in Minerva should use Codex mixin

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

Mo I am not seeing a patch for AC1. To be clear the AC is to get rid of those modules by using the Codex mixins. It is preferable to get icons from Codex as inline SVGs in our JavaScript code rather than relying on the OOUI icon pack.

I cannot find the modules mentioned in AC1

  • skins.minerva.icons.images.scripts.misc
  • skins.minerva.icons.page.issues.uncolored
  • skins.minerva.icons.page.issues.default.color
  • skins.minerva.icons.page.issues.medium.color

Those modules seems to be removed/replaced by skins.minerva.icons.wikimedia and it is using mixins with the "useDataURI": false option

If I am missing something can you give me on example and I will carry on

Jdlrobson added a subscriber: Mabualruz.

Talked to Mo and the AC1 is indeed done (my mistake).
The remaining result is a FIXME that can't be removed just yet: https://codesearch.wmcloud.org/search/?q=mw-ui-icon-&files=&excludeFiles=&repos=#Skin:MinervaNeue

@Jdlrobson, I'm not sure what to do here. Looks like Mo did the QA already

Yep this looks good to me. According to Pixel the only changes here were the 15 relating to T346670.

[1] https://pixel.wmcloud.org/archive/origin/wmf/1.42.0-wmf.9/mobile/

Change 980830 abandoned by Mabualruz:

[mediawiki/skins/MinervaNeue@master] Icons rendered via JavaScript in Minerva should use Codex mixin

Reason:

We still are waiting for the results to be empty we will create a new patch once it is

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