Page MenuHomePhabricator

WikiGrok icon inside the main menu loads after other icons and it's noticable
Closed, InvalidPublic

Description

Visit http://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MobileMenu?mobileaction=alpha and look at the 'Contribute' menu item. No matter how many times you refresh the page (after clearing the cache, obviously), the icon next to that item is always slow to load. This slowness is especially noticeable on slow connections, in my local development environment for example (vagrant).

Event Timeline

bmansurov raised the priority of this task from to Needs Triage.
bmansurov updated the task description. (Show Details)
bmansurov subscribed.
Jdlrobson set Security to None.
Jdlrobson subscribed.

Not Gather related. Looks like the menu is broken in alpha by the way. I see heading "Site navigation"

So the reason why the icon loads slower than other icons is that it is an SVG as opposed to PNG. The icon size is ≈700b compared to ≈400b. Since we are trying to convert our icons to PNG, I think we can close the task as a wontfix. Please reopen if you think otherwise.

We are trying to convert our icons to SVG (not to PNG)... and this should make no difference to load times. The problem you have is the wikigrok icon is in a separate module and loaded at a different time.

Oops, I meant to say SVG, which is what WikiGrok icon already is. I'll create a PNG version of the icon too, which should solve the non JS issue.

Change 210205 had a related patch set uploaded (by Bmansurov):
Create PNG versions of the SVG files

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

Re-closing because WikiGrok doesn't work without JS and there is no need to generate PNG files from SVGs.

Change 210205 abandoned by Bmansurov:
Create PNG versions of the SVG files

Reason:
No need to convert files because WikiGrok doesn't work without JS anyway.

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

@phuedx People may end up on this page if they have a slow connection and it does look a bit funky and unprofessional. It feels like you should do something here rather than ignore the problem...

Isn't this caused by the ext.wikigrok.roulette module being loaded by the RL after the page has loaded? While proving this I also noticed that you still see the Contribute menu item when JS is disabled…

Possible solution: create a new module specifically for the main menu styles and $out->addModuleStyles( 'ext.wikigrok.mainMenu' ); in \WikiGrok\Hooks::onBeforePageDisplay.

T98392 in Gather has exactly the same problem so check how we do it. We may want to add a hook to register icons in a main menu module to simplify this.

WikiGrok has been disabled in production.