Page MenuHomePhabricator

Provide server-side registration for Gadgets to add tabs to skin output without flash of content
Closed, ResolvedPublic

Description

Gadgets that add portlet tabs to the page skin (such as T152013) can cause a 'flash' of moving web content due to the potentially large delay between loading the server-side-generated HTML and loading the gadget JS.

One possible fix for this would be to allow gadgets to register for custom tabs in a structured way, so the tab can be added via the server-side HTML.

Possible format:

  • add [[MediaWiki:Gadget-foobar.json]] with:
{
 tabs: [
  {
   // options for https://www.mediawiki.org/wiki/ResourceLoader/Modules#addPortletLink
   "portletId": "p-awesome",
   "href": "/wiki/Special:Version",
   "text": "awesome-msg",
   "id": "t-awesome",
   "accessKey": "q",
   "nextNode": "#t-print"
  }
 ]
}

Possible issues:

  • if tab should appear conditionally, how to specify?
  • fallback behavior when no JS?

Event Timeline

Note that we now have gadget peers, that commons maintainers can use to stabilise the position of elements. Gadgets like Twinkle and the UTC clock on various wiki's already use this technique.

TheDJ closed this task as Resolved.EditedDec 22 2021, 3:16 PM
TheDJ claimed this task.

I think we consider peer css-only gadgets the fix for this.